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.
- package/README.md +1 -32
- package/bin/cli.js +4 -2
- package/index.d.ts +200 -0
- package/index.js +96 -22
- package/juxconfig.example.js +58 -63
- package/lib/components/alert.ts +200 -0
- package/lib/components/app.ts +247 -0
- package/lib/components/badge.ts +101 -0
- package/lib/components/base/BaseComponent.ts +421 -0
- package/lib/components/base/FormInput.ts +227 -0
- package/lib/components/button.ts +178 -0
- package/lib/components/card.ts +173 -0
- package/lib/components/chart.ts +231 -0
- package/lib/components/checkbox.ts +242 -0
- package/lib/components/code.ts +123 -0
- package/lib/components/container.ts +140 -0
- package/lib/components/data.ts +135 -0
- package/lib/components/datepicker.ts +234 -0
- package/lib/components/dialog.ts +172 -0
- package/lib/components/divider.ts +100 -0
- package/lib/components/dropdown.ts +186 -0
- package/lib/components/element.ts +267 -0
- package/lib/components/fileupload.ts +309 -0
- package/lib/components/grid.ts +291 -0
- package/lib/components/guard.ts +92 -0
- package/lib/components/heading.ts +96 -0
- package/lib/components/helpers.ts +41 -0
- package/lib/components/hero.ts +224 -0
- package/lib/components/icon.ts +178 -0
- package/lib/components/icons.ts +464 -0
- package/lib/components/include.ts +410 -0
- package/lib/components/input.ts +457 -0
- package/lib/components/list.ts +419 -0
- package/lib/components/loading.ts +100 -0
- package/lib/components/menu.ts +275 -0
- package/lib/components/modal.ts +284 -0
- package/lib/components/nav.ts +257 -0
- package/lib/components/paragraph.ts +97 -0
- package/lib/components/progress.ts +159 -0
- package/lib/components/radio.ts +278 -0
- package/lib/components/req.ts +303 -0
- package/lib/components/script.ts +41 -0
- package/lib/components/select.ts +252 -0
- package/lib/components/sidebar.ts +275 -0
- package/lib/components/style.ts +41 -0
- package/lib/components/switch.ts +246 -0
- package/lib/components/table.ts +1249 -0
- package/lib/components/tabs.ts +250 -0
- package/lib/components/theme-toggle.ts +293 -0
- package/lib/components/tooltip.ts +144 -0
- package/lib/components/view.ts +190 -0
- package/lib/components/write.ts +272 -0
- package/lib/globals.d.ts +19 -5
- package/lib/layouts/default.css +260 -0
- package/lib/layouts/figma.css +334 -0
- package/lib/reactivity/state.ts +78 -0
- package/lib/utils/{fetch.js → fetch.ts} +206 -81
- package/package.json +9 -31
- package/create/index.jux +0 -77
- package/create/layout.jux +0 -18
- package/create/style.css +0 -57
- package/create/themes/assets/jux.svg +0 -34
- package/create/themes/base.css +0 -197
- package/create/themes/base2.css +0 -54
- package/create/themes/layouts/base.jux +0 -16
- package/create/themes/layouts/base_blog.jux +0 -0
- package/create/themes/layouts/base_docs.jux +0 -0
- package/create/themes/layouts/base_login.jux +0 -0
- package/create/themes/layouts/base_marketing.jux +0 -0
- package/create/themes/layouts/base_saas.jux +0 -0
- package/lib/componentsv2/base/BaseEngine.d.ts +0 -112
- package/lib/componentsv2/base/BaseEngine.js +0 -279
- package/lib/componentsv2/base/BaseSkin.d.ts +0 -74
- package/lib/componentsv2/base/BaseSkin.js +0 -130
- package/lib/componentsv2/base/Neighborhood.d.ts +0 -22
- package/lib/componentsv2/base/Neighborhood.js +0 -56
- package/lib/componentsv2/base/OptionsContract.d.ts +0 -20
- package/lib/componentsv2/base/OptionsContract.js +0 -107
- package/lib/componentsv2/base/State.d.ts +0 -18
- package/lib/componentsv2/base/State.js +0 -68
- package/lib/componentsv2/element/Element.d.ts +0 -29
- package/lib/componentsv2/element/Element.js +0 -49
- package/lib/componentsv2/element/ElementEngine.d.ts +0 -58
- package/lib/componentsv2/element/ElementEngine.js +0 -112
- package/lib/componentsv2/element/ElementSkin.d.ts +0 -10
- package/lib/componentsv2/element/ElementSkin.js +0 -56
- package/lib/componentsv2/element/structure.css +0 -261
- package/lib/componentsv2/grid/Grid.d.ts +0 -13
- package/lib/componentsv2/grid/Grid.js +0 -27
- package/lib/componentsv2/grid/GridEngine.d.ts +0 -77
- package/lib/componentsv2/grid/GridEngine.js +0 -153
- package/lib/componentsv2/grid/GridSkin.d.ts +0 -11
- package/lib/componentsv2/grid/GridSkin.js +0 -84
- package/lib/componentsv2/grid/structure.css +0 -27
- package/lib/componentsv2/input/Input.d.ts +0 -6
- package/lib/componentsv2/input/Input.js +0 -21
- package/lib/componentsv2/input/InputEngine.d.ts +0 -70
- package/lib/componentsv2/input/InputEngine.js +0 -143
- package/lib/componentsv2/input/InputSkin.d.ts +0 -11
- package/lib/componentsv2/input/InputSkin.js +0 -89
- package/lib/componentsv2/input/structure.css +0 -47
- package/lib/componentsv2/list/List.d.ts +0 -49
- package/lib/componentsv2/list/List.js +0 -105
- package/lib/componentsv2/list/ListEngine.d.ts +0 -121
- package/lib/componentsv2/list/ListEngine.js +0 -322
- package/lib/componentsv2/list/ListSkin.d.ts +0 -20
- package/lib/componentsv2/list/ListSkin.js +0 -345
- package/lib/componentsv2/list/structure.css +0 -359
- package/lib/componentsv2/plugins/ClientSQLitePlugin.d.ts +0 -21
- package/lib/componentsv2/plugins/ClientSQLitePlugin.js +0 -130
- package/lib/componentsv2/plugins/IndexedDBPlugin.d.ts +0 -18
- package/lib/componentsv2/plugins/IndexedDBPlugin.js +0 -75
- package/lib/componentsv2/plugins/LocalStoragePlugin.d.ts +0 -20
- package/lib/componentsv2/plugins/LocalStoragePlugin.js +0 -65
- package/lib/componentsv2/plugins/ServerSQLitePlugin.d.ts +0 -25
- package/lib/componentsv2/plugins/ServerSQLitePlugin.js +0 -70
- package/lib/componentsv2/stubs/ComponentComposition.ts.stub +0 -32
- package/lib/componentsv2/stubs/ComponentEngine.ts.stub +0 -36
- package/lib/componentsv2/stubs/ComponentSkin.ts.stub +0 -35
- package/lib/componentsv2/stubs/ComponentStructure.css.d.ts.stub +0 -2
- package/lib/componentsv2/stubs/ComponentStructure.css.stub +0 -13
- package/lib/utils/fetch.d.ts +0 -176
- package/machinery/build3.js +0 -159
- package/machinery/compiler3.js +0 -688
- package/machinery/config.js +0 -155
- package/machinery/serve.js +0 -255
- package/machinery/validators/file-validator.js +0 -123
- package/machinery/watcher.js +0 -59
- package/types/css.d.ts +0 -10
package/README.md
CHANGED
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
> Say goodbye to markup `</</>>>`. Build reactive UIs with pure JavaScript.
|
|
4
|
-
|
|
5
|
-
## 🚀 Quick Start
|
|
6
|
-
|
|
7
|
-
### Option 1: Create New Project (Recommended)
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npx jux create my-app
|
|
11
|
-
cd my-app
|
|
12
|
-
npm run dev
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### Option 2: Add to Existing Project
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# Install juxscript first
|
|
19
|
-
npm install juxscript
|
|
20
|
-
|
|
21
|
-
# Then initialize
|
|
22
|
-
npx jux init
|
|
23
|
-
|
|
24
|
-
# Start dev server
|
|
25
|
-
npx jux serve
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Why Install First?
|
|
29
|
-
|
|
30
|
-
JUX uses `esbuild`, `express`, and other tools that must be installed before the CLI can run. When you run `npm install juxscript`, these dependencies are automatically installed.
|
|
31
|
-
|
|
32
|
-
## The web needs a higher level of abstraction: Meet **JUX**
|
|
1
|
+
# The web needs a higher level of abstraction: Meet **JUX**
|
|
33
2
|
|
|
34
3
|
|
|
35
4
|
```diff
|
package/bin/cli.js
CHANGED
|
@@ -42,9 +42,10 @@ async function createProject(projectName) {
|
|
|
42
42
|
// Fallback: create minimal starter
|
|
43
43
|
const juxDir = path.join(targetDir, 'jux');
|
|
44
44
|
fs.mkdirSync(juxDir, { recursive: true });
|
|
45
|
+
// Updated to use jux namespace and renderTo
|
|
45
46
|
fs.writeFileSync(
|
|
46
47
|
path.join(juxDir, 'index.jux'),
|
|
47
|
-
`import {
|
|
48
|
+
`import { jux } from 'juxscript';\n\njux.element('h1', { id: 'welcome' })\n .text('Welcome to JUX!')\n .renderTo('app');\n`
|
|
48
49
|
);
|
|
49
50
|
console.log(' ✓ Created starter file');
|
|
50
51
|
}
|
|
@@ -120,9 +121,10 @@ function initProject() {
|
|
|
120
121
|
copyDirRecursive(templateDir, juxDir);
|
|
121
122
|
console.log(' ✓ Copied template files to ./jux');
|
|
122
123
|
} else {
|
|
124
|
+
// Updated to use jux namespace and renderTo
|
|
123
125
|
fs.writeFileSync(
|
|
124
126
|
path.join(juxDir, 'index.jux'),
|
|
125
|
-
`import {
|
|
127
|
+
`import { jux } from 'juxscript';\n\njux.element('h1', { id: 'welcome' })\n .text('Welcome to JUX!')\n .renderTo('app');\n`
|
|
126
128
|
);
|
|
127
129
|
console.log(' ✓ Created starter file');
|
|
128
130
|
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { alert } from './lib/components/alert.js';
|
|
2
|
+
import { app } from './lib/components/app.js';
|
|
3
|
+
import { badge } from './lib/components/badge.js';
|
|
4
|
+
import { button } from './lib/components/button.js';
|
|
5
|
+
import { card } from './lib/components/card.js';
|
|
6
|
+
import { chart } from './lib/components/chart.js';
|
|
7
|
+
import { checkbox } from './lib/components/checkbox.js';
|
|
8
|
+
import { code } from './lib/components/code.js';
|
|
9
|
+
import { container } from './lib/components/container.js';
|
|
10
|
+
import { data } from './lib/components/data.js';
|
|
11
|
+
import { datepicker } from './lib/components/datepicker.js';
|
|
12
|
+
import { dialog } from './lib/components/dialog.js';
|
|
13
|
+
import { divider } from './lib/components/divider.js';
|
|
14
|
+
import { dropdown } from './lib/components/dropdown.js';
|
|
15
|
+
import { element } from './lib/components/element.js';
|
|
16
|
+
import { fileupload } from './lib/components/fileupload.js';
|
|
17
|
+
import { grid } from './lib/components/grid.js';
|
|
18
|
+
import { guard } from './lib/components/guard.js';
|
|
19
|
+
import { heading } from './lib/components/heading.js';
|
|
20
|
+
import { getOrCreateContainer } from './lib/components/helpers.js';
|
|
21
|
+
import { hero } from './lib/components/hero.js';
|
|
22
|
+
import { icon } from './lib/components/icon.js';
|
|
23
|
+
import { include } from './lib/components/include.js';
|
|
24
|
+
import { input } from './lib/components/input.js';
|
|
25
|
+
import { list } from './lib/components/list.js';
|
|
26
|
+
import { loading } from './lib/components/loading.js';
|
|
27
|
+
import { menu } from './lib/components/menu.js';
|
|
28
|
+
import { modal } from './lib/components/modal.js';
|
|
29
|
+
import { nav } from './lib/components/nav.js';
|
|
30
|
+
import { paragraph } from './lib/components/paragraph.js';
|
|
31
|
+
import { progress } from './lib/components/progress.js';
|
|
32
|
+
import { radio } from './lib/components/radio.js';
|
|
33
|
+
import { script } from './lib/components/script.js';
|
|
34
|
+
import { select } from './lib/components/select.js';
|
|
35
|
+
import { sidebar } from './lib/components/sidebar.js';
|
|
36
|
+
import { style } from './lib/components/style.js';
|
|
37
|
+
import { switchComponent } from './lib/components/switch.js';
|
|
38
|
+
import { table } from './lib/components/table.js';
|
|
39
|
+
import { tabs } from './lib/components/tabs.js';
|
|
40
|
+
import { themeToggle } from './lib/components/theme-toggle.js';
|
|
41
|
+
import { tooltip } from './lib/components/tooltip.js';
|
|
42
|
+
import { view } from './lib/components/view.js';
|
|
43
|
+
import { write } from './lib/components/write.js';
|
|
44
|
+
import { renderIcon, renderEmoji } from './lib/components/icons.js';
|
|
45
|
+
export declare const jux: {
|
|
46
|
+
alert: typeof alert;
|
|
47
|
+
app: typeof app;
|
|
48
|
+
badge: typeof badge;
|
|
49
|
+
button: typeof button;
|
|
50
|
+
card: typeof card;
|
|
51
|
+
chart: typeof chart;
|
|
52
|
+
checkbox: typeof checkbox;
|
|
53
|
+
code: typeof code;
|
|
54
|
+
container: typeof container;
|
|
55
|
+
data: typeof data;
|
|
56
|
+
datepicker: typeof datepicker;
|
|
57
|
+
dialog: typeof dialog;
|
|
58
|
+
divider: typeof divider;
|
|
59
|
+
dropdown: typeof dropdown;
|
|
60
|
+
element: typeof element;
|
|
61
|
+
fileupload: typeof fileupload;
|
|
62
|
+
grid: typeof grid;
|
|
63
|
+
guard: typeof guard;
|
|
64
|
+
heading: typeof heading;
|
|
65
|
+
hero: typeof hero;
|
|
66
|
+
icon: typeof icon;
|
|
67
|
+
include: typeof include;
|
|
68
|
+
input: typeof input;
|
|
69
|
+
list: typeof list;
|
|
70
|
+
loading: typeof loading;
|
|
71
|
+
menu: typeof menu;
|
|
72
|
+
modal: typeof modal;
|
|
73
|
+
nav: typeof nav;
|
|
74
|
+
paragraph: typeof paragraph;
|
|
75
|
+
progress: typeof progress;
|
|
76
|
+
radio: typeof radio;
|
|
77
|
+
req: import("./lib/components/req.js").Req;
|
|
78
|
+
script: typeof script;
|
|
79
|
+
select: typeof select;
|
|
80
|
+
sidebar: typeof sidebar;
|
|
81
|
+
style: typeof style;
|
|
82
|
+
switch: typeof switchComponent;
|
|
83
|
+
table: typeof table;
|
|
84
|
+
tabs: typeof tabs;
|
|
85
|
+
themeToggle: typeof themeToggle;
|
|
86
|
+
tooltip: typeof tooltip;
|
|
87
|
+
view: typeof view;
|
|
88
|
+
write: typeof write;
|
|
89
|
+
fetch: typeof import("./lib/utils/fetch.js").juxFetch & {
|
|
90
|
+
all: typeof import("./lib/utils/fetch.js").fetchAll;
|
|
91
|
+
get: <T = any>(url: string, options?: Omit<import("./lib/utils/fetch.js").FetchOptions, "method">) => {
|
|
92
|
+
url: string;
|
|
93
|
+
options: import("./lib/utils/fetch.js").FetchOptions;
|
|
94
|
+
method(value: string): /*elided*/ any;
|
|
95
|
+
body(value: any): /*elided*/ any;
|
|
96
|
+
params(value: Record<string, any>): /*elided*/ any;
|
|
97
|
+
headers(value: Record<string, string>): /*elided*/ any;
|
|
98
|
+
header(key: string, value: string): /*elided*/ any;
|
|
99
|
+
timeout(value: number): /*elided*/ any;
|
|
100
|
+
credentials(value: RequestCredentials): /*elided*/ any;
|
|
101
|
+
log(value: import("./lib/utils/fetch.js").LogLevel): /*elided*/ any;
|
|
102
|
+
parseResponse(value: boolean): /*elided*/ any;
|
|
103
|
+
onUnauthorized(callback: () => void): /*elided*/ any;
|
|
104
|
+
onError(callback: (error: import("./lib/utils/fetch.js").FetchError) => void): /*elided*/ any;
|
|
105
|
+
send(): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
106
|
+
fetch(): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
107
|
+
then<TResult1 = import("./lib/utils/fetch.js").FetchResult<T>, TResult2 = never>(onfulfilled?: (value: import("./lib/utils/fetch.js").FetchResult<T>) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
|
|
108
|
+
catch<TResult = never>(onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<import("./lib/utils/fetch.js").FetchResult<T> | TResult>;
|
|
109
|
+
finally(onfinally?: (() => void) | null): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
110
|
+
};
|
|
111
|
+
post: <T = any>(url: string, body?: any, options?: Omit<import("./lib/utils/fetch.js").FetchOptions, "method" | "body">) => {
|
|
112
|
+
url: string;
|
|
113
|
+
options: import("./lib/utils/fetch.js").FetchOptions;
|
|
114
|
+
method(value: string): /*elided*/ any;
|
|
115
|
+
body(value: any): /*elided*/ any;
|
|
116
|
+
params(value: Record<string, any>): /*elided*/ any;
|
|
117
|
+
headers(value: Record<string, string>): /*elided*/ any;
|
|
118
|
+
header(key: string, value: string): /*elided*/ any;
|
|
119
|
+
timeout(value: number): /*elided*/ any;
|
|
120
|
+
credentials(value: RequestCredentials): /*elided*/ any;
|
|
121
|
+
log(value: import("./lib/utils/fetch.js").LogLevel): /*elided*/ any;
|
|
122
|
+
parseResponse(value: boolean): /*elided*/ any;
|
|
123
|
+
onUnauthorized(callback: () => void): /*elided*/ any;
|
|
124
|
+
onError(callback: (error: import("./lib/utils/fetch.js").FetchError) => void): /*elided*/ any;
|
|
125
|
+
send(): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
126
|
+
fetch(): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
127
|
+
then<TResult1 = import("./lib/utils/fetch.js").FetchResult<T>, TResult2 = never>(onfulfilled?: (value: import("./lib/utils/fetch.js").FetchResult<T>) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
|
|
128
|
+
catch<TResult = never>(onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<import("./lib/utils/fetch.js").FetchResult<T> | TResult>;
|
|
129
|
+
finally(onfinally?: (() => void) | null): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
130
|
+
};
|
|
131
|
+
put: <T = any>(url: string, body?: any, options?: Omit<import("./lib/utils/fetch.js").FetchOptions, "method" | "body">) => {
|
|
132
|
+
url: string;
|
|
133
|
+
options: import("./lib/utils/fetch.js").FetchOptions;
|
|
134
|
+
method(value: string): /*elided*/ any;
|
|
135
|
+
body(value: any): /*elided*/ any;
|
|
136
|
+
params(value: Record<string, any>): /*elided*/ any;
|
|
137
|
+
headers(value: Record<string, string>): /*elided*/ any;
|
|
138
|
+
header(key: string, value: string): /*elided*/ any;
|
|
139
|
+
timeout(value: number): /*elided*/ any;
|
|
140
|
+
credentials(value: RequestCredentials): /*elided*/ any;
|
|
141
|
+
log(value: import("./lib/utils/fetch.js").LogLevel): /*elided*/ any;
|
|
142
|
+
parseResponse(value: boolean): /*elided*/ any;
|
|
143
|
+
onUnauthorized(callback: () => void): /*elided*/ any;
|
|
144
|
+
onError(callback: (error: import("./lib/utils/fetch.js").FetchError) => void): /*elided*/ any;
|
|
145
|
+
send(): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
146
|
+
fetch(): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
147
|
+
then<TResult1 = import("./lib/utils/fetch.js").FetchResult<T>, TResult2 = never>(onfulfilled?: (value: import("./lib/utils/fetch.js").FetchResult<T>) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
|
|
148
|
+
catch<TResult = never>(onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<import("./lib/utils/fetch.js").FetchResult<T> | TResult>;
|
|
149
|
+
finally(onfinally?: (() => void) | null): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
150
|
+
};
|
|
151
|
+
patch: <T = any>(url: string, body?: any, options?: Omit<import("./lib/utils/fetch.js").FetchOptions, "method" | "body">) => {
|
|
152
|
+
url: string;
|
|
153
|
+
options: import("./lib/utils/fetch.js").FetchOptions;
|
|
154
|
+
method(value: string): /*elided*/ any;
|
|
155
|
+
body(value: any): /*elided*/ any;
|
|
156
|
+
params(value: Record<string, any>): /*elided*/ any;
|
|
157
|
+
headers(value: Record<string, string>): /*elided*/ any;
|
|
158
|
+
header(key: string, value: string): /*elided*/ any;
|
|
159
|
+
timeout(value: number): /*elided*/ any;
|
|
160
|
+
credentials(value: RequestCredentials): /*elided*/ any;
|
|
161
|
+
log(value: import("./lib/utils/fetch.js").LogLevel): /*elided*/ any;
|
|
162
|
+
parseResponse(value: boolean): /*elided*/ any;
|
|
163
|
+
onUnauthorized(callback: () => void): /*elided*/ any;
|
|
164
|
+
onError(callback: (error: import("./lib/utils/fetch.js").FetchError) => void): /*elided*/ any;
|
|
165
|
+
send(): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
166
|
+
fetch(): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
167
|
+
then<TResult1 = import("./lib/utils/fetch.js").FetchResult<T>, TResult2 = never>(onfulfilled?: (value: import("./lib/utils/fetch.js").FetchResult<T>) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
|
|
168
|
+
catch<TResult = never>(onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<import("./lib/utils/fetch.js").FetchResult<T> | TResult>;
|
|
169
|
+
finally(onfinally?: (() => void) | null): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
170
|
+
};
|
|
171
|
+
delete: <T = any>(url: string, options?: Omit<import("./lib/utils/fetch.js").FetchOptions, "method">) => {
|
|
172
|
+
url: string;
|
|
173
|
+
options: import("./lib/utils/fetch.js").FetchOptions;
|
|
174
|
+
method(value: string): /*elided*/ any;
|
|
175
|
+
body(value: any): /*elided*/ any;
|
|
176
|
+
params(value: Record<string, any>): /*elided*/ any;
|
|
177
|
+
headers(value: Record<string, string>): /*elided*/ any;
|
|
178
|
+
header(key: string, value: string): /*elided*/ any;
|
|
179
|
+
timeout(value: number): /*elided*/ any;
|
|
180
|
+
credentials(value: RequestCredentials): /*elided*/ any;
|
|
181
|
+
log(value: import("./lib/utils/fetch.js").LogLevel): /*elided*/ any;
|
|
182
|
+
parseResponse(value: boolean): /*elided*/ any;
|
|
183
|
+
onUnauthorized(callback: () => void): /*elided*/ any;
|
|
184
|
+
onError(callback: (error: import("./lib/utils/fetch.js").FetchError) => void): /*elided*/ any;
|
|
185
|
+
send(): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
186
|
+
fetch(): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
187
|
+
then<TResult1 = import("./lib/utils/fetch.js").FetchResult<T>, TResult2 = never>(onfulfilled?: (value: import("./lib/utils/fetch.js").FetchResult<T>) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
|
|
188
|
+
catch<TResult = never>(onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<import("./lib/utils/fetch.js").FetchResult<T> | TResult>;
|
|
189
|
+
finally(onfinally?: (() => void) | null): Promise<import("./lib/utils/fetch.js").FetchResult<T>>;
|
|
190
|
+
};
|
|
191
|
+
config: typeof import("./lib/utils/fetch.js").configureFetch;
|
|
192
|
+
setupConfig: typeof import("./lib/utils/fetch.js").setupConfig;
|
|
193
|
+
getServiceUrl: typeof import("./lib/utils/fetch.js").getServiceUrl;
|
|
194
|
+
serviceClient: typeof import("./lib/utils/fetch.js").serviceClient;
|
|
195
|
+
};
|
|
196
|
+
renderIcon: typeof renderIcon;
|
|
197
|
+
renderEmoji: typeof renderEmoji;
|
|
198
|
+
getOrCreateContainer: typeof getOrCreateContainer;
|
|
199
|
+
};
|
|
200
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -1,22 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { alert } from './lib/components/alert.js';
|
|
2
|
+
import { app } from './lib/components/app.js';
|
|
3
|
+
import { badge } from './lib/components/badge.js';
|
|
4
|
+
import { button } from './lib/components/button.js';
|
|
5
|
+
import { card } from './lib/components/card.js';
|
|
6
|
+
import { chart } from './lib/components/chart.js';
|
|
7
|
+
import { checkbox } from './lib/components/checkbox.js';
|
|
8
|
+
import { code } from './lib/components/code.js';
|
|
9
|
+
import { container } from './lib/components/container.js';
|
|
10
|
+
import { data } from './lib/components/data.js';
|
|
11
|
+
import { datepicker } from './lib/components/datepicker.js';
|
|
12
|
+
import { dialog } from './lib/components/dialog.js';
|
|
13
|
+
import { divider } from './lib/components/divider.js';
|
|
14
|
+
import { dropdown } from './lib/components/dropdown.js';
|
|
15
|
+
import { element } from './lib/components/element.js';
|
|
16
|
+
import { fileupload } from './lib/components/fileupload.js';
|
|
17
|
+
import { grid } from './lib/components/grid.js';
|
|
18
|
+
import { guard } from './lib/components/guard.js';
|
|
19
|
+
import { heading } from './lib/components/heading.js';
|
|
20
|
+
import { getOrCreateContainer } from './lib/components/helpers.js';
|
|
21
|
+
import { hero } from './lib/components/hero.js';
|
|
22
|
+
import { icon } from './lib/components/icon.js';
|
|
23
|
+
import { include } from './lib/components/include.js';
|
|
24
|
+
import { input } from './lib/components/input.js';
|
|
25
|
+
import { list } from './lib/components/list.js';
|
|
26
|
+
import { loading } from './lib/components/loading.js';
|
|
27
|
+
import { menu } from './lib/components/menu.js';
|
|
28
|
+
import { modal } from './lib/components/modal.js';
|
|
29
|
+
import { nav } from './lib/components/nav.js';
|
|
30
|
+
import { paragraph } from './lib/components/paragraph.js';
|
|
31
|
+
import { progress } from './lib/components/progress.js';
|
|
32
|
+
import { radio } from './lib/components/radio.js';
|
|
33
|
+
import { req } from './lib/components/req.js';
|
|
34
|
+
import { script } from './lib/components/script.js';
|
|
35
|
+
import { select } from './lib/components/select.js';
|
|
36
|
+
import { sidebar } from './lib/components/sidebar.js';
|
|
37
|
+
import { style } from './lib/components/style.js';
|
|
38
|
+
import { switchComponent } from './lib/components/switch.js';
|
|
39
|
+
import { table } from './lib/components/table.js';
|
|
40
|
+
import { tabs } from './lib/components/tabs.js';
|
|
41
|
+
import { themeToggle } from './lib/components/theme-toggle.js';
|
|
42
|
+
import { tooltip } from './lib/components/tooltip.js';
|
|
43
|
+
import { view } from './lib/components/view.js';
|
|
44
|
+
import { write } from './lib/components/write.js';
|
|
45
|
+
import { fetchAPI } from './lib/utils/fetch.js';
|
|
46
|
+
import { renderIcon, renderEmoji } from './lib/components/icons.js';
|
|
47
|
+
export const jux = {
|
|
48
|
+
alert,
|
|
49
|
+
app,
|
|
50
|
+
badge,
|
|
51
|
+
button,
|
|
52
|
+
card,
|
|
53
|
+
chart,
|
|
54
|
+
checkbox,
|
|
55
|
+
code,
|
|
56
|
+
container,
|
|
57
|
+
data,
|
|
58
|
+
datepicker,
|
|
59
|
+
dialog,
|
|
60
|
+
divider,
|
|
61
|
+
dropdown,
|
|
62
|
+
element,
|
|
63
|
+
fileupload,
|
|
64
|
+
grid,
|
|
65
|
+
guard,
|
|
66
|
+
heading,
|
|
67
|
+
hero,
|
|
68
|
+
icon,
|
|
69
|
+
include,
|
|
70
|
+
input,
|
|
71
|
+
list,
|
|
72
|
+
loading,
|
|
73
|
+
menu,
|
|
74
|
+
modal,
|
|
75
|
+
nav,
|
|
76
|
+
paragraph,
|
|
77
|
+
progress,
|
|
78
|
+
radio,
|
|
79
|
+
req,
|
|
80
|
+
script,
|
|
81
|
+
select,
|
|
82
|
+
sidebar,
|
|
83
|
+
style,
|
|
84
|
+
switch: switchComponent,
|
|
85
|
+
table,
|
|
86
|
+
tabs,
|
|
87
|
+
themeToggle,
|
|
88
|
+
tooltip,
|
|
89
|
+
view,
|
|
90
|
+
write,
|
|
91
|
+
// Utilities
|
|
92
|
+
fetch: fetchAPI,
|
|
93
|
+
renderIcon,
|
|
94
|
+
renderEmoji,
|
|
95
|
+
getOrCreateContainer
|
|
96
|
+
};
|
package/juxconfig.example.js
CHANGED
|
@@ -1,76 +1,71 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* JUX
|
|
3
|
-
*
|
|
2
|
+
* JUX Configuration File
|
|
3
|
+
*
|
|
4
|
+
* This file is optional. JUX works out-of-the-box with sensible defaults.
|
|
5
|
+
* Customize only if you need to change default behavior.
|
|
6
|
+
*
|
|
7
|
+
* Copy this file to your project root as 'juxconfig.js' to customize.
|
|
4
8
|
*/
|
|
5
9
|
|
|
6
|
-
|
|
10
|
+
// Route overrides
|
|
11
|
+
export const routeOverrides = {
|
|
12
|
+
// 'about': '/about-us',
|
|
13
|
+
}
|
|
7
14
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
15
|
+
export default {
|
|
16
|
+
// Application settings
|
|
17
|
+
appName: 'My JUX App',
|
|
18
|
+
autoRoutes: true,
|
|
19
|
+
// Directories
|
|
20
|
+
sourceDir: 'jux',
|
|
21
|
+
distDir: '.jux-dist',
|
|
16
22
|
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
// External services - used by jux.fetch and jux.fetch.serviceClient()
|
|
24
|
+
// Each service becomes available as a baseUrl for fetch requests
|
|
25
|
+
//
|
|
26
|
+
// Usage in components:
|
|
27
|
+
// const db = jux.fetch.serviceClient('database');
|
|
28
|
+
// const { data } = await db.fetch('/users').send();
|
|
29
|
+
//
|
|
30
|
+
// // Or directly:
|
|
31
|
+
// const { data } = await jux.fetch('/users')
|
|
32
|
+
// .header('Authorization', 'Bearer token')
|
|
33
|
+
// .send();
|
|
34
|
+
services: {
|
|
35
|
+
database: 'http://localhost:4000/api/db',
|
|
36
|
+
auth: 'http://localhost:4000/api/auth',
|
|
37
|
+
monday: 'http://api.rxtrail.monday.com/api/'
|
|
24
38
|
},
|
|
25
39
|
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// 2. Public Group: Shared settings for public pages
|
|
33
|
-
docs: {
|
|
34
|
-
prefix: '/docs', // URL Prefix
|
|
35
|
-
layout: "base_docs.jux", // Shared Layout
|
|
36
|
-
theme: "base.css", // Shared Theme
|
|
37
|
-
|
|
38
|
-
// Explicit Route Map
|
|
39
|
-
routes: {
|
|
40
|
-
'/login': '/experiments/login.jux' // Results in /login/
|
|
41
|
-
}
|
|
42
|
-
},
|
|
40
|
+
// Dev server ports
|
|
41
|
+
ports: {
|
|
42
|
+
http: 3000,
|
|
43
|
+
ws: 3001
|
|
44
|
+
},
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
layout: 'dashboard_layout.jux',
|
|
48
|
-
theme: 'dashboard.css',
|
|
46
|
+
// Fetch configuration
|
|
47
|
+
fetchTimeout: 30000, // milliseconds
|
|
48
|
+
fetchLog: false, // true, false, or 'errors' for error-only logging
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
50
|
+
// Build options
|
|
51
|
+
build: {
|
|
52
|
+
minify: false,
|
|
53
|
+
sourcemap: true
|
|
55
54
|
},
|
|
56
55
|
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// Functions to run after the build completes but before the server starts.
|
|
66
|
-
// Useful for post-processing assets, sitemap generation, etc.
|
|
67
|
-
postcompile: [
|
|
68
|
-
// roadmap 2026
|
|
69
|
-
],
|
|
56
|
+
// Bootstrap functions (run on startup)
|
|
57
|
+
// Perfect place to initialize services and auth
|
|
58
|
+
bootstrap: [
|
|
59
|
+
// Example: Setup fetch with service configuration
|
|
60
|
+
// async function initFetch() {
|
|
61
|
+
// await jux.fetch.setupConfig();
|
|
62
|
+
// console.log('✅ Fetch configured');
|
|
63
|
+
// },
|
|
70
64
|
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
// Example: Initialize authentication
|
|
66
|
+
// async function initAuth() {
|
|
67
|
+
// console.log('🔐 Initializing auth...');
|
|
68
|
+
// },
|
|
69
|
+
]
|
|
76
70
|
};
|
|
71
|
+
|