juxscript 1.1.90 → 1.1.92
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/lib/components/stack/BaseStack.d.ts +5 -35
- package/lib/components/stack/BaseStack.d.ts.map +1 -1
- package/lib/components/stack/BaseStack.js +60 -184
- package/lib/components/stack/BaseStack.ts +62 -222
- package/lib/components/stack/HStack.d.ts +0 -8
- package/lib/components/stack/HStack.d.ts.map +1 -1
- package/lib/components/stack/HStack.js +0 -8
- package/lib/components/stack/HStack.ts +0 -8
- package/lib/components/stack/VStack.d.ts +0 -5
- package/lib/components/stack/VStack.d.ts.map +1 -1
- package/lib/components/stack/VStack.js +1 -7
- package/lib/components/stack/VStack.ts +1 -7
- package/lib/components/stack/ZStack.d.ts +0 -8
- package/lib/components/stack/ZStack.d.ts.map +1 -1
- package/lib/components/stack/ZStack.js +0 -8
- package/lib/components/stack/ZStack.ts +0 -8
- package/machinery/compiler3.js +282 -113
- package/package.json +1 -1
|
@@ -30,14 +30,12 @@ interface StackState extends BaseState {
|
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* BaseStack - Foundation for all stack layout components
|
|
33
|
-
* Provides common styling, child management, and progressive effects
|
|
34
33
|
*/
|
|
35
34
|
export abstract class BaseStack extends BaseComponent<StackState> {
|
|
36
35
|
protected abstract baseClassName: string;
|
|
37
|
-
private _inlineStyles: Map<string, string> = new Map();
|
|
36
|
+
private _inlineStyles: Map<string, string> = new Map();
|
|
38
37
|
|
|
39
38
|
constructor(id: string, children: Record<string, any> | any[], options: StackOptions = {}) {
|
|
40
|
-
// Convert children object to array, preserving order
|
|
41
39
|
const childArray = Array.isArray(children)
|
|
42
40
|
? children
|
|
43
41
|
: Object.values(children);
|
|
@@ -97,173 +95,65 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
97
95
|
}
|
|
98
96
|
|
|
99
97
|
/* ═════════════════════════════════════════════════════════════════
|
|
100
|
-
* FLUENT STYLE API
|
|
98
|
+
* FLUENT STYLE API
|
|
101
99
|
* ═════════════════════════════════════════════════════════════════ */
|
|
102
100
|
|
|
103
|
-
/**
|
|
104
|
-
* Internal helper to add individual CSS properties
|
|
105
|
-
*/
|
|
106
101
|
private _addStyle(property: string, value: string): this {
|
|
107
|
-
this._inlineStyles.set(property, value);
|
|
108
|
-
this._updateStyleAttribute();
|
|
102
|
+
this._inlineStyles.set(property, value);
|
|
103
|
+
this._updateStyleAttribute();
|
|
109
104
|
return this;
|
|
110
105
|
}
|
|
111
106
|
|
|
112
|
-
/**
|
|
113
|
-
* Build and apply the complete style attribute
|
|
114
|
-
*/
|
|
115
107
|
private _updateStyleAttribute(): void {
|
|
116
|
-
const styleString = Array.from(this._inlineStyles.entries())
|
|
117
|
-
.map(([prop, val]) => `${prop}: ${val}`)
|
|
118
|
-
.join('; ');
|
|
108
|
+
const styleString = Array.from(this._inlineStyles.entries())
|
|
109
|
+
.map(([prop, val]) => `${prop}: ${val}`)
|
|
110
|
+
.join('; ');
|
|
119
111
|
|
|
120
112
|
this.state.style = styleString;
|
|
121
113
|
}
|
|
122
114
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
maxWidth(value: string): this {
|
|
154
|
-
return this._addStyle('max-width', value);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
minHeight(value: string): this {
|
|
158
|
-
return this._addStyle('min-height', value);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
maxHeight(value: string): this {
|
|
162
|
-
return this._addStyle('max-height', value);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Visual
|
|
166
|
-
background(value: string): this {
|
|
167
|
-
return this._addStyle('background', value);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
backgroundColor(value: string): this {
|
|
171
|
-
return this._addStyle('background-color', value);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
boxShadow(value: string): this {
|
|
175
|
-
return this._addStyle('box-shadow', value);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
opacity(value: string | number): this {
|
|
179
|
-
return this._addStyle('opacity', String(value));
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Positioning
|
|
183
|
-
position(value: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'): this {
|
|
184
|
-
return this._addStyle('position', value);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
top(value: string): this {
|
|
188
|
-
return this._addStyle('top', value);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
right(value: string): this {
|
|
192
|
-
return this._addStyle('right', value);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
bottom(value: string): this {
|
|
196
|
-
return this._addStyle('bottom', value);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
left(value: string): this {
|
|
200
|
-
return this._addStyle('left', value);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
zIndex(value: string | number): this {
|
|
204
|
-
return this._addStyle('z-index', String(value));
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Overflow
|
|
208
|
-
overflow(value: 'visible' | 'hidden' | 'scroll' | 'auto'): this {
|
|
209
|
-
return this._addStyle('overflow', value);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
overflowX(value: 'visible' | 'hidden' | 'scroll' | 'auto'): this {
|
|
213
|
-
return this._addStyle('overflow-x', value);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
overflowY(value: 'visible' | 'hidden' | 'scroll' | 'auto'): this {
|
|
217
|
-
return this._addStyle('overflow-y', value);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Display
|
|
221
|
-
display(value: string): this {
|
|
222
|
-
return this._addStyle('display', value);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Cursor
|
|
226
|
-
cursor(value: string): this {
|
|
227
|
-
return this._addStyle('cursor', value);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// Transform
|
|
231
|
-
transform(value: string): this {
|
|
232
|
-
return this._addStyle('transform', value);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
transformOrigin(value: string): this {
|
|
236
|
-
return this._addStyle('transform-origin', value);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// Transition & Animation
|
|
240
|
-
transition(value: string): this {
|
|
241
|
-
return this._addStyle('transition', value);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
animation(value: string): this {
|
|
245
|
-
return this._addStyle('animation', value);
|
|
246
|
-
}
|
|
115
|
+
padding(value: string): this { return this._addStyle('padding', value); }
|
|
116
|
+
margin(value: string): this { return this._addStyle('margin', value); }
|
|
117
|
+
border(value: string): this { return this._addStyle('border', value); }
|
|
118
|
+
borderRadius(value: string): this { return this._addStyle('border-radius', value); }
|
|
119
|
+
width(value: string): this { return this._addStyle('width', value); }
|
|
120
|
+
height(value: string): this { return this._addStyle('height', value); }
|
|
121
|
+
minWidth(value: string): this { return this._addStyle('min-width', value); }
|
|
122
|
+
maxWidth(value: string): this { return this._addStyle('max-width', value); }
|
|
123
|
+
minHeight(value: string): this { return this._addStyle('min-height', value); }
|
|
124
|
+
maxHeight(value: string): this { return this._addStyle('max-height', value); }
|
|
125
|
+
background(value: string): this { return this._addStyle('background', value); }
|
|
126
|
+
backgroundColor(value: string): this { return this._addStyle('background-color', value); }
|
|
127
|
+
boxShadow(value: string): this { return this._addStyle('box-shadow', value); }
|
|
128
|
+
opacity(value: string | number): this { return this._addStyle('opacity', String(value)); }
|
|
129
|
+
position(value: string): this { return this._addStyle('position', value); }
|
|
130
|
+
top(value: string): this { return this._addStyle('top', value); }
|
|
131
|
+
right(value: string): this { return this._addStyle('right', value); }
|
|
132
|
+
bottom(value: string): this { return this._addStyle('bottom', value); }
|
|
133
|
+
left(value: string): this { return this._addStyle('left', value); }
|
|
134
|
+
zIndex(value: string | number): this { return this._addStyle('z-index', String(value)); }
|
|
135
|
+
overflow(value: string): this { return this._addStyle('overflow', value); }
|
|
136
|
+
overflowX(value: string): this { return this._addStyle('overflow-x', value); }
|
|
137
|
+
overflowY(value: string): this { return this._addStyle('overflow-y', value); }
|
|
138
|
+
display(value: string): this { return this._addStyle('display', value); }
|
|
139
|
+
cursor(value: string): this { return this._addStyle('cursor', value); }
|
|
140
|
+
transform(value: string): this { return this._addStyle('transform', value); }
|
|
141
|
+
transformOrigin(value: string): this { return this._addStyle('transform-origin', value); }
|
|
142
|
+
transition(value: string): this { return this._addStyle('transition', value); }
|
|
143
|
+
animation(value: string): this { return this._addStyle('animation', value); }
|
|
247
144
|
|
|
248
145
|
/* ═════════════════════════════════════════════════════════════════
|
|
249
146
|
* PROGRESSIVE CHILD STYLING
|
|
250
147
|
* ═════════════════════════════════════════════════════════════════ */
|
|
251
148
|
|
|
252
|
-
/**
|
|
253
|
-
* Apply custom styles to each child progressively
|
|
254
|
-
*/
|
|
255
149
|
childStyle(stylesOrFunction: string[] | ChildStyleFunction): this {
|
|
256
150
|
this.state.childStyles = stylesOrFunction;
|
|
257
151
|
return this;
|
|
258
152
|
}
|
|
259
153
|
|
|
260
|
-
/**
|
|
261
|
-
* Cascade effect - offset children progressively
|
|
262
|
-
*/
|
|
263
154
|
cascade(baseOffset: number = 20, axis: 'x' | 'y' | 'both' | 'horizontal' | 'vertical' | 'xy' = 'both'): this {
|
|
264
155
|
this.state.childStyles = (index: number) => {
|
|
265
156
|
const offset = baseOffset * index;
|
|
266
|
-
|
|
267
157
|
if (axis === 'horizontal' || axis === 'x') {
|
|
268
158
|
return `margin-left: ${offset}px;`;
|
|
269
159
|
} else if (axis === 'vertical' || axis === 'y') {
|
|
@@ -275,9 +165,6 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
275
165
|
return this;
|
|
276
166
|
}
|
|
277
167
|
|
|
278
|
-
/**
|
|
279
|
-
* Fan effect - rotate children progressively
|
|
280
|
-
*/
|
|
281
168
|
fan(angle: number = 5, origin: string = 'bottom center'): this {
|
|
282
169
|
this.state.childStyles = (index: number) => {
|
|
283
170
|
const rotation = angle * index;
|
|
@@ -286,9 +173,6 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
286
173
|
return this;
|
|
287
174
|
}
|
|
288
175
|
|
|
289
|
-
/**
|
|
290
|
-
* Scale progression - shrink/grow children
|
|
291
|
-
*/
|
|
292
176
|
scaleProgressive(startScale: number = 1, step: number = 0.05, origin: string = 'center'): this {
|
|
293
177
|
this.state.childStyles = (index: number) => {
|
|
294
178
|
const scale = startScale - (step * index);
|
|
@@ -297,9 +181,6 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
297
181
|
return this;
|
|
298
182
|
}
|
|
299
183
|
|
|
300
|
-
/**
|
|
301
|
-
* Fade effect - progressive opacity
|
|
302
|
-
*/
|
|
303
184
|
fade(startOpacity: number = 1, step: number = 0.15): this {
|
|
304
185
|
this.state.childStyles = (index: number) => {
|
|
305
186
|
const opacity = Math.max(0.1, startOpacity - (step * index));
|
|
@@ -308,9 +189,6 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
308
189
|
return this;
|
|
309
190
|
}
|
|
310
191
|
|
|
311
|
-
/**
|
|
312
|
-
* Blur effect - progressive blur
|
|
313
|
-
*/
|
|
314
192
|
blur(startBlur: number = 0, step: number = 2): this {
|
|
315
193
|
this.state.childStyles = (index: number) => {
|
|
316
194
|
const blur = startBlur + (step * index);
|
|
@@ -319,9 +197,6 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
319
197
|
return this;
|
|
320
198
|
}
|
|
321
199
|
|
|
322
|
-
/**
|
|
323
|
-
* Stagger animation delays
|
|
324
|
-
*/
|
|
325
200
|
stagger(baseDelay: number = 100): this {
|
|
326
201
|
this.state.childStyles = (index: number) => {
|
|
327
202
|
const delay = baseDelay * index;
|
|
@@ -339,32 +214,26 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
339
214
|
|
|
340
215
|
const classes = [this.baseClassName];
|
|
341
216
|
|
|
342
|
-
// Spacing modifier
|
|
343
217
|
if (spacing !== 'default') {
|
|
344
218
|
classes.push(`${this.baseClassName}-${spacing}`);
|
|
345
219
|
}
|
|
346
220
|
|
|
347
|
-
// Alignment
|
|
348
221
|
if (align) {
|
|
349
222
|
classes.push(`jux-stack-${align}`);
|
|
350
223
|
}
|
|
351
224
|
|
|
352
|
-
// Justification
|
|
353
225
|
if (justify) {
|
|
354
226
|
classes.push(`jux-stack-justify-${justify}`);
|
|
355
227
|
}
|
|
356
228
|
|
|
357
|
-
// Divider
|
|
358
229
|
if (divider) {
|
|
359
230
|
classes.push(`${this.baseClassName}-divider`);
|
|
360
231
|
}
|
|
361
232
|
|
|
362
|
-
// Responsive
|
|
363
233
|
if (responsive) {
|
|
364
234
|
classes.push(`${this.baseClassName}-responsive`);
|
|
365
235
|
}
|
|
366
236
|
|
|
367
|
-
// Custom classes
|
|
368
237
|
if (this.state.class) {
|
|
369
238
|
classes.push(this.state.class);
|
|
370
239
|
}
|
|
@@ -372,61 +241,38 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
372
241
|
return classes.join(' ');
|
|
373
242
|
}
|
|
374
243
|
|
|
375
|
-
protected renderChild(child: any, index: number):
|
|
376
|
-
|
|
244
|
+
protected renderChild(child: any, index: number): HTMLElement {
|
|
245
|
+
let childElement: HTMLElement;
|
|
246
|
+
|
|
247
|
+
// String - wrap in div
|
|
377
248
|
if (typeof child === 'string') {
|
|
378
|
-
|
|
249
|
+
childElement = document.createElement('div');
|
|
250
|
+
childElement.textContent = child;
|
|
379
251
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
child.render(temp);
|
|
386
|
-
|
|
387
|
-
if (child.container) {
|
|
388
|
-
let html = child.container.outerHTML;
|
|
389
|
-
child.container = null; // Reset for reuse
|
|
390
|
-
return this.injectChildStyle(html, index);
|
|
391
|
-
}
|
|
252
|
+
// JUX Component - render it
|
|
253
|
+
else if (child && typeof child.render === 'function' && 'container' in child) {
|
|
254
|
+
const tempContainer = document.createElement('div');
|
|
255
|
+
child.render(tempContainer);
|
|
256
|
+
childElement = child.container || tempContainer.firstElementChild as HTMLElement;
|
|
392
257
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
return this.injectChildStyle(child.outerHTML, index);
|
|
258
|
+
// DOM Element - use directly
|
|
259
|
+
else if (child instanceof HTMLElement) {
|
|
260
|
+
childElement = child;
|
|
397
261
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
if (typeof rendered === 'string') {
|
|
404
|
-
return this.wrapChildWithStyle(rendered, index);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
if (rendered && rendered.outerHTML) {
|
|
408
|
-
return this.injectChildStyle(rendered.outerHTML, index);
|
|
409
|
-
}
|
|
262
|
+
// Fallback
|
|
263
|
+
else {
|
|
264
|
+
childElement = document.createElement('div');
|
|
265
|
+
childElement.textContent = String(child);
|
|
410
266
|
}
|
|
411
267
|
|
|
412
|
-
//
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
const style = this.getChildStyle(index);
|
|
418
|
-
if (style) {
|
|
419
|
-
return `<div style="${style}">${html}</div>`;
|
|
268
|
+
// Apply child styles
|
|
269
|
+
const styleStr = this.getChildStyle(index);
|
|
270
|
+
if (styleStr) {
|
|
271
|
+
const existingStyle = childElement.getAttribute('style') || '';
|
|
272
|
+
childElement.setAttribute('style', existingStyle + '; ' + styleStr);
|
|
420
273
|
}
|
|
421
|
-
return html;
|
|
422
|
-
}
|
|
423
274
|
|
|
424
|
-
|
|
425
|
-
const style = this.getChildStyle(index);
|
|
426
|
-
if (style) {
|
|
427
|
-
return html.replace(/^<(\w+)/, `<$1 style="${style}"`);
|
|
428
|
-
}
|
|
429
|
-
return html;
|
|
275
|
+
return childElement;
|
|
430
276
|
}
|
|
431
277
|
|
|
432
278
|
private getChildStyle(index: number): string {
|
|
@@ -456,20 +302,14 @@ export abstract class BaseStack extends BaseComponent<StackState> {
|
|
|
456
302
|
wrapper.className = this.buildClasses();
|
|
457
303
|
wrapper.id = this._id;
|
|
458
304
|
|
|
459
|
-
// ✅ Apply the built style string
|
|
460
305
|
if (this.state.style) {
|
|
461
306
|
wrapper.setAttribute('style', this.state.style);
|
|
462
307
|
}
|
|
463
308
|
|
|
464
309
|
// Render all children
|
|
465
310
|
this.state.children.forEach((child, index) => {
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
tempDiv.innerHTML = childHtml;
|
|
469
|
-
|
|
470
|
-
if (tempDiv.firstChild) {
|
|
471
|
-
wrapper.appendChild(tempDiv.firstChild);
|
|
472
|
-
}
|
|
311
|
+
const childEl = this.renderChild(child, index);
|
|
312
|
+
wrapper.appendChild(childEl);
|
|
473
313
|
});
|
|
474
314
|
|
|
475
315
|
this._wireStandardEvents(wrapper);
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { BaseStack, StackOptions } from './BaseStack.js';
|
|
2
|
-
/**
|
|
3
|
-
* HStack - Horizontal Stack Component
|
|
4
|
-
* Arranges children in a horizontal row
|
|
5
|
-
*/
|
|
6
2
|
export declare class HStack extends BaseStack {
|
|
7
3
|
protected baseClassName: string;
|
|
8
4
|
constructor(id: string, children: Record<string, any> | any[], options?: StackOptions);
|
|
9
|
-
/**
|
|
10
|
-
* ✅ Static create method with auto-render
|
|
11
|
-
* Allows: hstack.create({ children }, options).padding('20px').render()
|
|
12
|
-
*/
|
|
13
5
|
static create(children: Record<string, any> | any[], options?: StackOptions): HStack;
|
|
14
6
|
}
|
|
15
7
|
export declare function hstack(id: string, children: Record<string, any> | any[], options?: StackOptions): HStack;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HStack.d.ts","sourceRoot":"","sources":["HStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD
|
|
1
|
+
{"version":3,"file":"HStack.d.ts","sourceRoot":"","sources":["HStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD,qBAAa,MAAO,SAAQ,SAAS;IACjC,SAAS,CAAC,aAAa,SAAgB;gBAE3B,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB;IAIzF,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM;CAY3F;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAE5G"}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { BaseStack } from './BaseStack.js';
|
|
2
|
-
/**
|
|
3
|
-
* HStack - Horizontal Stack Component
|
|
4
|
-
* Arranges children in a horizontal row
|
|
5
|
-
*/
|
|
6
2
|
export class HStack extends BaseStack {
|
|
7
3
|
constructor(id, children, options = {}) {
|
|
8
4
|
super(id, children, options);
|
|
9
5
|
this.baseClassName = 'jux-hstack';
|
|
10
6
|
}
|
|
11
|
-
/**
|
|
12
|
-
* ✅ Static create method with auto-render
|
|
13
|
-
* Allows: hstack.create({ children }, options).padding('20px').render()
|
|
14
|
-
*/
|
|
15
7
|
static create(children, options = {}) {
|
|
16
8
|
const id = `hstack-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
17
9
|
const instance = new HStack(id, children, options);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { BaseStack, StackOptions } from './BaseStack.js';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* HStack - Horizontal Stack Component
|
|
5
|
-
* Arranges children in a horizontal row
|
|
6
|
-
*/
|
|
7
3
|
export class HStack extends BaseStack {
|
|
8
4
|
protected baseClassName = 'jux-hstack';
|
|
9
5
|
|
|
@@ -11,10 +7,6 @@ export class HStack extends BaseStack {
|
|
|
11
7
|
super(id, children, options);
|
|
12
8
|
}
|
|
13
9
|
|
|
14
|
-
/**
|
|
15
|
-
* ✅ Static create method with auto-render
|
|
16
|
-
* Allows: hstack.create({ children }, options).padding('20px').render()
|
|
17
|
-
*/
|
|
18
10
|
static create(children: Record<string, any> | any[], options: StackOptions = {}): HStack {
|
|
19
11
|
const id = `hstack-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
20
12
|
const instance = new HStack(id, children, options);
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { BaseStack, StackOptions } from './BaseStack.js';
|
|
2
|
-
/**
|
|
3
|
-
* VStack - Vertical Stack Component
|
|
4
|
-
* Arranges children in a vertical column
|
|
5
|
-
*/
|
|
6
2
|
export declare class VStack extends BaseStack {
|
|
7
3
|
protected baseClassName: string;
|
|
8
4
|
constructor(id: string, children: Record<string, any> | any[], options?: StackOptions);
|
|
9
5
|
/**
|
|
10
6
|
* ✅ Static create method with auto-render
|
|
11
|
-
* Allows: vstack.create({ children }, options).padding('20px').render()
|
|
12
7
|
*/
|
|
13
8
|
static create(children: Record<string, any> | any[], options?: StackOptions): VStack;
|
|
14
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["VStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD
|
|
1
|
+
{"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["VStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD,qBAAa,MAAO,SAAQ,SAAS;IACjC,SAAS,CAAC,aAAa,SAAgB;gBAE3B,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB;IAIzF;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM;CAa3F;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAE5G"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { BaseStack } from './BaseStack.js';
|
|
2
|
-
/**
|
|
3
|
-
* VStack - Vertical Stack Component
|
|
4
|
-
* Arranges children in a vertical column
|
|
5
|
-
*/
|
|
6
2
|
export class VStack extends BaseStack {
|
|
7
3
|
constructor(id, children, options = {}) {
|
|
8
4
|
super(id, children, options);
|
|
@@ -10,13 +6,11 @@ export class VStack extends BaseStack {
|
|
|
10
6
|
}
|
|
11
7
|
/**
|
|
12
8
|
* ✅ Static create method with auto-render
|
|
13
|
-
* Allows: vstack.create({ children }, options).padding('20px').render()
|
|
14
9
|
*/
|
|
15
10
|
static create(children, options = {}) {
|
|
16
|
-
// Generate unique ID for anonymous stacks
|
|
17
11
|
const id = `vstack-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
18
12
|
const instance = new VStack(id, children, options);
|
|
19
|
-
// Auto-render after microtask
|
|
13
|
+
// ✅ Auto-render after microtask
|
|
20
14
|
queueMicrotask(() => {
|
|
21
15
|
if (!instance.container) {
|
|
22
16
|
instance.render('app');
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { BaseStack, StackOptions } from './BaseStack.js';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* VStack - Vertical Stack Component
|
|
5
|
-
* Arranges children in a vertical column
|
|
6
|
-
*/
|
|
7
3
|
export class VStack extends BaseStack {
|
|
8
4
|
protected baseClassName = 'jux-vstack';
|
|
9
5
|
|
|
@@ -13,14 +9,12 @@ export class VStack extends BaseStack {
|
|
|
13
9
|
|
|
14
10
|
/**
|
|
15
11
|
* ✅ Static create method with auto-render
|
|
16
|
-
* Allows: vstack.create({ children }, options).padding('20px').render()
|
|
17
12
|
*/
|
|
18
13
|
static create(children: Record<string, any> | any[], options: StackOptions = {}): VStack {
|
|
19
|
-
// Generate unique ID for anonymous stacks
|
|
20
14
|
const id = `vstack-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
21
15
|
const instance = new VStack(id, children, options);
|
|
22
16
|
|
|
23
|
-
// Auto-render after microtask
|
|
17
|
+
// ✅ Auto-render after microtask
|
|
24
18
|
queueMicrotask(() => {
|
|
25
19
|
if (!instance.container) {
|
|
26
20
|
instance.render('app');
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { BaseStack, StackOptions } from './BaseStack.js';
|
|
2
|
-
/**
|
|
3
|
-
* ZStack - Layered/Overlapping Stack Component
|
|
4
|
-
* Stacks children on top of each other (z-axis)
|
|
5
|
-
*/
|
|
6
2
|
export declare class ZStack extends BaseStack {
|
|
7
3
|
protected baseClassName: string;
|
|
8
4
|
constructor(id: string, children: Record<string, any> | any[], options?: StackOptions);
|
|
9
|
-
/**
|
|
10
|
-
* ✅ Static create method with auto-render
|
|
11
|
-
* Allows: zstack.create({ children }, options).cascade(30).render()
|
|
12
|
-
*/
|
|
13
5
|
static create(children: Record<string, any> | any[], options?: StackOptions): ZStack;
|
|
14
6
|
}
|
|
15
7
|
export declare function zstack(id: string, children: Record<string, any> | any[], options?: StackOptions): ZStack;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZStack.d.ts","sourceRoot":"","sources":["ZStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD
|
|
1
|
+
{"version":3,"file":"ZStack.d.ts","sourceRoot":"","sources":["ZStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEzD,qBAAa,MAAO,SAAQ,SAAS;IACjC,SAAS,CAAC,aAAa,SAAgB;gBAE3B,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB;IAIzF,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM;CAY3F;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAE5G"}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { BaseStack } from './BaseStack.js';
|
|
2
|
-
/**
|
|
3
|
-
* ZStack - Layered/Overlapping Stack Component
|
|
4
|
-
* Stacks children on top of each other (z-axis)
|
|
5
|
-
*/
|
|
6
2
|
export class ZStack extends BaseStack {
|
|
7
3
|
constructor(id, children, options = {}) {
|
|
8
4
|
super(id, children, options);
|
|
9
5
|
this.baseClassName = 'jux-zstack';
|
|
10
6
|
}
|
|
11
|
-
/**
|
|
12
|
-
* ✅ Static create method with auto-render
|
|
13
|
-
* Allows: zstack.create({ children }, options).cascade(30).render()
|
|
14
|
-
*/
|
|
15
7
|
static create(children, options = {}) {
|
|
16
8
|
const id = `zstack-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
17
9
|
const instance = new ZStack(id, children, options);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { BaseStack, StackOptions } from './BaseStack.js';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* ZStack - Layered/Overlapping Stack Component
|
|
5
|
-
* Stacks children on top of each other (z-axis)
|
|
6
|
-
*/
|
|
7
3
|
export class ZStack extends BaseStack {
|
|
8
4
|
protected baseClassName = 'jux-zstack';
|
|
9
5
|
|
|
@@ -11,10 +7,6 @@ export class ZStack extends BaseStack {
|
|
|
11
7
|
super(id, children, options);
|
|
12
8
|
}
|
|
13
9
|
|
|
14
|
-
/**
|
|
15
|
-
* ✅ Static create method with auto-render
|
|
16
|
-
* Allows: zstack.create({ children }, options).cascade(30).render()
|
|
17
|
-
*/
|
|
18
10
|
static create(children: Record<string, any> | any[], options: StackOptions = {}): ZStack {
|
|
19
11
|
const id = `zstack-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
20
12
|
const instance = new ZStack(id, children, options);
|