juxscript 1.0.131 → 1.1.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.
Files changed (129) hide show
  1. package/README.md +1 -32
  2. package/bin/cli.js +4 -2
  3. package/index.d.ts +200 -0
  4. package/index.js +96 -22
  5. package/juxconfig.example.js +58 -63
  6. package/lib/components/alert.ts +200 -0
  7. package/lib/components/app.ts +247 -0
  8. package/lib/components/badge.ts +101 -0
  9. package/lib/components/base/BaseComponent.ts +421 -0
  10. package/lib/components/base/FormInput.ts +227 -0
  11. package/lib/components/button.ts +178 -0
  12. package/lib/components/card.ts +173 -0
  13. package/lib/components/chart.ts +231 -0
  14. package/lib/components/checkbox.ts +242 -0
  15. package/lib/components/code.ts +123 -0
  16. package/lib/components/container.ts +140 -0
  17. package/lib/components/data.ts +135 -0
  18. package/lib/components/datepicker.ts +234 -0
  19. package/lib/components/dialog.ts +172 -0
  20. package/lib/components/divider.ts +100 -0
  21. package/lib/components/dropdown.ts +186 -0
  22. package/lib/components/element.ts +267 -0
  23. package/lib/components/fileupload.ts +309 -0
  24. package/lib/components/grid.ts +291 -0
  25. package/lib/components/guard.ts +92 -0
  26. package/lib/components/heading.ts +96 -0
  27. package/lib/components/helpers.ts +41 -0
  28. package/lib/components/hero.ts +224 -0
  29. package/lib/components/icon.ts +178 -0
  30. package/lib/components/icons.ts +464 -0
  31. package/lib/components/include.ts +410 -0
  32. package/lib/components/input.ts +457 -0
  33. package/lib/components/list.ts +419 -0
  34. package/lib/components/loading.ts +100 -0
  35. package/lib/components/menu.ts +275 -0
  36. package/lib/components/modal.ts +284 -0
  37. package/lib/components/nav.ts +257 -0
  38. package/lib/components/paragraph.ts +97 -0
  39. package/lib/components/progress.ts +159 -0
  40. package/lib/components/radio.ts +278 -0
  41. package/lib/components/req.ts +303 -0
  42. package/lib/components/script.ts +41 -0
  43. package/lib/components/select.ts +252 -0
  44. package/lib/components/sidebar.ts +275 -0
  45. package/lib/components/style.ts +41 -0
  46. package/lib/components/switch.ts +246 -0
  47. package/lib/components/table.ts +1249 -0
  48. package/lib/components/tabs.ts +250 -0
  49. package/lib/components/theme-toggle.ts +293 -0
  50. package/lib/components/tooltip.ts +144 -0
  51. package/lib/components/view.ts +190 -0
  52. package/lib/components/write.ts +272 -0
  53. package/lib/globals.d.ts +19 -5
  54. package/lib/layouts/default.css +260 -0
  55. package/lib/layouts/figma.css +334 -0
  56. package/lib/reactivity/state.ts +78 -0
  57. package/lib/utils/{fetch.js → fetch.ts} +206 -81
  58. package/package.json +9 -31
  59. package/create/index.jux +0 -77
  60. package/create/layout.jux +0 -18
  61. package/create/style.css +0 -57
  62. package/create/themes/assets/jux.svg +0 -34
  63. package/create/themes/base.css +0 -197
  64. package/create/themes/base2.css +0 -54
  65. package/create/themes/layouts/base.jux +0 -16
  66. package/create/themes/layouts/base_blog.jux +0 -0
  67. package/create/themes/layouts/base_docs.jux +0 -0
  68. package/create/themes/layouts/base_login.jux +0 -0
  69. package/create/themes/layouts/base_marketing.jux +0 -0
  70. package/create/themes/layouts/base_saas.jux +0 -0
  71. package/lib/componentsv2/base/BaseEngine.d.ts +0 -112
  72. package/lib/componentsv2/base/BaseEngine.js +0 -279
  73. package/lib/componentsv2/base/BaseSkin.d.ts +0 -74
  74. package/lib/componentsv2/base/BaseSkin.js +0 -130
  75. package/lib/componentsv2/base/Neighborhood.d.ts +0 -22
  76. package/lib/componentsv2/base/Neighborhood.js +0 -56
  77. package/lib/componentsv2/base/OptionsContract.d.ts +0 -20
  78. package/lib/componentsv2/base/OptionsContract.js +0 -107
  79. package/lib/componentsv2/base/State.d.ts +0 -18
  80. package/lib/componentsv2/base/State.js +0 -68
  81. package/lib/componentsv2/element/Element.d.ts +0 -29
  82. package/lib/componentsv2/element/Element.js +0 -49
  83. package/lib/componentsv2/element/ElementEngine.d.ts +0 -58
  84. package/lib/componentsv2/element/ElementEngine.js +0 -112
  85. package/lib/componentsv2/element/ElementSkin.d.ts +0 -10
  86. package/lib/componentsv2/element/ElementSkin.js +0 -56
  87. package/lib/componentsv2/element/structure.css +0 -261
  88. package/lib/componentsv2/grid/Grid.d.ts +0 -13
  89. package/lib/componentsv2/grid/Grid.js +0 -27
  90. package/lib/componentsv2/grid/GridEngine.d.ts +0 -77
  91. package/lib/componentsv2/grid/GridEngine.js +0 -153
  92. package/lib/componentsv2/grid/GridSkin.d.ts +0 -11
  93. package/lib/componentsv2/grid/GridSkin.js +0 -84
  94. package/lib/componentsv2/grid/structure.css +0 -27
  95. package/lib/componentsv2/input/Input.d.ts +0 -6
  96. package/lib/componentsv2/input/Input.js +0 -21
  97. package/lib/componentsv2/input/InputEngine.d.ts +0 -70
  98. package/lib/componentsv2/input/InputEngine.js +0 -143
  99. package/lib/componentsv2/input/InputSkin.d.ts +0 -11
  100. package/lib/componentsv2/input/InputSkin.js +0 -89
  101. package/lib/componentsv2/input/structure.css +0 -47
  102. package/lib/componentsv2/list/List.d.ts +0 -49
  103. package/lib/componentsv2/list/List.js +0 -105
  104. package/lib/componentsv2/list/ListEngine.d.ts +0 -121
  105. package/lib/componentsv2/list/ListEngine.js +0 -322
  106. package/lib/componentsv2/list/ListSkin.d.ts +0 -20
  107. package/lib/componentsv2/list/ListSkin.js +0 -345
  108. package/lib/componentsv2/list/structure.css +0 -359
  109. package/lib/componentsv2/plugins/ClientSQLitePlugin.d.ts +0 -21
  110. package/lib/componentsv2/plugins/ClientSQLitePlugin.js +0 -130
  111. package/lib/componentsv2/plugins/IndexedDBPlugin.d.ts +0 -18
  112. package/lib/componentsv2/plugins/IndexedDBPlugin.js +0 -75
  113. package/lib/componentsv2/plugins/LocalStoragePlugin.d.ts +0 -20
  114. package/lib/componentsv2/plugins/LocalStoragePlugin.js +0 -65
  115. package/lib/componentsv2/plugins/ServerSQLitePlugin.d.ts +0 -25
  116. package/lib/componentsv2/plugins/ServerSQLitePlugin.js +0 -70
  117. package/lib/componentsv2/stubs/ComponentComposition.ts.stub +0 -32
  118. package/lib/componentsv2/stubs/ComponentEngine.ts.stub +0 -36
  119. package/lib/componentsv2/stubs/ComponentSkin.ts.stub +0 -35
  120. package/lib/componentsv2/stubs/ComponentStructure.css.d.ts.stub +0 -2
  121. package/lib/componentsv2/stubs/ComponentStructure.css.stub +0 -13
  122. package/lib/utils/fetch.d.ts +0 -176
  123. package/machinery/build3.js +0 -159
  124. package/machinery/compiler3.js +0 -688
  125. package/machinery/config.js +0 -155
  126. package/machinery/serve.js +0 -255
  127. package/machinery/validators/file-validator.js +0 -123
  128. package/machinery/watcher.js +0 -59
  129. package/types/css.d.ts +0 -10
