juxscript 1.0.30 → 1.0.32

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/bin/cli.js CHANGED
@@ -233,7 +233,28 @@ async function buildProject(isServe = false) {
233
233
  // Create structure
234
234
  fs.mkdirSync(juxDir, { recursive: true });
235
235
 
236
- // Copy entire presets folder to jux/presets/
236
+ // Copy jux.jux as the starter index.jux (if it exists)
237
+ const juxJuxSrc = path.join(PATHS.packageRoot, 'presets', 'jux.jux');
238
+ const indexJuxDest = path.join(juxDir, 'index.jux');
239
+
240
+ if (fs.existsSync(juxJuxSrc)) {
241
+ fs.copyFileSync(juxJuxSrc, indexJuxDest);
242
+ console.log('+ Created jux/index.jux from jux.jux template');
243
+ } else {
244
+ // Fallback to hey.jux if jux.jux doesn't exist
245
+ const heyJuxSrc = path.join(PATHS.packageRoot, 'presets', 'hey.jux');
246
+ if (fs.existsSync(heyJuxSrc)) {
247
+ fs.copyFileSync(heyJuxSrc, indexJuxDest);
248
+ console.log('+ Created jux/index.jux from hey.jux template');
249
+ } else {
250
+ console.warn('⚠️ No template found, creating basic file');
251
+ const basicContent = `import { jux } from 'juxscript';\n\njux.heading('welcome').text('Welcome to JUX').render('#app');`;
252
+ fs.writeFileSync(indexJuxDest, basicContent);
253
+ console.log('+ Created jux/index.jux');
254
+ }
255
+ }
256
+
257
+ // Copy entire presets folder to jux/presets/ (excluding jux.jux)
237
258
  const presetsSrc = path.join(PATHS.packageRoot, 'presets');
238
259
  const presetsDest = path.join(juxDir, 'presets');
239
260
 
@@ -247,6 +268,11 @@ async function buildProject(isServe = false) {
247
268
  const srcPath = path.join(src, entry.name);
248
269
  const destPath = path.join(dest, entry.name);
249
270
 
271
+ // Skip jux.jux since we already copied it to index.jux
272
+ if (entry.isFile() && entry.name === 'jux.jux') {
273
+ continue;
274
+ }
275
+
250
276
  if (entry.isDirectory()) {
251
277
  fs.mkdirSync(destPath, { recursive: true });
252
278
  copyRecursive(srcPath, destPath);
@@ -5,38 +5,38 @@ const TRIGGER_EVENTS = [] as const;
5
5
  const CALLBACK_EVENTS = [] as const;
6
6
 
7
7
  export interface ContainerOptions {
8
- direction?: 'row' | 'column';
9
- gap?: number | string;
10
- wrap?: boolean;
11
- align?: 'start' | 'center' | 'end' | 'stretch';
12
- justify?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
13
- padding?: string;
14
- style?: string;
15
- class?: string;
8
+ direction?: 'row' | 'column'; // should deprecate.
9
+ gap?: number | string; // should deprecate.
10
+ wrap?: boolean; // should deprecate.
11
+ align?: 'start' | 'center' | 'end' | 'stretch'; // should deprecate.
12
+ justify?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly'; // should deprecate.
13
+ padding?: string; // should deprecate.
14
+ style?: string; // should deprecate. -> inherited from BaseComponent
15
+ class?: string; // should deprecate. -> inherited from BaseComponent
16
16
  }
17
17
 
18
18
  type ContainerState = {
19
- direction: string;
20
- gap: number | string;
21
- wrap: boolean;
22
- align: string;
23
- justify: string;
24
- padding: string;
25
- style: string;
26
- class: string;
19
+ direction: string; // should deprecate.
20
+ gap: number | string; // should deprecate.
21
+ wrap: boolean; // should deprecate.
22
+ align: string; // should deprecate.
23
+ justify: string; // should deprecate.
24
+ padding: string; // should deprecate.
25
+ style: string; // should deprecate. -> inherited from BaseComponent
26
+ class: string; // should deprecate. -> inherited from BaseComponent
27
27
  };
28
28
 
29
29
  export class Container extends BaseComponent<ContainerState> {
30
30
  constructor(id: string, options: ContainerOptions = {}) {
31
31
  super(id, {
32
- direction: options.direction ?? 'column',
33
- gap: options.gap ?? 0,
34
- wrap: options.wrap ?? false,
35
- align: options.align ?? 'stretch',
36
- justify: options.justify ?? 'start',
37
- padding: options.padding ?? '0',
38
- style: options.style ?? '',
39
- class: options.class ?? ''
32
+ direction: options.direction ?? 'column',// should deprecate.
33
+ gap: options.gap ?? 0, //should deprecate.
34
+ wrap: options.wrap ?? false, //should deprecate.
35
+ align: options.align ?? 'stretch', //should deprecate.
36
+ justify: options.justify ?? 'start', //should deprecate.
37
+ padding: options.padding ?? '0', //should deprecate.
38
+ style: options.style ?? '', //should deprecate. -> inherited from BaseComponent
39
+ class: options.class ?? '' //should deprecate. -> inherited from BaseComponent
40
40
  });
41
41
  }
42
42
 
@@ -104,21 +104,6 @@ export class Container extends BaseComponent<ContainerState> {
104
104
  wrapper.id = this._id;
105
105
  if (className) wrapper.className += ` ${className}`;
106
106
 
107
- // Build inline styles
108
- const gapValue = typeof gap === 'number' ? `${gap}px` : gap;
109
- const computedStyle = `
110
- display: flex;
111
- flex-direction: ${direction};
112
- gap: ${gapValue};
113
- flex-wrap: ${wrap ? 'wrap' : 'nowrap'};
114
- align-items: ${align};
115
- justify-content: ${justify};
116
- padding: ${padding};
117
- ${style}
118
- `.trim();
119
-
120
- wrapper.setAttribute('style', computedStyle);
121
-
122
107
  this._wireStandardEvents(wrapper);
123
108
 
124
109
  // Wire sync bindings
@@ -127,7 +112,7 @@ export class Container extends BaseComponent<ContainerState> {
127
112
 
128
113
  stateObj.subscribe((val: any) => {
129
114
  const transformed = transform(val);
130
-
115
+ /*
131
116
  if (property === 'direction') {
132
117
  this.state.direction = String(transformed);
133
118
  wrapper.style.flexDirection = this.state.direction;
@@ -148,7 +133,9 @@ export class Container extends BaseComponent<ContainerState> {
148
133
  this.state.padding = String(transformed);
149
134
  wrapper.style.padding = this.state.padding;
150
135
  }
136
+ */
151
137
  });
138
+
152
139
  });
153
140
 
154
141
  container.appendChild(wrapper);
@@ -662,9 +662,6 @@ export function generateIndexHtml(distDir, routes, mainJsFilename = 'main.js') {
662
662
  <title>Jux Application</title>
663
663
  </head>
664
664
  <body data-theme="">
665
- <nav style="padding: 20px; background: #f5f5f5; border-bottom: 2px solid #ddd;">
666
- ${navLinks}
667
- </nav>
668
665
  <!-- App container - router renders here -->
669
666
  <div id="app"></div>
670
667
  ${importMapScript}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "lib/jux.js",
@@ -1,21 +1,82 @@
1
+ /**
2
+ * Default Preset - Grid Layout System
3
+ * Minimal, clean layout with proper spacing
4
+ */
5
+
6
+ /* ============================================
7
+ CSS VARIABLES
8
+ ============================================ */
9
+ :root {
10
+ /* Typography */
11
+ --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
12
+ --font-family-mono: 'SF Mono', Monaco, Menlo, 'Courier New', monospace;
13
+
14
+ /* Spacing */
15
+ --space-xs: 0.25rem;
16
+ --space-sm: 0.5rem;
17
+ --space-md: 0.75rem;
18
+ --space-lg: 1rem;
19
+ --space-xl: 1.5rem;
20
+ --space-2xl: 2rem;
21
+ --space-3xl: 3rem;
22
+
23
+ /* Colors - Light Theme */
24
+ --color-text-primary: #111111;
25
+ --color-text-secondary: #65676b;
26
+ --color-text-tertiary: #8b8d94;
27
+
28
+ --color-background: #ffffff;
29
+ --color-surface-base: #f7f7f7;
30
+ --color-surface-elevated: #ffffff;
31
+ --color-surface-hover: #f1f1f1;
32
+
33
+ --color-border: #e8e8e8;
34
+ --color-border-hover: #d1d1d1;
35
+
36
+ /* Borders & Radius */
37
+ --border-width: 1px;
38
+ --radius-sm: 3px;
39
+ --radius-md: 6px;
40
+ --radius-lg: 8px;
41
+
42
+ /* Transitions */
43
+ --transition-base: 150ms ease;
44
+ }
45
+
46
+ /* ============================================
47
+ GLOBAL RESET
48
+ ============================================ */
49
+ * {
50
+ margin: 0;
51
+ padding: 0;
52
+ box-sizing: border-box;
53
+ }
54
+
55
+ body {
56
+ font-family: var(--font-family-base);
57
+ color: var(--color-text-primary);
58
+ background: var(--color-background);
59
+ -webkit-font-smoothing: antialiased;
60
+ }
61
+
1
62
  /* ============================================
2
- APP CONTAINER - Main Layout Grid
63
+ GRID LAYOUT
3
64
  ============================================ */
4
65
  #app {
5
66
  display: grid;
6
- grid-template-columns: auto 1fr auto;
67
+ grid-template-columns: auto 1fr;
7
68
  grid-template-rows: auto 1fr auto;
8
69
  grid-template-areas:
9
- "header header header"
10
- "sidebar main aside"
11
- "footer footer footer";
70
+ "header header"
71
+ "sidebar main"
72
+ "footer footer";
12
73
  width: 100vw;
13
74
  height: 100vh;
14
75
  overflow: hidden;
15
76
  }
16
77
 
17
78
  /* ============================================
18
- HEADER - Top Navigation Bar
79
+ HEADER
19
80
  ============================================ */
20
81
  #appheader {
21
82
  grid-area: header;
@@ -23,10 +84,9 @@
23
84
  border-bottom: var(--border-width) solid var(--color-border);
24
85
  display: flex;
25
86
  align-items: center;
26
- padding: 0 var(--space-lg);
87
+ padding: 0 var(--space-2xl);
27
88
  height: 48px;
28
89
  z-index: 100;
29
- transition: background-color var(--transition-base), border-color var(--transition-base);
30
90
  }
31
91
 
32
92
  #appheader-content {
@@ -41,17 +101,8 @@
41
101
  display: flex;
42
102
  align-items: center;
43
103
  gap: var(--space-md);
44
- font-size: var(--font-size-lg);
45
- font-weight: var(--font-weight-semibold);
46
- color: var(--color-text-primary);
47
- text-decoration: none;
48
- padding: var(--space-sm) var(--space-md);
49
- border-radius: var(--radius-md);
50
- transition: background-color var(--transition-fast);
51
- }
52
-
53
- #appheader-logo:hover {
54
- background: var(--color-surface-hover);
104
+ font-weight: 600;
105
+ cursor: pointer;
55
106
  }
56
107
 
57
108
  #appheader-nav {
@@ -64,66 +115,59 @@
64
115
  #appheader-actions {
65
116
  display: flex;
66
117
  align-items: center;
67
- gap: var(--space-md);
118
+ gap: var(--space-sm);
68
119
  }
