juxscript 1.0.62 → 1.0.64
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 +161 -293
- package/docs/v2comps/HEADLESS.md +83 -0
- package/docs/v2comps/ISOMORPHISM.md +10 -0
- package/juxconfig.example.js +63 -58
- package/lib/componentsv2/base/BaseEngine.js +258 -0
- package/lib/componentsv2/base/BaseEngine.js.map +1 -0
- package/lib/componentsv2/base/BaseEngine.ts +303 -0
- package/lib/componentsv2/base/BaseSkin.js +108 -0
- package/lib/componentsv2/base/BaseSkin.js.map +1 -0
- package/lib/componentsv2/base/BaseSkin.ts +137 -0
- package/lib/componentsv2/base/GlobalBus.js +56 -0
- package/lib/componentsv2/base/GlobalBus.js.map +1 -0
- package/lib/componentsv2/base/GlobalBus.ts +60 -0
- package/lib/componentsv2/base/State.js +68 -0
- package/lib/componentsv2/base/State.js.map +1 -0
- package/lib/componentsv2/base/State.ts +62 -0
- package/lib/componentsv2/grid/component.js +41 -0
- package/lib/componentsv2/grid/component.js.map +1 -0
- package/lib/componentsv2/grid/component.ts +67 -0
- package/lib/componentsv2/grid/engine.js +73 -0
- package/lib/componentsv2/grid/engine.js.map +1 -0
- package/lib/componentsv2/grid/engine.ts +110 -0
- package/lib/componentsv2/grid/skin.js +95 -0
- package/lib/componentsv2/grid/skin.js.map +1 -0
- package/lib/componentsv2/grid/skin.ts +105 -0
- package/lib/componentsv2/grid/structure.css +58 -0
- package/lib/componentsv2/index.js +218 -0
- package/lib/componentsv2/index.js.map +1 -0
- package/lib/componentsv2/index.ts +253 -0
- package/lib/componentsv2/input/component.js +21 -0
- package/lib/componentsv2/input/component.js.map +1 -0
- package/lib/componentsv2/input/component.ts +28 -0
- package/lib/componentsv2/input/engine.js +50 -0
- package/lib/componentsv2/input/engine.js.map +1 -0
- package/lib/componentsv2/input/engine.ts +76 -0
- package/lib/componentsv2/input/skin.js +91 -0
- package/lib/componentsv2/input/skin.js.map +1 -0
- package/lib/componentsv2/input/skin.ts +91 -0
- package/lib/componentsv2/input/structure.css +47 -0
- package/lib/componentsv2/list/component.js +83 -0
- package/lib/componentsv2/list/component.js.map +1 -0
- package/lib/componentsv2/list/component.ts +97 -0
- package/lib/componentsv2/list/engine.js +261 -0
- package/lib/componentsv2/list/engine.js.map +1 -0
- package/lib/componentsv2/list/engine.ts +345 -0
- package/lib/componentsv2/list/skin.js +343 -0
- package/lib/componentsv2/list/skin.js.map +1 -0
- package/lib/componentsv2/list/skin.ts +367 -0
- package/lib/componentsv2/list/structure.css +359 -0
- package/lib/componentsv2/plugins/ClientSQLitePlugin.js +130 -0
- package/lib/componentsv2/plugins/ClientSQLitePlugin.js.map +1 -0
- package/lib/componentsv2/plugins/ClientSQLitePlugin.ts +154 -0
- package/lib/componentsv2/plugins/IndexedDBPlugin.js +75 -0
- package/lib/componentsv2/plugins/IndexedDBPlugin.js.map +1 -0
- package/lib/componentsv2/plugins/IndexedDBPlugin.ts +96 -0
- package/lib/componentsv2/plugins/LocalStoragePlugin.js +65 -0
- package/lib/componentsv2/plugins/LocalStoragePlugin.js.map +1 -0
- package/lib/componentsv2/plugins/LocalStoragePlugin.ts +86 -0
- package/lib/componentsv2/plugins/ServerSQLitePlugin.js +70 -0
- package/lib/componentsv2/plugins/ServerSQLitePlugin.js.map +1 -0
- package/lib/componentsv2/plugins/ServerSQLitePlugin.ts +99 -0
- package/lib/componentsv2/stubs/ComponentComposition.ts.stub +32 -0
- package/lib/componentsv2/stubs/ComponentEngine.ts.stub +36 -0
- package/lib/componentsv2/stubs/ComponentSkin.ts.stub +34 -0
- package/lib/componentsv2/stubs/ComponentStructure.css.stub +13 -0
- package/lib/componentsv2/tools/CreateSkin.js +62 -0
- package/lib/componentsv2/tools/DocSpam.js +134 -0
- package/lib/componentsv2/tools/FluencyAudit.js +141 -0
- package/lib/componentsv2/tools/OptionsAudit.js +177 -0
- package/lib/componentsv2/tools/Scaffold.js +140 -0
- package/lib/utils/fetch.js +428 -0
- package/lib/utils/fetch.js.map +1 -0
- package/machinery/build.js +2 -1
- package/machinery/compiler.js +200 -37
- package/machinery/config.js +93 -6
- package/machinery/diagnose.js +72 -0
- package/machinery/jux-module-pattern.md +118 -0
- package/machinery/server.js +23 -7
- package/machinery/verifier.js +143 -0
- package/machinery/watcher.js +53 -64
- package/package.json +11 -2
- package/lib/components/alert.ts +0 -200
- package/lib/components/app.ts +0 -258
- package/lib/components/badge.ts +0 -101
- package/lib/components/base/BaseComponent.ts +0 -417
- package/lib/components/base/FormInput.ts +0 -227
- package/lib/components/button.ts +0 -178
- package/lib/components/card.ts +0 -173
- package/lib/components/chart.ts +0 -231
- package/lib/components/checkbox.ts +0 -242
- package/lib/components/code.ts +0 -123
- package/lib/components/container.ts +0 -140
- package/lib/components/data.ts +0 -135
- package/lib/components/datepicker.ts +0 -234
- package/lib/components/dialog.ts +0 -172
- package/lib/components/divider.ts +0 -100
- package/lib/components/dropdown.ts +0 -186
- package/lib/components/element.ts +0 -267
- package/lib/components/error-handler.ts +0 -285
- package/lib/components/fileupload.ts +0 -309
- package/lib/components/grid.ts +0 -291
- package/lib/components/guard.ts +0 -92
- package/lib/components/heading.ts +0 -96
- package/lib/components/helpers.ts +0 -41
- package/lib/components/hero.ts +0 -224
- package/lib/components/icon.ts +0 -160
- package/lib/components/icons.ts +0 -175
- package/lib/components/include.ts +0 -440
- package/lib/components/input.ts +0 -457
- package/lib/components/list.ts +0 -419
- package/lib/components/loading.ts +0 -100
- package/lib/components/menu.ts +0 -260
- package/lib/components/modal.ts +0 -239
- package/lib/components/nav.ts +0 -257
- package/lib/components/paragraph.ts +0 -97
- package/lib/components/progress.ts +0 -139
- package/lib/components/radio.ts +0 -278
- package/lib/components/req.ts +0 -302
- package/lib/components/script.ts +0 -43
- package/lib/components/select.ts +0 -252
- package/lib/components/sidebar.ts +0 -167
- package/lib/components/style.ts +0 -43
- package/lib/components/switch.ts +0 -246
- package/lib/components/table.ts +0 -1249
- package/lib/components/tabs.ts +0 -250
- package/lib/components/theme-toggle.ts +0 -300
- package/lib/components/token-calculator.ts +0 -313
- package/lib/components/tooltip.ts +0 -144
- package/lib/components/view.ts +0 -190
- package/lib/components/write.ts +0 -272
- package/lib/jux.ts +0 -365
- package/lib/layouts/default.css +0 -260
- package/lib/layouts/figma.css +0 -334
- package/lib/reactivity/state.ts +0 -78
- package/machinery/bundleAssets.js +0 -0
- package/machinery/bundleJux.js +0 -0
- package/machinery/bundleVendors.js +0 -0
- package/presets/default/all.jux +0 -343
- package/presets/default/index.jux +0 -90
- package/presets/default/layout.jux +0 -57
- package/presets/default/style.css +0 -1612
package/lib/components/write.ts
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Write - Simple content writer with no component tracking
|
|
3
|
-
* Perfect for quick HTML output without ID management
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export interface WriteOptions {
|
|
7
|
-
tagType?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
style?: string;
|
|
10
|
-
attributes?: Record<string, string>;
|
|
11
|
-
html?: boolean; // If true, treat content as HTML; if false, treat as text
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Write content directly to a target element
|
|
16
|
-
*
|
|
17
|
-
* Usage:
|
|
18
|
-
* // Write text (defaults to body)
|
|
19
|
-
* jux.write('Hello World!').render();
|
|
20
|
-
*
|
|
21
|
-
* // Write to specific target
|
|
22
|
-
* jux.write('Content').render('#container');
|
|
23
|
-
*
|
|
24
|
-
* // Write HTML
|
|
25
|
-
* jux.write('<strong>Bold text</strong>').html(true).render('#container');
|
|
26
|
-
*
|
|
27
|
-
* // Write with styling
|
|
28
|
-
* jux.write('Styled text').style('color: red;').render('#container');
|
|
29
|
-
*/
|
|
30
|
-
export class Write {
|
|
31
|
-
private content: string;
|
|
32
|
-
private options: WriteOptions;
|
|
33
|
-
|
|
34
|
-
constructor(content: string, options: WriteOptions = {}) {
|
|
35
|
-
this.content = content;
|
|
36
|
-
this.options = {
|
|
37
|
-
tagType: 'div',
|
|
38
|
-
className: '',
|
|
39
|
-
style: '',
|
|
40
|
-
attributes: {},
|
|
41
|
-
html: false,
|
|
42
|
-
...options
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
47
|
-
* FLUENT API
|
|
48
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Set HTML mode (treat content as HTML)
|
|
52
|
-
*/
|
|
53
|
-
html(enabled: boolean = true): this {
|
|
54
|
-
this.options.html = enabled;
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Set tag type
|
|
60
|
-
*/
|
|
61
|
-
tagType(value: string): this {
|
|
62
|
-
this.options.tagType = value;
|
|
63
|
-
return this;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Set CSS class
|
|
68
|
-
*/
|
|
69
|
-
className(value: string): this {
|
|
70
|
-
this.options.className = value;
|
|
71
|
-
return this;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Set inline styles
|
|
76
|
-
*/
|
|
77
|
-
style(value: string): this {
|
|
78
|
-
this.options.style = value;
|
|
79
|
-
return this;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Set custom attributes
|
|
84
|
-
*/
|
|
85
|
-
attrs(attributes: Record<string, string>): this {
|
|
86
|
-
this.options.attributes = attributes;
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
91
|
-
* RENDER METHODS
|
|
92
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Render content to target element
|
|
96
|
-
*/
|
|
97
|
-
render(targetSelector?: string): this {
|
|
98
|
-
const target = this._getTarget(targetSelector);
|
|
99
|
-
if (!target) return this;
|
|
100
|
-
|
|
101
|
-
const element = this._createElement();
|
|
102
|
-
target.appendChild(element);
|
|
103
|
-
|
|
104
|
-
return this;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Replace target content (clear first, then render)
|
|
109
|
-
*/
|
|
110
|
-
replace(targetSelector?: string): this {
|
|
111
|
-
const target = this._getTarget(targetSelector);
|
|
112
|
-
if (!target) return this;
|
|
113
|
-
|
|
114
|
-
target.innerHTML = '';
|
|
115
|
-
const element = this._createElement();
|
|
116
|
-
target.appendChild(element);
|
|
117
|
-
|
|
118
|
-
return this;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Render before target element
|
|
123
|
-
*/
|
|
124
|
-
before(targetSelector: string): this {
|
|
125
|
-
const target = document.querySelector(targetSelector);
|
|
126
|
-
if (!target || !(target instanceof HTMLElement)) {
|
|
127
|
-
console.warn(`Write: Target element "${targetSelector}" not found`);
|
|
128
|
-
return this;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const element = this._createElement();
|
|
132
|
-
target.parentNode?.insertBefore(element, target);
|
|
133
|
-
|
|
134
|
-
return this;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Render after target element
|
|
139
|
-
*/
|
|
140
|
-
after(targetSelector: string): this {
|
|
141
|
-
const target = document.querySelector(targetSelector);
|
|
142
|
-
if (!target || !(target instanceof HTMLElement)) {
|
|
143
|
-
console.warn(`Write: Target element "${targetSelector}" not found`);
|
|
144
|
-
return this;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const element = this._createElement();
|
|
148
|
-
target.parentNode?.insertBefore(element, target.nextSibling);
|
|
149
|
-
|
|
150
|
-
return this;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Prepend to target (insert as first child)
|
|
155
|
-
*/
|
|
156
|
-
prepend(targetSelector?: string): this {
|
|
157
|
-
const target = this._getTarget(targetSelector);
|
|
158
|
-
if (!target) return this;
|
|
159
|
-
|
|
160
|
-
const element = this._createElement();
|
|
161
|
-
target.insertBefore(element, target.firstChild);
|
|
162
|
-
|
|
163
|
-
return this;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Append to target (alias for render)
|
|
168
|
-
*/
|
|
169
|
-
append(targetSelector?: string): this {
|
|
170
|
-
return this.render(targetSelector);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
174
|
-
* PRIVATE HELPERS
|
|
175
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
176
|
-
|
|
177
|
-
private _getTarget(selector?: string): HTMLElement | null {
|
|
178
|
-
const targetSelector = selector || 'body';
|
|
179
|
-
const target = document.querySelector(targetSelector);
|
|
180
|
-
|
|
181
|
-
if (!target || !(target instanceof HTMLElement)) {
|
|
182
|
-
console.warn(`Write: Target element "${targetSelector}" not found`);
|
|
183
|
-
return null;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return target;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
private _createElement(): HTMLElement {
|
|
190
|
-
const element = document.createElement(this.options.tagType!);
|
|
191
|
-
|
|
192
|
-
// Set content (text or HTML)
|
|
193
|
-
if (this.options.html) {
|
|
194
|
-
element.innerHTML = this.content;
|
|
195
|
-
} else {
|
|
196
|
-
element.textContent = this.content;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Apply className
|
|
200
|
-
if (this.options.className) {
|
|
201
|
-
element.className = this.options.className;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// Apply inline styles
|
|
205
|
-
if (this.options.style) {
|
|
206
|
-
element.setAttribute('style', this.options.style);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Apply custom attributes
|
|
210
|
-
if (this.options.attributes) {
|
|
211
|
-
Object.entries(this.options.attributes).forEach(([key, value]) => {
|
|
212
|
-
element.setAttribute(key, value);
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return element;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Factory function - simple, no overloads
|
|
222
|
-
*/
|
|
223
|
-
export function write(content: string, options: WriteOptions = {}): Write {
|
|
224
|
-
return new Write(content, options);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
228
|
-
* SHORTHAND HELPERS
|
|
229
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Write text (explicit)
|
|
233
|
-
*/
|
|
234
|
-
export function writeText(content: string, options: Omit<WriteOptions, 'html'> = {}): Write {
|
|
235
|
-
return new Write(content, { ...options, html: false });
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Write HTML (explicit)
|
|
240
|
-
*/
|
|
241
|
-
export function writeHtml(content: string, options: Omit<WriteOptions, 'html'> = {}): Write {
|
|
242
|
-
return new Write(content, { ...options, html: true });
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Write paragraph
|
|
247
|
-
*/
|
|
248
|
-
export function writeParagraph(content: string, options: Omit<WriteOptions, 'tagType'> = {}): Write {
|
|
249
|
-
return new Write(content, { ...options, tagType: 'p' });
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Write heading
|
|
254
|
-
*/
|
|
255
|
-
export function writeHeading(content: string, level: 1 | 2 | 3 | 4 | 5 | 6 = 2, options: Omit<WriteOptions, 'tagType'> = {}): Write {
|
|
256
|
-
return new Write(content, { ...options, tagType: `h${level}` });
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Write span
|
|
261
|
-
*/
|
|
262
|
-
export function writeSpan(content: string, options: Omit<WriteOptions, 'tagType'> = {}): Write {
|
|
263
|
-
return new Write(content, { ...options, tagType: 'span' });
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Write div (explicit)
|
|
268
|
-
*/
|
|
269
|
-
export function writeDiv(content: string, options: Omit<WriteOptions, 'tagType'> = {}): Write {
|
|
270
|
-
return new Write(content, { ...options, tagType: 'div' });
|
|
271
|
-
}
|
|
272
|
-
|
package/lib/jux.ts
DELETED
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Jux Runtime - Shared across all pages
|
|
3
|
-
* Imports all components and provides the jux global object
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { state } from './reactivity/state.js';
|
|
7
|
-
import { fetchAPI, type FetchConfig, type FetchResult } from './utils/fetch.js';
|
|
8
|
-
import { Guard, type GuardOptions, guard } from './components/guard.js';
|
|
9
|
-
import { Data, data } from './components/data.js';
|
|
10
|
-
import { table, Table, type TableOptions } from './components/table.js';
|
|
11
|
-
import { hero, Hero, type HeroOptions } from './components/hero.js';
|
|
12
|
-
import { card, Card, type CardOptions } from './components/card.js';
|
|
13
|
-
import { button, Button, type ButtonOptions } from './components/button.js';
|
|
14
|
-
import {
|
|
15
|
-
element, Element, type ElementOptions,
|
|
16
|
-
header, footer, main, aside, section, article, div, span
|
|
17
|
-
} from './components/element.js';
|
|
18
|
-
import { container, Container, type ContainerOptions } from './components/container.js';
|
|
19
|
-
import { modal, Modal, type ModalOptions } from './components/modal.js';
|
|
20
|
-
import { tabs, Tabs, type TabsOptions, type Tab } from './components/tabs.js';
|
|
21
|
-
import { list, List, type ListOptions, type ListItem } from './components/list.js';
|
|
22
|
-
import { menu, Menu, type MenuOptions, type MenuItem } from './components/menu.js';
|
|
23
|
-
import { nav, Nav, type NavOptions, type NavItem } from './components/nav.js';
|
|
24
|
-
import { view, View, type ViewOptions } from './components/view.js';
|
|
25
|
-
import { code, Code, type CodeOptions } from './components/code.js';
|
|
26
|
-
import {
|
|
27
|
-
input, Input, type InputOptions,
|
|
28
|
-
text, number, email, password, tel, url, textarea, range, date, time, color
|
|
29
|
-
} from './components/input.js';
|
|
30
|
-
import { app, App, type AppOptions } from './components/app.js';
|
|
31
|
-
import { style, Style } from './components/style.js';
|
|
32
|
-
import { script, Script } from './components/script.js';
|
|
33
|
-
import { ErrorHandler } from './components/error-handler.js';
|
|
34
|
-
import { include, Include } from './components/include.js';
|
|
35
|
-
import { themeToggle, ThemeToggle, type ThemeToggleOptions, type Theme } from './components/theme-toggle.js';
|
|
36
|
-
import { tokenCalculator, TokenCalculator, type TokenCalculatorOptions } from './components/token-calculator.js';
|
|
37
|
-
import { write, Write, type WriteOptions } from './components/write.js';
|
|
38
|
-
import { alert, Alert, type AlertOptions } from './components/alert.js';
|
|
39
|
-
import { loading, Loading, type LoadingOptions } from './components/loading.js';
|
|
40
|
-
import { checkbox, Checkbox, type CheckboxOptions } from './components/checkbox.js';
|
|
41
|
-
import { select, Select, type SelectOptions, type SelectOption } from './components/select.js';
|
|
42
|
-
import { radio, Radio, type RadioOptions, type RadioOption } from './components/radio.js';
|
|
43
|
-
import { switchComponent, Switch, type SwitchOptions } from './components/switch.js';
|
|
44
|
-
import { badge, Badge, type BadgeOptions } from './components/badge.js';
|
|
45
|
-
import { progress, Progress, type ProgressOptions } from './components/progress.js';
|
|
46
|
-
import { tooltip, Tooltip, type TooltipOptions } from './components/tooltip.js';
|
|
47
|
-
import { dialog, Dialog, type DialogOptions } from './components/dialog.js';
|
|
48
|
-
import { dropdown, Dropdown, type DropdownOptions, type DropdownItem } from './components/dropdown.js';
|
|
49
|
-
import { datepicker, DatePicker, type DatePickerOptions } from './components/datepicker.js';
|
|
50
|
-
import { fileupload, FileUpload, type FileUploadOptions } from './components/fileupload.js';
|
|
51
|
-
import { req, Req, type RequestInfo } from './components/req.js';
|
|
52
|
-
import { heading, Heading, type HeadingOptions } from './components/heading.js';
|
|
53
|
-
import { paragraph, Paragraph, type ParagraphOptions } from './components/paragraph.js';
|
|
54
|
-
import { divider, Divider, type DividerOptions } from './components/divider.js';
|
|
55
|
-
import { icon as iconComponent, Icon, type IconOptions } from './components/icon.js';
|
|
56
|
-
import { renderIcon, renderEmoji } from './components/icons.js';
|
|
57
|
-
import { sidebar, Sidebar, type SidebarOptions } from './components/sidebar.js';
|
|
58
|
-
import { grid, Grid } from './components/grid.js';
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/* -------------------------
|
|
62
|
-
* Type Exports
|
|
63
|
-
* ------------------------- */
|
|
64
|
-
|
|
65
|
-
export type {
|
|
66
|
-
GuardOptions,
|
|
67
|
-
HeroOptions,
|
|
68
|
-
ButtonOptions,
|
|
69
|
-
ContainerOptions,
|
|
70
|
-
ListOptions,
|
|
71
|
-
ListItem,
|
|
72
|
-
ModalOptions,
|
|
73
|
-
TabsOptions,
|
|
74
|
-
Tab,
|
|
75
|
-
MenuOptions,
|
|
76
|
-
MenuItem,
|
|
77
|
-
NavOptions,
|
|
78
|
-
NavItem,
|
|
79
|
-
ViewOptions,
|
|
80
|
-
TableOptions,
|
|
81
|
-
CodeOptions,
|
|
82
|
-
InputOptions,
|
|
83
|
-
CardOptions,
|
|
84
|
-
AppOptions,
|
|
85
|
-
ThemeToggleOptions,
|
|
86
|
-
Theme,
|
|
87
|
-
TokenCalculatorOptions,
|
|
88
|
-
WriteOptions,
|
|
89
|
-
ElementOptions,
|
|
90
|
-
AlertOptions,
|
|
91
|
-
LoadingOptions,
|
|
92
|
-
CheckboxOptions,
|
|
93
|
-
SelectOptions,
|
|
94
|
-
SelectOption,
|
|
95
|
-
RadioOptions,
|
|
96
|
-
RadioOption,
|
|
97
|
-
SwitchOptions,
|
|
98
|
-
BadgeOptions,
|
|
99
|
-
ProgressOptions,
|
|
100
|
-
TooltipOptions,
|
|
101
|
-
DialogOptions,
|
|
102
|
-
DropdownOptions,
|
|
103
|
-
DropdownItem,
|
|
104
|
-
DatePickerOptions,
|
|
105
|
-
FileUploadOptions,
|
|
106
|
-
RequestInfo,
|
|
107
|
-
HeadingOptions,
|
|
108
|
-
ParagraphOptions,
|
|
109
|
-
DividerOptions,
|
|
110
|
-
IconOptions,
|
|
111
|
-
SidebarOptions
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
/* -------------------------
|
|
115
|
-
* Class Exports
|
|
116
|
-
* ------------------------- */
|
|
117
|
-
|
|
118
|
-
export {
|
|
119
|
-
Guard,
|
|
120
|
-
Data,
|
|
121
|
-
Hero,
|
|
122
|
-
Card,
|
|
123
|
-
Button,
|
|
124
|
-
Container,
|
|
125
|
-
List,
|
|
126
|
-
Table,
|
|
127
|
-
Modal,
|
|
128
|
-
Tabs,
|
|
129
|
-
Menu,
|
|
130
|
-
Nav,
|
|
131
|
-
Code,
|
|
132
|
-
Input,
|
|
133
|
-
View,
|
|
134
|
-
App,
|
|
135
|
-
Style,
|
|
136
|
-
Script,
|
|
137
|
-
Include,
|
|
138
|
-
ThemeToggle,
|
|
139
|
-
TokenCalculator,
|
|
140
|
-
Write,
|
|
141
|
-
Element,
|
|
142
|
-
Alert,
|
|
143
|
-
Loading,
|
|
144
|
-
Checkbox,
|
|
145
|
-
Select,
|
|
146
|
-
Radio,
|
|
147
|
-
Switch,
|
|
148
|
-
Badge,
|
|
149
|
-
Progress,
|
|
150
|
-
Tooltip,
|
|
151
|
-
Dialog,
|
|
152
|
-
Dropdown,
|
|
153
|
-
DatePicker,
|
|
154
|
-
FileUpload,
|
|
155
|
-
Req,
|
|
156
|
-
Heading,
|
|
157
|
-
Paragraph,
|
|
158
|
-
Divider,
|
|
159
|
-
Icon,
|
|
160
|
-
Sidebar,
|
|
161
|
-
Grid
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
/* -------------------------
|
|
165
|
-
* Jux API Interface
|
|
166
|
-
* ------------------------- */
|
|
167
|
-
|
|
168
|
-
export interface JuxAPI {
|
|
169
|
-
// Utility methods
|
|
170
|
-
apiUrl: string;
|
|
171
|
-
param(name: string): string | null;
|
|
172
|
-
req: typeof req;
|
|
173
|
-
fetch: typeof fetchAPI;
|
|
174
|
-
|
|
175
|
-
// Icon utilities
|
|
176
|
-
icon: typeof renderIcon;
|
|
177
|
-
emoji: typeof renderEmoji;
|
|
178
|
-
iconComponent: typeof iconComponent;
|
|
179
|
-
|
|
180
|
-
// Component factories
|
|
181
|
-
data: typeof data;
|
|
182
|
-
guard: typeof guard;
|
|
183
|
-
table: typeof table;
|
|
184
|
-
hero: typeof hero;
|
|
185
|
-
card: typeof card;
|
|
186
|
-
button: typeof button;
|
|
187
|
-
header: typeof header;
|
|
188
|
-
footer: typeof footer;
|
|
189
|
-
main: typeof main;
|
|
190
|
-
sidebar: typeof sidebar;
|
|
191
|
-
aside: typeof aside;
|
|
192
|
-
section: typeof section;
|
|
193
|
-
article: typeof article;
|
|
194
|
-
container: typeof container;
|
|
195
|
-
modal: typeof modal;
|
|
196
|
-
tabs: typeof tabs;
|
|
197
|
-
list: typeof list;
|
|
198
|
-
menu: typeof menu;
|
|
199
|
-
nav: typeof nav;
|
|
200
|
-
div: typeof div;
|
|
201
|
-
span: typeof span;
|
|
202
|
-
code: typeof code;
|
|
203
|
-
|
|
204
|
-
view: typeof view;
|
|
205
|
-
app: typeof app;
|
|
206
|
-
style: typeof style;
|
|
207
|
-
script: typeof script;
|
|
208
|
-
include: typeof include;
|
|
209
|
-
themeToggle: typeof themeToggle;
|
|
210
|
-
tokenCalculator: typeof tokenCalculator;
|
|
211
|
-
write: typeof write;
|
|
212
|
-
element: typeof element;
|
|
213
|
-
alert: typeof alert;
|
|
214
|
-
loading: typeof loading;
|
|
215
|
-
checkbox: typeof checkbox;
|
|
216
|
-
select: typeof select;
|
|
217
|
-
radio: typeof radio;
|
|
218
|
-
switch: typeof switchComponent;
|
|
219
|
-
badge: typeof badge;
|
|
220
|
-
progress: typeof progress;
|
|
221
|
-
tooltip: typeof tooltip;
|
|
222
|
-
dialog: typeof dialog;
|
|
223
|
-
dropdown: typeof dropdown;
|
|
224
|
-
datepicker: typeof datepicker;
|
|
225
|
-
fileupload: typeof fileupload;
|
|
226
|
-
heading: typeof heading;
|
|
227
|
-
paragraph: typeof paragraph;
|
|
228
|
-
divider: typeof divider;
|
|
229
|
-
|
|
230
|
-
// Input factories
|
|
231
|
-
input: typeof input;
|
|
232
|
-
text: typeof text;
|
|
233
|
-
number: typeof number;
|
|
234
|
-
email: typeof email;
|
|
235
|
-
password: typeof password;
|
|
236
|
-
tel: typeof tel;
|
|
237
|
-
url: typeof url;
|
|
238
|
-
textarea: typeof textarea;
|
|
239
|
-
range: typeof range;
|
|
240
|
-
date: typeof date;
|
|
241
|
-
time: typeof time;
|
|
242
|
-
color: typeof color;
|
|
243
|
-
grid: typeof grid;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/* -------------------------
|
|
247
|
-
* Jux Singleton
|
|
248
|
-
* ------------------------- */
|
|
249
|
-
|
|
250
|
-
class Jux implements JuxAPI {
|
|
251
|
-
apiUrl: string = '/api/query';
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* Get URL parameter or juxContext value
|
|
255
|
-
*/
|
|
256
|
-
param(name: string): string | null {
|
|
257
|
-
if (typeof window !== 'undefined' && (window as any).juxContext?.[name] !== undefined) {
|
|
258
|
-
return (window as any).juxContext[name];
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
if (typeof window !== 'undefined') {
|
|
262
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
263
|
-
return urlParams.get(name);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
return null;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// Request utilities
|
|
270
|
-
req = req;
|
|
271
|
-
|
|
272
|
-
// Fetch utility
|
|
273
|
-
fetch = fetchAPI;
|
|
274
|
-
|
|
275
|
-
// Icon utilities
|
|
276
|
-
icon = renderIcon;
|
|
277
|
-
emoji = renderEmoji;
|
|
278
|
-
iconComponent = iconComponent;
|
|
279
|
-
|
|
280
|
-
// Component factory methods
|
|
281
|
-
data = data;
|
|
282
|
-
guard = guard;
|
|
283
|
-
table = table;
|
|
284
|
-
hero = hero;
|
|
285
|
-
card = card;
|
|
286
|
-
button = button;
|
|
287
|
-
header = header;
|
|
288
|
-
footer = footer;
|
|
289
|
-
main = main;
|
|
290
|
-
sidebar = sidebar;
|
|
291
|
-
aside = aside;
|
|
292
|
-
section = section;
|
|
293
|
-
article = article;
|
|
294
|
-
container = container;
|
|
295
|
-
modal = modal;
|
|
296
|
-
tabs = tabs;
|
|
297
|
-
list = list;
|
|
298
|
-
menu = menu;
|
|
299
|
-
code = code;
|
|
300
|
-
nav = nav;
|
|
301
|
-
div = div;
|
|
302
|
-
span = span;
|
|
303
|
-
view = view;
|
|
304
|
-
app = app;
|
|
305
|
-
include = include;
|
|
306
|
-
style = style;
|
|
307
|
-
script = script;
|
|
308
|
-
themeToggle = themeToggle;
|
|
309
|
-
tokenCalculator = tokenCalculator;
|
|
310
|
-
write = write;
|
|
311
|
-
element = element;
|
|
312
|
-
alert = alert;
|
|
313
|
-
loading = loading;
|
|
314
|
-
checkbox = checkbox;
|
|
315
|
-
select = select;
|
|
316
|
-
radio = radio;
|
|
317
|
-
switch = switchComponent;
|
|
318
|
-
badge = badge;
|
|
319
|
-
progress = progress;
|
|
320
|
-
tooltip = tooltip;
|
|
321
|
-
dialog = dialog;
|
|
322
|
-
dropdown = dropdown;
|
|
323
|
-
datepicker = datepicker;
|
|
324
|
-
fileupload = fileupload;
|
|
325
|
-
heading = heading;
|
|
326
|
-
paragraph = paragraph;
|
|
327
|
-
divider = divider;
|
|
328
|
-
|
|
329
|
-
// Input factories
|
|
330
|
-
input = input;
|
|
331
|
-
text = text;
|
|
332
|
-
number = number;
|
|
333
|
-
email = email;
|
|
334
|
-
password = password;
|
|
335
|
-
tel = tel;
|
|
336
|
-
url = url;
|
|
337
|
-
textarea = textarea;
|
|
338
|
-
range = range;
|
|
339
|
-
date = date;
|
|
340
|
-
time = time;
|
|
341
|
-
color = color;
|
|
342
|
-
grid = grid;
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Global jux singleton instance
|
|
346
|
-
*/
|
|
347
|
-
const jux = new Jux();
|
|
348
|
-
|
|
349
|
-
// Make jux available globally in browser
|
|
350
|
-
if (typeof window !== 'undefined') {
|
|
351
|
-
(window as any).jux = jux;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/* -------------------------
|
|
355
|
-
* Exports
|
|
356
|
-
* ------------------------- */
|
|
357
|
-
|
|
358
|
-
export {
|
|
359
|
-
jux,
|
|
360
|
-
state,
|
|
361
|
-
req,
|
|
362
|
-
ErrorHandler,
|
|
363
|
-
renderIcon,
|
|
364
|
-
renderEmoji
|
|
365
|
-
};
|