@@ -1,261 +0,0 @@
1
- /**
2
- * Base
3
- */
4
-
5
- :root {
6
- /* Typography */
7
- --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
8
- --font-size-sm: 0.875rem;
9
- --font-size-base: 1rem;
10
- --font-size-lg: 1.125rem;
11
- --font-size-xl: 1.5rem;
12
- --font-size-2xl: 2rem;
13
- --font-size-3xl: 2.25rem; /* Added for H1 default */
14
- --font-size-4xl: 4rem;
15
- --line-height-normal: 1.6;
16
- --line-height-tight: 1.2;
17
-
18
- /* Spacing Scale */
19
- --space-xs: 0.25rem;
20
- --space-sm: 0.5rem;
21
- --space-md: 1rem;
22
- --space-lg: 1.5rem;
23
- --space-xl: 2rem;
24
- --space-2xl: 3rem;
25
-
26
- /* Layout */
27
- --radius-sm: 6px;
28
- --radius-md: 10px;
29
- --radius-lg: 12px;
30
- --radius-round: 50px;
31
- --border-width: 1px;
32
- --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.05);
33
-
34
- /* Animation */
35
- --transition-fast: 150ms ease;
36
- --transition-normal: 300ms ease;
37
-
38
- /* Color Palette - RxTrail Brand Colors */
39
- --color-brand: #e57373;
40
- --color-brand-contrast: #000000;
41
- --color-brand-hover: #ef5350;
42
- --color-brand-subtle: rgba(229, 115, 115, 0.08);
43
-
44
- --color-text-primary: #2c2f3e;
45
- --color-text-secondary: #666666;
46
- --color-text-inverse: #ffffff;
47
-
48
- --color-background: #fafbfc;
49
- --color-background-alt: #f8f9fa;
50
- --color-background-inverse: #111111;
51
-
52
- --color-surface-base: #ffffff;
53
- --color-surface-hover: #fef5f5;
54
- --color-surface-active: #fce8e8;
55
-
56
- --color-border: #e5e7eb;
57
- --color-border-hover: #d1d5db;
58
-
59
- /* Accent colors for clinical data */
60
- --color-success: #00a878;
61
- --color-warning: #f39c12;
62
- --color-danger: #e74c3c;
63
- }
64
-
65
- /* Dark Mode Overrides */
66
- [data-theme="dark"] {
67
- --color-text-primary: #e8edf3;
68
- --color-text-secondary: #9aa6b5;
69
- --color-background: #0f1419;
70
- --color-surface-base: #1a2332;
71
- --color-surface-hover: #243447;
72
- --color-border: #384456;
73
- }
74
-
75
- /* --- Primitives & Reset --- */
76
-
77
- *, *::before, *::after {
78
- box-sizing: border-box;
79
- }
80
-
81
- html, body {
82
- height: 100%;
83
- margin: 0;
84
- padding: 0;
85
- }
86
-
87
- body {
88
- font-family: var(--font-family-base);
89
- font-size: var(--font-size-base);
90
- line-height: var(--line-height-normal);
91
- color: var(--color-text-primary);
92
- background-color: var(--color-background);
93
- -webkit-font-smoothing: antialiased;
94
- -moz-osx-font-smoothing: grayscale;
95
- }
96
-
97
- h1, h2, h3, h4, h5, h6 {
98
- margin-top: 0;
99
- margin-bottom: var(--space-md);
100
- font-weight: 700;
101
- line-height: var(--line-height-tight);
102
- color: var(--color-text-primary);
103
- }
104
-
105
- h1 { font-size: var(--font-size-3xl); letter-spacing: -0.02em; }
106
- h2 { font-size: var(--font-size-2xl); letter-spacing: -0.01em; }
107
- h3 { font-size: var(--font-size-xl); }
108
- h4 { font-size: var(--font-size-lg); }
109
- h5 { font-size: var(--font-size-base); }
110
- h6 { font-size: var(--font-size-sm); text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-secondary); }
111
-
112
- p {
113
- margin-top: 0;
114
- margin-bottom: var(--space-md);
115
- max-width: 70ch; /* Optimal reading width */
116
- }
117
-
118
- a {
119
- color: var(--color-brand);
120
- text-decoration: none;
121
- font-weight: 500;
122
- transition: color var(--transition-fast);
123
- }
124
-
125
- a:hover {
126
- color: var(--color-brand-hover);
127
- text-decoration: underline;
128
- }
129
-
130
- strong, b {
131
- font-weight: 700;
132
- }
133
-
134
- em, i {
135
- font-style: italic;
136
- }
137
-
138
- ul, ol {
139
- margin-top: 0;
140
- margin-bottom: var(--space-md);
141
- padding-left: var(--space-xl);
142
- }
143
-
144
- li {
145
- margin-bottom: var(--space-xs);
146
- }
147
-
148
- code, kbd, samp {
149
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
150
- font-size: 0.9em;
151
- padding: 0.2em 0.4em;
152
- border-radius: var(--radius-sm);
153
- background-color: var(--color-surface-hover);
154
- color: var(--color-text-primary);
155
- }
156
-
157
- pre {
158
- display: block;
159
- overflow-x: auto;
160
- padding: var(--space-md);
161
- background-color: var(--color-surface-hover);
162
- border: 1px solid var(--color-border);
163
- border-radius: var(--radius-md);
164
- margin-bottom: var(--space-lg);
165
- }
166
-
167
- pre code {
168
- background-color: transparent;
169
- padding: 0;
170
- color: inherit;
171
- font-size: var(--font-size-sm);
172
- }
173
-
174
- blockquote {
175
- margin: var(--space-lg) 0;
176
- padding-left: var(--space-lg);
177
- border-left: 4px solid var(--color-brand-subtle);
178
- color: var(--color-text-secondary);
179
- font-style: italic;
180
- }
181
-
182
- img, video {
183
- max-width: 100%;
184
- height: auto;
185
- display: block;
186
- }
187
-
188
- hr {
189
- border: 0;
190
- border-top: var(--border-width) solid var(--color-border);
191
- margin: var(--space-xl) 0;
192
- }
193
-
194
- button, input, select, textarea {
195
- font-family: inherit;
196
- font-size: inherit;
197
- }
198
-
199
- .jux-btn-primary:hover {
200
- transform: translateY(-2px);
201
- background-color: var(--color-brand-contrast);
202
- }
203
-
204
- /* --- Global Layout Container --- */
205
-
206
- #jux-layout {
207
- position: fixed;
208
- inset: 0;
209
- width: 100vw;
210
- height: 100vh;
211
- margin: 0;
212
- padding: 0;
213
- overflow: hidden;
214
- display: flex;
215
- flex-direction: column;
216
- background-color: var(--color-background);
217
- }
218
-
219
- #jux-layout > #app {
220
- flex: 1;
221
- width: 100%;
222
- height: 100%;
223
- overflow-y: auto;
224
- overflow-x: hidden;
225
- position: relative;
226
- /* Ensure child layouts can take full height */
227
- display: flex;
228
- flex-direction: column;
229
- }
230
-
231
- /* --- Layout Regions --- */
232
-
233
- .layout-header {
234
- background-color: var(--color-surface-base);
235
- border-bottom: 1px solid var(--color-border);
236
- /* Horizontal alignment usually handled by inner grid/flex, vertical centering is safe default here */
237
- justify-content: center;
238
- z-index: 50;
239
- }
240
-
241
- .layout-hero {
242
- background-color: var(--color-background-alt);
243
- position: relative;
244
- /* Often the hero cell itself centers its children */
245
- align-items: center;
246
- justify-content: center;
247
- }
248
-
249
- .layout-features {
250
- background-color: var(--color-background);
251
- /* Ensure content doesn't just jam against edges if inner wrapper misses padding */
252
- position: relative;
253
- }
254
-
255
- .layout-footer {
256
- background-color: var(--color-background-inverse);
257
- color: var(--color-text-secondary);
258
- border-top: 1px solid var(--color-border);
259
- align-items: center;
260
- justify-content: center;
261
- }
@@ -1,13 +0,0 @@
1
- import { GridEngine, GridOptions, GridInput } from './GridEngine.js';
2
- export type GridComponent = GridEngine & {
3
- render: (targetId: string | HTMLElement) => GridComponent;
4
- injectCSS: (id: string, cssContent: string) => void;
5
- rows: (config: GridInput) => GridComponent;
6
- columns: (config: GridInput) => GridComponent;
7
- gap: (gap: string) => GridComponent;
8
- width: (width: string) => GridComponent;
9
- height: (height: string) => GridComponent;
10
- getCellId: (row: number, col: number) => string;
11
- };
12
- export declare function Grid(id: string, options?: GridOptions): GridComponent;
13
- //# sourceMappingURL=Grid.d.ts.map
@@ -1,27 +0,0 @@
1
- import { GridEngine } from './GridEngine.js';
2
- import { GridSkin } from './GridSkin.js';
3
- export function Grid(id, options = {}) {
4
- const engine = new GridEngine(id, options);
5
- if (typeof window !== 'undefined') {
6
- // @ts-ignore
7
- window.juxEngines = window.juxEngines || {};
8
- // @ts-ignore
9
- window.juxEngines[id] = engine;
10
- }
11
- const skin = new GridSkin(engine);
12
- // Dynamic Augmentation
13
- // @ts-ignore
14
- engine.render = (targetId) => {
15
- const target = typeof targetId === 'string' ? document.getElementById(targetId) : targetId;
16
- if (target)
17
- skin.renderSkin(target);
18
- return engine;
19
- };
20
- // @ts-ignore
21
- engine.injectCSS = (id, css) => skin.injectCSS(id, css);
22
- // --- Helpers ---
23
- // @ts-ignore
24
- engine.getCellId = (row, col) => `${id}-${row}-${col}`;
25
- return engine;
26
- }
27
- //# sourceMappingURL=Grid.js.map
@@ -1,77 +0,0 @@
1
- import { BaseEngine, BaseState } from '../base/BaseEngine.js';
2
- import { OptionsContractSchema } from '../base/OptionsContract.js';
3
- export interface GridTrackConfig {
4
- size?: string;
5
- style?: string;
6
- class?: string;
7
- width?: string;
8
- height?: string;
9
- }
10
- export type GridInput = number | GridTrackConfig[];
11
- export interface GridState extends BaseState {
12
- rows: GridTrackConfig[];
13
- columns: GridTrackConfig[];
14
- gap: string;
15
- width: string;
16
- height: string;
17
- gridder: boolean;
18
- }
19
- export interface GridOptions {
20
- rows?: GridInput;
21
- columns?: GridInput;
22
- gap?: string;
23
- width?: string;
24
- height?: string;
25
- gridder?: boolean;
26
- }
27
- export declare class GridEngine extends BaseEngine<GridState, GridOptions> {
28
- constructor(id: string, options?: GridOptions);
29
- /**
30
- * OPTIONS CONTRACT
31
- * Defines valid options with types, defaults, and aliases for common mistakes.
32
- */
33
- protected get optionsSchema(): OptionsContractSchema;
34
- protected prepareState(id: string, options: GridOptions): GridState;
35
- /**
36
- * helper: Normalizes simple numbers into full config arrays.
37
- * Changed from #normalizeTracks to private normalizeTracks to avoid initialization errors
38
- * when called via BaseEngine constructor -> prepareState.
39
- */
40
- private normalizeTracks;
41
- /**
42
- * Set rows configuration
43
- * Method name matches state property: rows
44
- */
45
- rows(input: GridInput): this;
46
- /**
47
- * Set columns configuration
48
- * Method name matches state property: columns
49
- */
50
- columns(input: GridInput): this;
51
- /**
52
- * Set gap between cells
53
- * Method name matches state property: gap
54
- */
55
- gap(value: string): this;
56
- /**
57
- * Set container width
58
- * Method name matches state property: width
59
- */
60
- width(width: string): this;
61
- /**
62
- * Set container height
63
- * Method name matches state property: height
64
- */
65
- height(height: string): this;
66
- /**
67
- * Set gridder (debug) mode
68
- * Method name matches state property: gridder
69
- */
70
- gridder(active: boolean): this;
71
- /**
72
- * Toggle gridder mode
73
- * @alias Convenience method that toggles gridder state
74
- */
75
- toggleGridder(active?: boolean): this;
76
- }
77
- //# sourceMappingURL=GridEngine.d.ts.map
@@ -1,153 +0,0 @@
1
- import { BaseEngine } from '../base/BaseEngine.js';
2
- export class GridEngine extends BaseEngine {
3
- constructor(id, options = {}) {
4
- super(id, options);
5
- }
6
- /**
7
- * OPTIONS CONTRACT
8
- * Defines valid options with types, defaults, and aliases for common mistakes.
9
- */
10
- get optionsSchema() {
11
- return {
12
- rows: {
13
- type: 'array',
14
- default: [{ size: '1fr' }],
15
- description: 'Row definitions (number or array of GridTrackConfig)',
16
- aliases: ['row', 'rowCount', 'numRows']
17
- },
18
- columns: {
19
- type: 'array',
20
- default: [{ size: '1fr' }],
21
- description: 'Column definitions (number or array of GridTrackConfig)',
22
- aliases: ['cols', 'column', 'colCount', 'numCols', 'numColumns']
23
- },
24
- gap: {
25
- type: 'string',
26
- default: '0',
27
- description: 'Gap between grid cells (CSS value)',
28
- aliases: ['gridGap', 'spacing', 'gutter']
29
- },
30
- width: {
31
- type: 'string',
32
- default: '100%',
33
- description: 'Grid container width (CSS value)',
34
- aliases: ['width', 'w']
35
- },
36
- height: {
37
- type: 'string',
38
- default: '100%',
39
- description: 'Grid container height (CSS value)',
40
- aliases: ['height', 'h']
41
- },
42
- gridder: {
43
- type: 'boolean',
44
- default: false,
45
- description: 'Enable debug/blueprint mode',
46
- aliases: ['debug', 'blueprint', 'showGrid']
47
- }
48
- };
49
- }
50
- prepareState(id, options) {
51
- return {
52
- id,
53
- classes: ['jux-grid'],
54
- visible: true,
55
- disabled: false,
56
- loading: false,
57
- attributes: {},
58
- rows: this.normalizeTracks(options.rows || 1),
59
- columns: this.normalizeTracks(options.columns || 1),
60
- gap: options.gap || '0',
61
- width: options.width || '100%',
62
- height: options.height || '100%',
63
- gridder: options.gridder || false
64
- };
65
- }
66
- // --- Helpers ---
67
- /**
68
- * helper: Normalizes simple numbers into full config arrays.
69
- * Changed from #normalizeTracks to private normalizeTracks to avoid initialization errors
70
- * when called via BaseEngine constructor -> prepareState.
71
- */
72
- normalizeTracks(input) {
73
- if (typeof input === 'number') {
74
- // Default to '1fr' for equal distribution
75
- return Array(input).fill({ size: '1fr' });
76
- }
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
- });
88
- }
89
- // --- State-Aligned Methods ---
90
- /**
91
- * Set rows configuration
92
- * Method name matches state property: rows
93
- */
94
- rows(input) {
95
- this.updateState({ rows: this.normalizeTracks(input) });
96
- this.emit('layout:rows', { rows: this.state.rows });
97
- return this;
98
- }
99
- /**
100
- * Set columns configuration
101
- * Method name matches state property: columns
102
- */
103
- columns(input) {
104
- this.updateState({ columns: this.normalizeTracks(input) });
105
- this.emit('layout:columns', { columns: this.state.columns });
106
- return this;
107
- }
108
- /**
109
- * Set gap between cells
110
- * Method name matches state property: gap
111
- */
112
- gap(value) {
113
- this.updateState({ gap: value });
114
- this.emit('layout:gap', { gap: value });
115
- return this;
116
- }
117
- /**
118
- * Set container width
119
- * Method name matches state property: width
120
- */
121
- width(width) {
122
- this.updateState({ width: width });
123
- this.emit('layout:resize', { width });
124
- return this;
125
- }
126
- /**
127
- * Set container height
128
- * Method name matches state property: height
129
- */
130
- height(height) {
131
- this.updateState({ height: height });
132
- this.emit('layout:resize', { height });
133
- return this;
134
- }
135
- /**
136
- * Set gridder (debug) mode
137
- * Method name matches state property: gridder
138
- */
139
- gridder(active) {
140
- this.updateState({ gridder: active });
141
- this.emit('debug:gridder', { active });
142
- return this;
143
- }
144
- /**
145
- * Toggle gridder mode
146
- * @alias Convenience method that toggles gridder state
147
- */
148
- toggleGridder(active) {
149
- const next = active !== undefined ? active : !this.state.gridder;
150
- return this.gridder(next);
151
- }
152
- }
153
- //# sourceMappingURL=GridEngine.js.map
@@ -1,11 +0,0 @@
1
- import { BaseSkin } from '../base/BaseSkin.js';
2
- import { GridEngine, GridState } from './GridEngine.js';
3
- export declare class GridSkin extends BaseSkin<GridState, GridEngine> {
4
- #private;
5
- constructor(engine: GridEngine);
6
- protected get structureCss(): string;
7
- protected bindEvents(root: HTMLElement): void;
8
- protected updateSkin(state: GridState): void;
9
- protected createRoot(): HTMLElement;
10
- }
11
- //# sourceMappingURL=GridSkin.d.ts.map
@@ -1,84 +0,0 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _GridSkin_cells;
7
- import { BaseSkin } from '../base/BaseSkin.js';
8
- import structureCss from './structure.css';
9
- export class GridSkin extends BaseSkin {
10
- constructor(engine) {
11
- super(engine);
12
- _GridSkin_cells.set(this, new Map());
13
- }
14
- get structureCss() {
15
- return structureCss;
16
- }
17
- bindEvents(root) {
18
- }
19
- updateSkin(state) {
20
- if (!this.root)
21
- return;
22
- this.applySkinAttributes(this.root, state);
23
- // 0. Ensure standard ID is set
24
- this.root.id = state.id;
25
- this.root.className = state.classes.join(' ');
26
- // 1. Container Styles
27
- this.root.style.width = state.width;
28
- this.root.style.height = state.height;
29
- this.root.style.gap = state.gap;
30
- // CSS Grid Definitions
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(' ');
34
- this.root.style.gridTemplateRows = rowSizes;
35
- this.root.style.gridTemplateColumns = colSizes;
36
- // 2. Structural Reconciliation
37
- const validIds = new Set();
38
- // create cells
39
- state.rows.forEach((rowConfig, rIndex) => {
40
- state.columns.forEach((colConfig, cIndex) => {
41
- const cellId = `${state.id}-${rIndex}-${cIndex}`;
42
- validIds.add(cellId);
43
- let cell = __classPrivateFieldGet(this, _GridSkin_cells, "f").get(cellId);
44
- if (!cell) {
45
- cell = document.createElement('div');
46
- cell.id = cellId;
47
- cell.className = 'jux-grid-cell';
48
- cell.dataset.row = String(rIndex);
49
- cell.dataset.col = String(cIndex);
50
- const label = document.createElement('span');
51
- label.className = 'jux-grid-ordinal-label';
52
- label.textContent = `#${rIndex}-${cIndex}`;
53
- cell.appendChild(label);
54
- __classPrivateFieldGet(this, _GridSkin_cells, "f").set(cellId, cell);
55
- if (!this.root.contains(cell)) {
56
- this.root.appendChild(cell);
57
- }
58
- }
59
- cell.style.cssText = '';
60
- cell.className = 'jux-grid-cell';
61
- if (rowConfig.style)
62
- cell.style.cssText += rowConfig.style;
63
- if (colConfig.style)
64
- cell.style.cssText += colConfig.style;
65
- if (rowConfig.class)
66
- cell.classList.add(rowConfig.class);
67
- if (colConfig.class)
68
- cell.classList.add(colConfig.class);
69
- });
70
- });
71
- // 3. Cleanup Orphans
72
- __classPrivateFieldGet(this, _GridSkin_cells, "f").forEach((cell, id) => {
73
- if (!validIds.has(id)) {
74
- cell.remove();
75
- __classPrivateFieldGet(this, _GridSkin_cells, "f").delete(id);
76
- }
77
- });
78
- }
79
- createRoot() {
80
- return document.createElement('div');
81
- }
82
- }
83
- _GridSkin_cells = new WeakMap();
84
- //# sourceMappingURL=GridSkin.js.map
@@ -1,27 +0,0 @@
1
- .jux-grid {
2
- display: grid;
3
- /* Default containment */
4
- box-sizing: border-box;
5
- position: relative;
6
- transition: gap var(--transition-fast), width var(--transition-fast), height var(--transition-fast);
7
- }
8
-
9
- .jux-grid-cell {
10
- /* Cells are containers for content */
11
- position: relative;
12
- min-width: 0; /* Prevent flex/grid blowouts */
13
- min-height: 0;
14
-
15
- /* Layout flexibility for inner content */
16
- display: flex;
17
- flex-direction: column;
18
- }
19
-
20
- .jux-grid-ordinal-label {
21
- display: none; /* Hidden by default */
22
- }
23
-
24
-
25
- .jux-grid:hover {
26
- background-color: var(--color-surface-hover);
27
- }
@@ -1,6 +0,0 @@
1
- import { InputEngine, InputOptions } from './InputEngine.js';
2
- export type InputComponent = InputEngine & {
3
- render: (targetId: string | HTMLElement) => InputComponent;
4
- };
5
- export declare function Input(id: string, options?: InputOptions): InputComponent;
6
- //# sourceMappingURL=Input.d.ts.map
@@ -1,21 +0,0 @@
1
- import { InputEngine } from './InputEngine.js';
2
- import { InputSkin } from './InputSkin.js';
3
- export function Input(id, options = {}) {
4
- const engine = new InputEngine(id, options);
5
- if (typeof window !== 'undefined') {
6
- // @ts-ignore
7
- window.juxEngines = window.juxEngines || {};
8
- // @ts-ignore
9
- window.juxEngines[id] = engine;
10
- }
11
- const skin = new InputSkin(engine);
12
- // @ts-ignore
13
- engine.render = (targetId) => {
14
- const target = typeof targetId === 'string' ? document.getElementById(targetId) : targetId;
15
- if (target)
16
- skin.renderSkin(target);
17
- return engine;
18
- };
19
- return engine;
20
- }
21
- //# sourceMappingURL=Input.js.map