juxscript 1.0.132 → 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 -30
  82. package/lib/componentsv2/element/Element.js +0 -50
  83. package/lib/componentsv2/element/ElementEngine.d.ts +0 -59
  84. package/lib/componentsv2/element/ElementEngine.js +0 -118
  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
package/create/index.jux DELETED
@@ -1,77 +0,0 @@
1
- import { Element, List } from 'juxscript';
2
- import { LandingLayout } from './layout.jux';
3
-
4
- // 1. Initialize Layout
5
- LandingLayout();
6
-
7
- // 2. Header: Logo & Nav
8
- Element('logo', { tag: 'h2' })
9
- .text('JUX STUDIO')
10
- .className('jux-typo-brand')
11
- .render('landing-layout-0-0');
12
-
13
- // 3. Hero Section
14
- const hero = Element('hero-content', { tag: 'div' })
15
- .className('jux-section-center')
16
- .render('landing-layout-1-0');
17
-
18
- Element('hero-h1', { tag: 'h1' })
19
- .text('Build Web Apps. Simply.')
20
- .className('jux-typo-display')
21
- .render('hero-content');
22
-
23
- Element('hero-p', { tag: 'p' })
24
- .text('No complex build steps. No magic. Just standard JavaScript components.')
25
- .className('jux-typo-lead')
26
- .render('hero-content');
27
-
28
- Element('cta-btn', { tag: 'button' })
29
- .text('Get Started')
30
- .className('jux-btn-primary')
31
- .render('hero-content');
32
-
33
- // 4. Features Section (Nested Content)
34
- const featuresWrapper = Element('features-wrapper', { tag: 'div' })
35
- .className('jux-grid-responsive')
36
- .render('landing-layout-2-0');
37
-
38
- // Component Showcase within Landing Page
39
- const listDemo = Element('list-demo-card', { tag: 'div' })
40
- .className('jux-card')
41
- .render('features-wrapper');
42
-
43
- Element('list-label', { tag: 'h3' }).text('Interactive Components').render('list-demo-card');
44
- Element('list-desc', { tag: 'p' })
45
- .text('Try dragging or sorting this list:')
46
- .style('color: var(--color-text-secondary); margin-bottom: 20px;')
47
- .render('list-demo-card');
48
-
49
- List('feature-list', { items: ['Zero Config', 'Standard Web APIs', 'Hot Reloading', 'TypeScript Ready'] })
50
- .listType('unordered')
51
- .enableSort()
52
- .enableMove()
53
- .render('list-demo-card');
54
-
55
- // Feature Cards
56
- const cardData = [
57
- { title: 'Reactive State', desc: 'Granular binding means high performance without a virtual DOM.' },
58
- { title: 'Time Travel', desc: 'Built-in undo/redo capabilities for complex application state.' }
59
- ];
60
-
61
- cardData.forEach((f, i) => {
62
- const card = Element(`card-${i}`, { tag: 'div' })
63
- .className('jux-card')
64
- .render('features-wrapper');
65
-
66
- Element(`ct-${i}`, { tag: 'h3' }).text(f.title).render(`card-${i}`);
67
- Element(`cd-${i}`, { tag: 'p' })
68
- .text(f.desc)
69
- .style('color: var(--color-text-secondary); line-height: var(--line-height-normal);')
70
- .render(`card-${i}`);
71
- });
72
-
73
- // 5. Footer
74
- const footer = Element('footer-content', { tag: 'div' })
75
- .html('© 2025 Jux Project. Open Source.')
76
- .className('jux-layout-footer')
77
- .render('landing-layout-3-0');
package/create/layout.jux DELETED
@@ -1,18 +0,0 @@
1
- import { Grid } from 'juxscript';
2
-
3
- export function LandingLayout() {
4
- // Defines a classic landing page structure using JUX Grid
5
- return Grid('landing-layout')
6
- .rows([
7
- { size: '80px', class: 'layout-header' }, // 0: Navbar
8
- { size: '500px', class: 'layout-hero' }, // 1: Hero Banner
9
- { size: 'auto', class: 'layout-features' }, // 2: Main Content
10
- { size: '120px', class: 'layout-footer' } // 3: Footer
11
- ])
12
- .columns([
13
- { size: '1fr', class: 'col-main' } // Single column flow
14
- ])
15
- .gap('0px')
16
- .width('100%')
17
- .render('app');
18
- }
package/create/style.css DELETED
@@ -1,57 +0,0 @@
1
- /** Base */
2
- :root {
3
- /* Typography */
4
- --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
5
- --font-size-sm: 0.875rem;
6
- --font-size-base: 1rem;
7
- --font-size-lg: 1.125rem;
8
- --line-height-normal: 1.6;
9
-
10
- /* Spacing Scale */
11
- --space-xs: 0.25rem;
12
- --space-sm: 0.5rem;
13
- --space-md: 1rem;
14
- --space-lg: 1.5rem;
15
- --space-xl: 2rem;
16
-
17
- /* Layout */
18
- --radius-sm: 6px;
19
- --radius-md: 10px;
20
- --border-width: 1px;
21
-
22
- /* Animation */
23
- --transition-fast: 150ms ease;
24
- --transition-normal: 300ms ease;
25
-
26
- /* Color Palette - RxTrail Brand Colors */
27
- --color-brand: #e57373;
28
- --color-brand-hover: #ef5350;
29
- --color-brand-subtle: rgba(229, 115, 115, 0.08);
30
-
31
- --color-text-primary: #2c2f3e;
32
- --color-text-secondary: #6b7280;
33
- --color-text-inverse: #ffffff;
34
-
35
- --color-background: #fafbfc;
36
- --color-surface-base: #ffffff;
37
- --color-surface-hover: #fef5f5;
38
- --color-surface-active: #fce8e8;
39
-
40
- --color-border: #e5e7eb;
41
- --color-border-hover: #d1d5db;
42
-
43
- /* Accent colors for clinical data */
44
- --color-success: #00a878;
45
- --color-warning: #f39c12;
46
- --color-danger: #e74c3c;
47
- }
48
-
49
- /* Dark Mode Overrides */
50
- [data-theme="dark"] {
51
- --color-text-primary: #e8edf3;
52
- --color-text-secondary: #9aa6b5;
53
- --color-background: #0f1419;
54
- --color-surface-base: #1a2332;
55
- --color-surface-hover: #243447;
56
- --color-border: #384456;
57
- }
@@ -1,34 +0,0 @@
1
- <svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <defs>
3
- <linearGradient id="textGrad" x1="100" y1="0" x2="412" y2="0" gradientUnits="userSpaceOnUse">
4
- <stop offset="0%" stop-color="#22D3EE"/>
5
- <stop offset="50%" stop-color="#A855F7"/>
6
- <stop offset="100%" stop-color="#F472B6"/>
7
- </linearGradient>
8
- </defs>
9
-
10
- <!-- Background -->
11
- <rect width="512" height="512" rx="64" fill="#0F172A"/>
12
-
13
- <!-- Left Curly Brace { -->
14
- <path d="M80 130
15
- Q80 200, 55 230
16
- Q30 256, 55 282
17
- Q80 312, 80 382"
18
- stroke="#94A3B8" stroke-width="14" stroke-linecap="round" fill="none"/>
19
-
20
- <!-- Right Curly Brace } -->
21
- <path d="M432 130
22
- Q432 200, 457 230
23
- Q482 256, 457 282
24
- Q432 312, 432 382"
25
- stroke="#94A3B8" stroke-width="14" stroke-linecap="round" fill="none"/>
26
-
27
- <!-- JUX Text -->
28
- <text x="256" y="285"
29
- font-family="system-ui, -apple-system, sans-serif"
30
- font-size="130"
31
- font-weight="900"
32
- text-anchor="middle"
33
- fill="url(#textGrad)">JUX</text>
34
- </svg>
@@ -1,197 +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
- }
@@ -1,54 +0,0 @@
1
-
2
- /*gemini*/
3
- :root {
4
- /* Typography - Larger, more comfortable */
5
- --font-family-base: 'Google Sans', system-ui, -apple-system, sans-serif;
6
- --font-size-sm: 0.9375rem; /* 15px */
7
- --font-size-base: 1.0625rem; /* 17px */
8
- --font-size-lg: 1.25rem; /* 20px */
9
- --line-height-normal: 1.6;
10
-
11
- /* Spacing Scale - More generous */
12
- --space-xs: 0.5rem; /* 8px */
13
- --space-sm: 0.75rem; /* 12px */
14
- --space-md: 1.25rem; /* 20px */
15
- --space-lg: 2rem; /* 32px */
16
- --space-xl: 3rem; /* 48px */
17
-
18
- /* Layout - Softer, rounder */
19
- --radius-sm: 8px;
20
- --radius-md: 16px;
21
- --radius-lg: 24px;
22
- --border-width: 1px;
23
-
24
- /* Animation - Smoother */
25
- --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
26
- --transition-normal: 350ms cubic-bezier(0.4, 0, 0.2, 1);
27
-
28
- /* Color Palette (Semantic) - Gemini-inspired */
29
- --color-brand: #1a73e8;
30
- --color-brand-hover: #1557b0;
31
- --color-brand-subtle: rgba(26, 115, 232, 0.08);
32
-
33
- --color-text-primary: #202124;
34
- --color-text-secondary: #5f6368;
35
- --color-text-inverse: #ffffff;
36
-
37
- --color-background: #ffffff;
38
- --color-surface-base: #f8f9fa;
39
- --color-surface-hover: #f1f3f4;
40
- --color-surface-active: #e8eaed;
41
-
42
- --color-border: #dadce0;
43
- --color-border-hover: #bdc1c6;
44
- }
45
-
46
- /* Dark Mode Overrides */
47
- [data-theme="dark"] {
48
- --color-text-primary: #e8eaed;
49
- --color-text-secondary: #9aa0a6;
50
- --color-background: #202124;
51
- --color-surface-base: #292a2d;
52
- --color-surface-hover: #35363a;
53
- --color-border: #5f6368;
54
- }
@@ -1,16 +0,0 @@
1
- import { juxV2 } from '../../lib/componentsv2';
2
-
3
-
4
- juxV2.Grid('base-layout')
5
- .rows([
6
- { size: '60px', class: 'header-row' }, // Header
7
- { size: '1fr', class: 'content-row' }, // Content
8
- { size: '40px', class: 'footer-row' } // Footer
9
- ])
10
- .columns([
11
- { size: '200px', class: 'sidebar-col' }, // Sidebar
12
- { size: '1fr', class: 'main-col' } // Main Content
13
- ])
14
- .gap('12px')
15
- .gridder(true) // Enable gridder to visualize the layout
16
- .render('app');
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,112 +0,0 @@
1
- import { OptionsContractSchema, ValidationResult } from './OptionsContract.js';
2
- export interface JuxServiceContract<TEngine = any> {
3
- name: string;
4
- version?: string;
5
- targetEnv?: 'client' | 'server' | 'universal';
6
- install: (engine: TEngine) => void;
7
- uninstall?: (engine: TEngine) => void;
8
- }
9
- export interface BaseState {
10
- id: string;
11
- classes: string[];
12
- visible: boolean;
13
- disabled: boolean;
14
- loading: boolean;
15
- attributes: Record<string, string>;
16
- }
17
- type EventListener<T = any> = (data: T) => void;
18
- /**
19
- * THE ENGINE AGREEMENT
20
- *
21
- * 1. Must define State and Options types.
22
- * 2. Must implement `prepareState` to map Options -> Initial State.
23
- * 3. Provides reactivity, eventing, and plugin systems out of the box.
24
- */
25
- export declare abstract class BaseEngine<TState extends BaseState, TOptions = any> {
26
- #private;
27
- constructor(id: string, options: TOptions);
28
- /**
29
- * CONTRACT: Override to define the valid options schema for this engine.
30
- * Enables option validation with helpful error messages.
31
- */
32
- protected get optionsSchema(): OptionsContractSchema | null;
33
- /**
34
- * Access validation results (warnings, errors, normalized options)
35
- */
36
- get validation(): ValidationResult | null;
37
- /**
38
- * CONTRACT: Must transform input options into the initial State.
39
- * This separates "mapping logic" from "construction/startup logic".
40
- */
41
- protected abstract prepareState(id: string, options: TOptions): TState;
42
- get state(): TState;
43
- subscribe(callback: (value: TState) => void): () => void;
44
- /**
45
- * Enable/Disable Active Console Logging
46
- */
47
- debug(enabled?: boolean): this;
48
- protected updateState(patch: Partial<TState>): void;
49
- /**
50
- * Revert the state to the previous snapshot
51
- */
52
- rollback(): this;
53
- /**
54
- * Redo the previously rolled-back state
55
- */
56
- rollforward(): this;
57
- /**
58
- * Local Subscription: Subscribe to a specific named event on THIS instance.
59
- */
60
- on<T = any>(event: string, callback: EventListener<T>): this;
61
- /**
62
- * Unsubscribe from a local event.
63
- */
64
- off<T = any>(event: string, callback: EventListener<T>): this;
65
- /**
66
- * THE LISTENER (Neighborhood Watch)
67
- * Listen for events broadcasting on the global frequency.
68
- * @param channel The global channel name (e.g. 'demo-list-v2:move')
69
- * @param callback Reaction logic
70
- */
71
- listenTo<T = any>(channel: string, callback: EventListener<T>): this;
72
- /**
73
- * Cleanup all global listeners attached by this engine.
74
- */
75
- dispose(): void;
76
- /**
77
- * BROADCASTER
78
- * Emits locally AND to the global neighborhood.
79
- */
80
- protected emit(event: string, data: any): void;
81
- /**
82
- * DEBUG: Access the Global Event Bus registry to see active channels and listener identities.
83
- * Useful for debugging communication topology from the console.
84
- */
85
- get eventRegistry(): Record<string, string[]>;
86
- /**
87
- * DEBUG: Access the Internal State Ledger (History).
88
- * Returns an array of JSON strings representing past states.
89
- */
90
- get stateHistory(): string[];
91
- /**
92
- * DEBUG: Access the Event Emission Ledger.
93
- */
94
- get emitHistory(): string[];
95
- /**
96
- * Inject a Service/Plugin into this Engine.
97
- * @param plugin A contract object { name, install, uninstall? }
98
- */
99
- addPlugin(plugin: JuxServiceContract<this>): this;
100
- /**
101
- * Remove a plugin and run its teardown logic.
102
- */
103
- removePlugin(name: string): this;
104
- addClass(className: string): this;
105
- removeClass(className: string): this;
106
- visible(isVisible: boolean): this;
107
- disable(isDisabled?: boolean): this;
108
- loading(isLoading?: boolean): this;
109
- attr(key: string, value: string): this;
110
- }
111
- export {};
112
- //# sourceMappingURL=BaseEngine.d.ts.map