69
120
 
70
121
  /* ============================================
71
- LEFT SIDEBAR - Navigation
122
+ SIDEBAR
72
123
  ============================================ */
73
- .jux-sidebar,
74
124
  #appaside {
75
125
  grid-area: sidebar;
76
- width: 260px;
126
+ width: 240px;
77
127
  background: var(--color-surface-base);
78
128
  border-right: var(--border-width) solid var(--color-border);
79
- display: flex;
80
- flex-direction: column;
81
- overflow: hidden;
82
- transition: width var(--transition-base);
83
- position: relative;
129
+ overflow-y: auto;
84
130
  }
85
131
 
86
132
  /* ============================================
87
- MAIN CONTENT - Center Area
133
+ MAIN CONTENT
88
134
  ============================================ */
89
135
  #appmain {
90
136
  grid-area: main;
91
137
  background: var(--color-background);
92
138
  overflow-y: auto;
93
139
  overflow-x: hidden;
94
- display: flex;
95
- flex-direction: column;
96
- position: relative;
97
140
  }
98
141
 
99
142
  #appmain-content {
100
- flex: 1;
101
- padding: var(--space-3xl) var(--space-2xl);
102
- max-width: 1600px;
103
- width: 100%;
143
+ max-width: 800px;
104
144
  margin: 0 auto;
