juxscript 1.1.13 → 1.1.15
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/index.d.ts +0 -2
- package/index.d.ts.map +1 -1
- package/index.js +0 -2
- package/lib/components/alert.d.ts +4 -0
- package/lib/components/alert.d.ts.map +1 -1
- package/lib/components/alert.js +19 -0
- package/lib/components/alert.ts +19 -0
- package/lib/components/badge.d.ts +3 -4
- package/lib/components/badge.d.ts.map +1 -1
- package/lib/components/badge.js +20 -0
- package/lib/components/badge.ts +20 -4
- package/lib/components/base/BaseComponent.d.ts +35 -6
- package/lib/components/base/BaseComponent.d.ts.map +1 -1
- package/lib/components/base/BaseComponent.js +20 -49
- package/lib/components/base/BaseComponent.ts +59 -48
- package/lib/components/base/FormInput.d.ts +4 -0
- package/lib/components/base/FormInput.d.ts.map +1 -1
- package/lib/components/base/FormInput.js +6 -0
- package/lib/components/base/FormInput.ts +7 -0
- package/lib/components/button.d.ts +1 -0
- package/lib/components/button.d.ts.map +1 -1
- package/lib/components/button.js +3 -0
- package/lib/components/button.ts +4 -0
- package/lib/components/card.d.ts +1 -0
- package/lib/components/card.d.ts.map +1 -1
- package/lib/components/card.js +3 -0
- package/lib/components/card.ts +4 -0
- package/lib/components/chart.d.ts +1 -0
- package/lib/components/chart.d.ts.map +1 -1
- package/lib/components/chart.js +3 -0
- package/lib/components/chart.ts +4 -0
- package/lib/components/code.d.ts +1 -0
- package/lib/components/code.d.ts.map +1 -1
- package/lib/components/code.js +3 -0
- package/lib/components/code.ts +4 -0
- package/lib/components/container.d.ts +1 -0
- package/lib/components/container.d.ts.map +1 -1
- package/lib/components/container.js +3 -0
- package/lib/components/container.ts +4 -0
- package/lib/components/dialog.d.ts +1 -0
- package/lib/components/dialog.d.ts.map +1 -1
- package/lib/components/dialog.js +3 -0
- package/lib/components/dialog.ts +4 -0
- package/lib/components/divider.d.ts +1 -0
- package/lib/components/divider.d.ts.map +1 -1
- package/lib/components/divider.js +3 -0
- package/lib/components/divider.ts +4 -0
- package/lib/components/dropdown.d.ts +1 -0
- package/lib/components/dropdown.d.ts.map +1 -1
- package/lib/components/dropdown.js +3 -0
- package/lib/components/dropdown.ts +4 -0
- package/lib/components/element.d.ts +1 -0
- package/lib/components/element.d.ts.map +1 -1
- package/lib/components/element.js +3 -0
- package/lib/components/element.ts +4 -0
- package/lib/components/grid.d.ts +1 -0
- package/lib/components/grid.d.ts.map +1 -1
- package/lib/components/grid.js +3 -0
- package/lib/components/grid.ts +4 -0
- package/lib/components/heading.d.ts +1 -0
- package/lib/components/heading.d.ts.map +1 -1
- package/lib/components/heading.js +3 -0
- package/lib/components/heading.ts +4 -0
- package/lib/components/hero.d.ts +3 -5
- package/lib/components/hero.d.ts.map +1 -1
- package/lib/components/hero.js +1 -1
- package/lib/components/hero.ts +4 -6
- package/lib/components/icon.d.ts +1 -0
- package/lib/components/icon.d.ts.map +1 -1
- package/lib/components/icon.js +3 -0
- package/lib/components/icon.ts +4 -0
- package/lib/components/list.d.ts +1 -0
- package/lib/components/list.d.ts.map +1 -1
- package/lib/components/list.js +3 -0
- package/lib/components/list.ts +4 -0
- package/lib/components/loading.d.ts +1 -0
- package/lib/components/loading.d.ts.map +1 -1
- package/lib/components/loading.js +3 -0
- package/lib/components/loading.ts +4 -0
- package/lib/components/menu.d.ts +1 -0
- package/lib/components/menu.d.ts.map +1 -1
- package/lib/components/menu.js +3 -0
- package/lib/components/menu.ts +4 -0
- package/lib/components/modal.d.ts +1 -0
- package/lib/components/modal.d.ts.map +1 -1
- package/lib/components/modal.js +3 -0
- package/lib/components/modal.ts +4 -0
- package/lib/components/nav.d.ts +1 -0
- package/lib/components/nav.d.ts.map +1 -1
- package/lib/components/nav.js +3 -0
- package/lib/components/nav.ts +4 -0
- package/lib/components/paragraph.d.ts +1 -0
- package/lib/components/paragraph.d.ts.map +1 -1
- package/lib/components/paragraph.js +3 -0
- package/lib/components/paragraph.ts +4 -0
- package/lib/components/progress.d.ts +1 -0
- package/lib/components/progress.d.ts.map +1 -1
- package/lib/components/progress.js +3 -0
- package/lib/components/progress.ts +4 -0
- package/lib/components/sidebar.d.ts +25 -14
- package/lib/components/sidebar.d.ts.map +1 -1
- package/lib/components/sidebar.js +186 -88
- package/lib/components/sidebar.ts +231 -104
- package/lib/components/table.d.ts +1 -0
- package/lib/components/table.d.ts.map +1 -1
- package/lib/components/table.js +3 -0
- package/lib/components/table.ts +4 -0
- package/lib/components/tabs.d.ts +1 -0
- package/lib/components/tabs.d.ts.map +1 -1
- package/lib/components/tabs.js +3 -0
- package/lib/components/tabs.ts +4 -0
- package/lib/components/theme-toggle.d.ts +1 -0
- package/lib/components/theme-toggle.d.ts.map +1 -1
- package/lib/components/theme-toggle.js +3 -0
- package/lib/components/theme-toggle.ts +4 -0
- package/lib/components/tooltip.d.ts +1 -0
- package/lib/components/tooltip.d.ts.map +1 -1
- package/lib/components/tooltip.js +3 -0
- package/lib/components/tooltip.ts +4 -0
- package/package.json +1 -1
- package/lib/components/guard.d.ts +0 -41
- package/lib/components/guard.d.ts.map +0 -1
- package/lib/components/guard.js +0 -56
- package/lib/components/guard.ts +0 -92
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { BaseComponent } from './base/BaseComponent.js';
|
|
2
|
-
import { State } from '../reactivity/state.js';
|
|
3
|
-
declare global {
|
|
4
|
-
interface Window {
|
|
5
|
-
juxBeforeNavigate?: (from: string, to: string) => boolean | string;
|
|
6
|
-
juxAfterNavigate?: (path: string) => void;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export interface GuardOptions {
|
|
10
|
-
authState?: State<boolean>;
|
|
11
|
-
loginPath?: string;
|
|
12
|
-
protectedPaths?: string[];
|
|
13
|
-
}
|
|
14
|
-
type GuardState = {
|
|
15
|
-
authState: State<boolean> | null;
|
|
16
|
-
loginPath: string;
|
|
17
|
-
protectedPaths: string[];
|
|
18
|
-
isActive: boolean;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* ⚠️ DEPRECATED: Guard component is no longer supported after removing global middleware.
|
|
22
|
-
*
|
|
23
|
-
* Recommended alternatives:
|
|
24
|
-
* 1. Server-side authentication (Express, FastAPI, Laravel)
|
|
25
|
-
* 2. Manual route checks in each view
|
|
26
|
-
* 3. Custom wrapper components
|
|
27
|
-
*
|
|
28
|
-
* This component will be removed in a future version.
|
|
29
|
-
*/
|
|
30
|
-
export declare class Guard extends BaseComponent<GuardState> {
|
|
31
|
-
constructor(id: string, options?: GuardOptions);
|
|
32
|
-
protected getTriggerEvents(): readonly string[];
|
|
33
|
-
protected getCallbackEvents(): readonly string[];
|
|
34
|
-
requireAuth(authState: State<boolean>, loginPath?: string): this;
|
|
35
|
-
protect(...paths: string[]): this;
|
|
36
|
-
render(targetId?: string): this;
|
|
37
|
-
deactivate(): this;
|
|
38
|
-
}
|
|
39
|
-
export declare function guard(id: string, options?: GuardOptions): Guard;
|
|
40
|
-
export {};
|
|
41
|
-
//# sourceMappingURL=guard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG/C,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CAAC;QACnE,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;KAC7C;CACJ;AAMD,MAAM,WAAW,YAAY;IACzB,SAAS,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,KAAK,UAAU,GAAG;IACd,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;;;;;;;;GASG;AACH,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAAU,CAAC;gBACpC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;IAclD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAQhD,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAKhE,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IASjC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAK/B,UAAU,IAAI,IAAI;CAGrB;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,KAAK,CAE/D"}
|
package/lib/components/guard.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { BaseComponent } from './base/BaseComponent.js';
|
|
2
|
-
// Event definitions
|
|
3
|
-
const TRIGGER_EVENTS = [];
|
|
4
|
-
const CALLBACK_EVENTS = ['blocked', 'allowed'];
|
|
5
|
-
/**
|
|
6
|
-
* ⚠️ DEPRECATED: Guard component is no longer supported after removing global middleware.
|
|
7
|
-
*
|
|
8
|
-
* Recommended alternatives:
|
|
9
|
-
* 1. Server-side authentication (Express, FastAPI, Laravel)
|
|
10
|
-
* 2. Manual route checks in each view
|
|
11
|
-
* 3. Custom wrapper components
|
|
12
|
-
*
|
|
13
|
-
* This component will be removed in a future version.
|
|
14
|
-
*/
|
|
15
|
-
export class Guard extends BaseComponent {
|
|
16
|
-
constructor(id, options = {}) {
|
|
17
|
-
super(id, {
|
|
18
|
-
authState: options.authState ?? null,
|
|
19
|
-
loginPath: options.loginPath ?? '/login',
|
|
20
|
-
protectedPaths: options.protectedPaths ?? [],
|
|
21
|
-
isActive: false
|
|
22
|
-
});
|
|
23
|
-
console.warn('[Jux Guard] DEPRECATED: Guard component no longer supported after middleware removal.\n' +
|
|
24
|
-
'Use server-side auth or manual checks instead.');
|
|
25
|
-
}
|
|
26
|
-
getTriggerEvents() {
|
|
27
|
-
return TRIGGER_EVENTS;
|
|
28
|
-
}
|
|
29
|
-
getCallbackEvents() {
|
|
30
|
-
return CALLBACK_EVENTS;
|
|
31
|
-
}
|
|
32
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
33
|
-
* FLUENT API (No-ops now)
|
|
34
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
35
|
-
requireAuth(authState, loginPath) {
|
|
36
|
-
console.warn('[Jux Guard] DEPRECATED: requireAuth() has no effect');
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
protect(...paths) {
|
|
40
|
-
console.warn('[Jux Guard] DEPRECATED: protect() has no effect');
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
44
|
-
* RENDER (No-op)
|
|
45
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
46
|
-
render(targetId) {
|
|
47
|
-
console.warn('[Jux Guard] DEPRECATED: Guard rendering has no effect');
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
deactivate() {
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
export function guard(id, options) {
|
|
55
|
-
return new Guard(id, options);
|
|
56
|
-
}
|
package/lib/components/guard.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { BaseComponent } from './base/BaseComponent.js';
|
|
2
|
-
import { State } from '../reactivity/state.js';
|
|
3
|
-
|
|
4
|
-
// Extend Window interface to include Jux navigation hooks
|
|
5
|
-
declare global {
|
|
6
|
-
interface Window {
|
|
7
|
-
juxBeforeNavigate?: (from: string, to: string) => boolean | string;
|
|
8
|
-
juxAfterNavigate?: (path: string) => void;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Event definitions
|
|
13
|
-
const TRIGGER_EVENTS = [] as const;
|
|
14
|
-
const CALLBACK_EVENTS = ['blocked', 'allowed'] as const;
|
|
15
|
-
|
|
16
|
-
export interface GuardOptions {
|
|
17
|
-
authState?: State<boolean>; // Check if user is authenticated
|
|
18
|
-
loginPath?: string; // Where to redirect if blocked
|
|
19
|
-
protectedPaths?: string[]; // Paths that require auth
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
type GuardState = {
|
|
23
|
-
authState: State<boolean> | null;
|
|
24
|
-
loginPath: string;
|
|
25
|
-
protectedPaths: string[];
|
|
26
|
-
isActive: boolean;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* ⚠️ DEPRECATED: Guard component is no longer supported after removing global middleware.
|
|
31
|
-
*
|
|
32
|
-
* Recommended alternatives:
|
|
33
|
-
* 1. Server-side authentication (Express, FastAPI, Laravel)
|
|
34
|
-
* 2. Manual route checks in each view
|
|
35
|
-
* 3. Custom wrapper components
|
|
36
|
-
*
|
|
37
|
-
* This component will be removed in a future version.
|
|
38
|
-
*/
|
|
39
|
-
export class Guard extends BaseComponent<GuardState> {
|
|
40
|
-
constructor(id: string, options: GuardOptions = {}) {
|
|
41
|
-
super(id, {
|
|
42
|
-
authState: options.authState ?? null,
|
|
43
|
-
loginPath: options.loginPath ?? '/login',
|
|
44
|
-
protectedPaths: options.protectedPaths ?? [],
|
|
45
|
-
isActive: false
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
console.warn(
|
|
49
|
-
'[Jux Guard] DEPRECATED: Guard component no longer supported after middleware removal.\n' +
|
|
50
|
-
'Use server-side auth or manual checks instead.'
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
protected getTriggerEvents(): readonly string[] {
|
|
55
|
-
return TRIGGER_EVENTS;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
protected getCallbackEvents(): readonly string[] {
|
|
59
|
-
return CALLBACK_EVENTS;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
63
|
-
* FLUENT API (No-ops now)
|
|
64
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
65
|
-
|
|
66
|
-
requireAuth(authState: State<boolean>, loginPath?: string): this {
|
|
67
|
-
console.warn('[Jux Guard] DEPRECATED: requireAuth() has no effect');
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
protect(...paths: string[]): this {
|
|
72
|
-
console.warn('[Jux Guard] DEPRECATED: protect() has no effect');
|
|
73
|
-
return this;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
77
|
-
* RENDER (No-op)
|
|
78
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
79
|
-
|
|
80
|
-
render(targetId?: string): this {
|
|
81
|
-
console.warn('[Jux Guard] DEPRECATED: Guard rendering has no effect');
|
|
82
|
-
return this;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
deactivate(): this {
|
|
86
|
-
return this;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export function guard(id: string, options?: GuardOptions): Guard {
|
|
91
|
-
return new Guard(id, options);
|
|
92
|
-
}
|