145
+ padding: var(--space-3xl) var(--space-2xl);
105
146
  }
106
147
 
107
- /* Custom scrollbar for main content */
108
- #appmain::-webkit-scrollbar {
109
- width: 8px;
110
- }
111
-
112
- #appmain::-webkit-scrollbar-track {
113
- background: var(--color-surface-base);
114
- }
115
-
116
- #appmain::-webkit-scrollbar-thumb {
117
- background: var(--color-border);
118
- border-radius: var(--radius-full);
148
+ /* ============================================
149
+ FOOTER
150
+ ============================================ */
151
+ #appfooter {
152
+ grid-area: footer;
153
+ background: var(--color-surface-elevated);
154
+ border-top: var(--border-width) solid var(--color-border);
155
+ padding: var(--space-md) var(--space-2xl);
156
+ font-size: 0.875rem;
157
+ color: var(--color-text-tertiary);
158
+ min-height: 40px;
159
+ display: flex;
160
+ align-items: center;
119
161
  }
120
162
 
121
- #appmain::-webkit-scrollbar-thumb:hover {
122
- background: var(--color-border-hover);
163
+ #appfooter-content {
164
+ display: flex;
165
+ align-items: center;
166
+ gap: var(--space-lg);
123
167
  }
124
168
 
125
169
  /* ============================================
126
- RIGHT SIDEBAR - Optional Panel
170
+ RIGHT SIDEBAR (Optional)
127
171
  ============================================ */
128
172
  #appsidebar {
129
173
  grid-area: aside;
@@ -131,116 +175,64 @@
131
175
  background: var(--color-surface-base);
132
176
  border-left: var(--border-width) solid var(--color-border);
133
177
  display: none;
134
- flex-direction: column;
135
- overflow: hidden;
136
- transition: width var(--transition-base), background-color var(--transition-base);
137
178
  }
138
179
 
139
180
  #appsidebar.show {
140
- display: flex;
141
- }
142
-
143
- #appsidebar.collapsed {
144
- width: 0;
145
- border: none;
181
+ display: block;
146
182
  }
147
183
 
148
184
  #appsidebar-header {
149
185
  padding: var(--space-lg);
150
186
  border-bottom: var(--border-width) solid var(--color-border);
151
- font-weight: var(--font-weight-semibold);
152
- font-size: var(--font-size-sm);
153
- color: var(--color-text-secondary);
187
+ font-size: 0.75rem;
188
+ font-weight: 600;
189
+ color: var(--color-text-tertiary);
154
190
  text-transform: uppercase;
155
- letter-spacing: 0.05em;
156
191
  }
157
192
 
158
193
  #appsidebar-content {
159
- flex: 1;
194
+ padding: var(--space-lg);
160
195
  overflow-y: auto;
161
- overflow-x: hidden;
196
+ }
197
+
198
+ #appsidebar-footer {
162
199
  padding: var(--space-lg);
200
+ border-top: var(--border-width) solid var(--color-border);
201
+ font-size: 0.75rem;
202
+ color: var(--color-text-tertiary);
163
203
  }
164
204
 
205
+ /* ============================================
206
+ SCROLLBARS
207
+ ============================================ */
208
+ #appmain::-webkit-scrollbar,
209
+ #appaside::-webkit-scrollbar,
165
210
  #appsidebar-content::-webkit-scrollbar {
166
211
  width: 6px;
167
212
  }
168
213
 
214
+ #appmain::-webkit-scrollbar-track,
215
+ #appaside::-webkit-scrollbar-track,
169
216
  #appsidebar-content::-webkit-scrollbar-track {
170
217
  background: transparent;
171
218
  }
172
219
 
220
+ #appmain::-webkit-scrollbar-thumb,
221
+ #appaside::-webkit-scrollbar-thumb,
173
222
  #appsidebar-content::-webkit-scrollbar-thumb {
174
223
  background: var(--color-border);
175
- border-radius: var(--radius-full);
224
+ border-radius: 3px;
176
225
  }
177
226
 
227
+ #appmain::-webkit-scrollbar-thumb:hover,
228
+ #appaside::-webkit-scrollbar-thumb:hover,
178
229
  #appsidebar-content::-webkit-scrollbar-thumb:hover {
179
230
  background: var(--color-border-hover);
180
231
  }
181
232
 
182
- #appsidebar-footer {
183
- padding: var(--space-lg);
184
- border-top: var(--border-width) solid var(--color-border);
185
- font-size: var(--font-size-xs);
186
- color: var(--color-text-tertiary);
187
- }
188
-
189
233
  /* ============================================
190
- FOOTER - Bottom Bar
234
+ RESPONSIVE
191
235
  ============================================ */
192
- #appfooter {
193
- grid-area: footer;
194
- background: var(--color-surface-elevated);
195
- border-top: var(--border-width) solid var(--color-border);
196
- padding: var(--space-lg) var(--space-2xl);
197
- display: flex;
198
- align-items: center;
199
- justify-content: space-between;
200
- font-size: var(--font-size-sm);
201
- color: var(--color-text-tertiary);
202
- transition: background-color var(--transition-base), border-color var(--transition-base);
203
- }
204
-
205
- #appfooter-content {
206
- display: flex;
207
- align-items: center;
208
- gap: var(--space-xl);
209
- }
210
-
211
- #appfooter-legal {
212
- display: flex;
213
- align-items: center;
214
- gap: var(--space-lg);
215
- }
216
-
217
- #appfooter a {
218
- color: var(--color-text-secondary);
219
- text-decoration: none;
220
- transition: color var(--transition-fast);
221
- }
222
-
223
- #appfooter a:hover {
224
- color: var(--color-text-primary);
225
- }
226
-
227
- /* ============================================
228
- RESPONSIVE GRID LAYOUTS
229
- ============================================ */
230
- @media (max-width: 1024px) {
231
- #appsidebar {
232
- display: none;
233
- }
234
-
235
- #app {
236
- grid-template-columns: auto 1fr;
237
- grid-template-areas:
238
- "header header"
239
- "sidebar main"
240
- "footer footer";
241
- }
242
- }
243
-
244
236
  @media (max-width: 768px) {
245
237
  #app {
246
238
  grid-template-columns: 1fr;
@@ -250,31 +242,19 @@
250
242
  "footer";
251
243
  }
252
244
 
253
- .jux-sidebar,
254
245
  #appaside {
255
246
  display: none;
256
- position: fixed;
257
- left: 0;
258
- top: 0;
259
- bottom: 0;
260
- z-index: 1000;
261
- width: 260px;
262
- box-shadow: var(--shadow-xl);
263
- transform: translateX(-100%);
264
- transition: transform var(--transition-base);
265
247
  }
266
248
 
267
- .jux-sidebar.open,
268
- #appaside.open {
269
- display: flex;
270
- transform: translateX(0);
249
+ #appheader {
250
+ padding: 0 var(--space-lg);
271
251
  }
272
252
 
273
253
  #appmain-content {
274
254
  padding: var(--space-2xl) var(--space-lg);
275
255
  }
276
256
 
277
- #appheader {
278
- padding: 0 var(--space-md) 0 calc(var(--space-md) + 48px);
257
+ #appfooter {
258
+ padding: var(--space-md) var(--space-lg);
279
259
  }
280
260
  }
File without changes