juxscript 1.0.86 → 1.0.87

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 (48) hide show
  1. package/lib/componentsv2/base/BaseEngine.d.ts +102 -0
  2. package/lib/componentsv2/base/BaseEngine.d.ts.map +1 -0
  3. package/lib/componentsv2/base/BaseSkin.d.ts +54 -0
  4. package/lib/componentsv2/base/BaseSkin.d.ts.map +1 -0
  5. package/lib/componentsv2/base/GlobalBus.d.ts +22 -0
  6. package/lib/componentsv2/base/GlobalBus.d.ts.map +1 -0
  7. package/lib/componentsv2/base/State.d.ts +18 -0
  8. package/lib/componentsv2/base/State.d.ts.map +1 -0
  9. package/lib/componentsv2/element/component.d.ts +7 -0
  10. package/lib/componentsv2/element/component.d.ts.map +1 -0
  11. package/lib/componentsv2/element/engine.d.ts +43 -0
  12. package/lib/componentsv2/element/engine.d.ts.map +1 -0
  13. package/lib/componentsv2/element/skin.d.ts +10 -0
  14. package/lib/componentsv2/element/skin.d.ts.map +1 -0
  15. package/lib/componentsv2/grid/component.d.ts +14 -0
  16. package/lib/componentsv2/grid/component.d.ts.map +1 -0
  17. package/lib/componentsv2/grid/engine.d.ts +40 -0
  18. package/lib/componentsv2/grid/engine.d.ts.map +1 -0
  19. package/lib/componentsv2/grid/skin.d.ts +11 -0
  20. package/lib/componentsv2/grid/skin.d.ts.map +1 -0
  21. package/lib/componentsv2/index.d.ts +32 -0
  22. package/lib/componentsv2/index.d.ts.map +1 -0
  23. package/lib/componentsv2/input/component.d.ts +6 -0
  24. package/lib/componentsv2/input/component.d.ts.map +1 -0
  25. package/lib/componentsv2/input/engine.d.ts +27 -0
  26. package/lib/componentsv2/input/engine.d.ts.map +1 -0
  27. package/lib/componentsv2/input/skin.d.ts +11 -0
  28. package/lib/componentsv2/input/skin.d.ts.map +1 -0
  29. package/lib/componentsv2/list/component.d.ts +27 -0
  30. package/lib/componentsv2/list/component.d.ts.map +1 -0
  31. package/lib/componentsv2/list/engine.d.ts +69 -0
  32. package/lib/componentsv2/list/engine.d.ts.map +1 -0
  33. package/lib/componentsv2/list/skin.d.ts +20 -0
  34. package/lib/componentsv2/list/skin.d.ts.map +1 -0
  35. package/lib/componentsv2/plugins/ClientSQLitePlugin.d.ts +21 -0
  36. package/lib/componentsv2/plugins/ClientSQLitePlugin.d.ts.map +1 -0
  37. package/lib/componentsv2/plugins/IndexedDBPlugin.d.ts +18 -0
  38. package/lib/componentsv2/plugins/IndexedDBPlugin.d.ts.map +1 -0
  39. package/lib/componentsv2/plugins/LocalStoragePlugin.d.ts +20 -0
  40. package/lib/componentsv2/plugins/LocalStoragePlugin.d.ts.map +1 -0
  41. package/lib/componentsv2/plugins/ServerSQLitePlugin.d.ts +25 -0
  42. package/lib/componentsv2/plugins/ServerSQLitePlugin.d.ts.map +1 -0
  43. package/lib/globals.d.ts +5 -21
  44. package/lib/utils/fetch.d.ts +176 -0
  45. package/lib/utils/fetch.d.ts.map +1 -0
  46. package/package.json +2 -4
  47. package/types/css.d.ts +0 -4
  48. package/types/globals.d.ts +0 -16
@@ -0,0 +1,102 @@
1
+ export interface JuxServiceContract<TEngine = any> {
2
+ name: string;
3
+ version?: string;
4
+ targetEnv?: 'client' | 'server' | 'universal';
5
+ install: (engine: TEngine) => void;
6
+ uninstall?: (engine: TEngine) => void;
7
+ }
8
+ export interface BaseState {
9
+ id: string;
10
+ classes: string[];
11
+ visible: boolean;
12
+ disabled: boolean;
13
+ loading: boolean;
14
+ attributes: Record<string, string>;
15
+ }
16
+ type EventListener<T = any> = (data: T) => void;
17
+ /**
18
+ * THE ENGINE AGREEMENT
19
+ *
20
+ * 1. Must define State and Options types.
21
+ * 2. Must implement `prepareState` to map Options -> Initial State.
22
+ * 3. Provides reactivity, eventing, and plugin systems out of the box.
23
+ */
24
+ export declare abstract class BaseEngine<TState extends BaseState, TOptions = any> {
25
+ #private;
26
+ constructor(id: string, options: TOptions);
27
+ /**
28
+ * CONTRACT: Must transform input options into the initial State.
29
+ * This separates "mapping logic" from "construction/startup logic".
30
+ */
31
+ protected abstract prepareState(id: string, options: TOptions): TState;
32
+ get state(): TState;
33
+ subscribe(callback: (value: TState) => void): () => void;
34
+ /**
35
+ * Enable/Disable Active Console Logging
36
+ */
37
+ debug(enabled?: boolean): this;
38
+ protected updateState(patch: Partial<TState>): void;
39
+ /**
40
+ * Revert the state to the previous snapshot
41
+ */
42
+ rollback(): this;
43
+ /**
44
+ * Redo the previously rolled-back state
45
+ */
46
+ rollforward(): this;
47
+ /**
48
+ * Local Subscription: Subscribe to a specific named event on THIS instance.
49
+ */
50
+ on<T = any>(event: string, callback: EventListener<T>): this;
51
+ /**
52
+ * Unsubscribe from a local event.
53
+ */
54
+ off<T = any>(event: string, callback: EventListener<T>): this;
55
+ /**
56
+ * THE LISTENER (Neighborhood Watch)
57
+ * Listen for events broadcasting on the global frequency.
58
+ * @param channel The global channel name (e.g. 'demo-list-v2:move')
59
+ * @param callback Reaction logic
60
+ */
61
+ listenTo<T = any>(channel: string, callback: EventListener<T>): this;
62
+ /**
63
+ * Cleanup all global listeners attached by this engine.
64
+ */
65
+ dispose(): void;
66
+ /**
67
+ * BROADCASTER
68
+ * Emits locally AND to the global neighborhood.
69
+ */
70
+ protected emit(event: string, data: any): void;
71
+ /**
72
+ * DEBUG: Access the Global Event Bus registry to see active channels and listener identities.
73
+ * Useful for debugging communication topology from the console.
74
+ */
75
+ get eventRegistry(): Record<string, string[]>;
76
+ /**
77
+ * DEBUG: Access the Internal State Ledger (History).
78
+ * Returns an array of JSON strings representing past states.
79
+ */
80
+ get stateHistory(): string[];
81
+ /**
82
+ * DEBUG: Access the Event Emission Ledger.
83
+ */
84
+ get emitHistory(): string[];
85
+ /**
86
+ * Inject a Service/Plugin into this Engine.
87
+ * @param plugin A contract object { name, install, uninstall? }
88
+ */
89
+ addPlugin(plugin: JuxServiceContract<this>): this;
90
+ /**
91
+ * Remove a plugin and run its teardown logic.
92
+ */
93
+ removePlugin(name: string): this;
94
+ addClass(className: string): this;
95
+ removeClass(className: string): this;
96
+ visible(isVisible: boolean): this;
97
+ disable(isDisabled?: boolean): this;
98
+ loading(isLoading?: boolean): this;
99
+ attr(key: string, value: string): this;
100
+ }
101
+ export {};
102
+ //# sourceMappingURL=BaseEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseEngine.d.ts","sourceRoot":"","sources":["BaseEngine.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB,CAAC,OAAO,GAAG,GAAG;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC9C,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,KAAK,aAAa,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAEhD;;;;;;GAMG;AACH,8BAAsB,UAAU,CAAC,MAAM,SAAS,SAAS,EAAE,QAAQ,GAAG,GAAG;;gBAQzD,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ;IAMzC;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM;IAEtE,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,SAAS,CAAC,QAAQ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ASpC,OAAO,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI;IAMjC,OAAO,CAAC,UAAU,GAAE,OAAc,GAAG,IAAI;IAMzC,OAAO,CAAC,SAAS,GAAE,OAAc,GAAG,IAAI;IAMxC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAQzC"}
@@ -0,0 +1,54 @@
1
+ import { BaseEngine, BaseState } from './BaseEngine.js';
2
+ /**
3
+ * THE SKIN AGREEMENT
4
+ *
5
+ * A Skin must:
6
+ * 1. Hold a reference to its Engine.
7
+ * 2. Implement `structureCss` to provide layout styles.
8
+ * 3. Implement hooks for creation (`createRoot`) and event binding (`bindEvents`).
9
+ * 4. Implement `updateSkin(state)` to react to State changes.
10
+ */
11
+ export declare abstract class BaseSkin<TState extends BaseState, TEngine extends BaseEngine<TState>> {
12
+ protected engine: TEngine;
13
+ protected root: HTMLElement | null;
14
+ constructor(engine: TEngine);
15
+ /**
16
+ * CONTRACT: Provide the URL/Path to the structural CSS file.
17
+ *
18
+ * 💡 WHY `import.meta.url`?
19
+ * Standard `import` statements load JS modules. To load ASSETS (like CSS) at runtime,
20
+ * we need their full URL. `import.meta.url` tells the browser "Start looking from THIS file".
21
+ *
22
+ * Usage: return new URL('./structure.css', import.meta.url).href;
23
+ */
24
+ protected abstract get structureCss(): string;
25
+ /**
26
+ * Utility: Inject or Update a CSS Link tag in the document head.
27
+ * Allows for external CSS files ('references') and runtime Theme Swapping.
28
+ * @param id Unique ID for the link tag
29
+ * @param href The URL to the CSS file
30
+ */
31
+ injectCSSLink(id: string, href: string): void;
32
+ /**
33
+ * Utility: Inject CSS into the document head if not already present.
34
+ * Useful for Skins to seamlessly load their required aesthetics.
35
+ */
36
+ /**
37
+ * API: Hot-Swap the Aesthetic Skin.
38
+ * Replaces the component-specific CSS styles at runtime.
39
+ */
40
+ setTheme(cssContent: string): void;
41
+ /**
42
+ * Template Method: Render
43
+ * Orchestrates the standard lifecycle: Create -> Bind -> Mount -> Subscribe.
44
+ */
45
+ renderSkin(targetElement: HTMLElement, mode?: 'append' | 'prepend'): void;
46
+ protected createRoot(): HTMLElement;
47
+ protected abstract bindEvents(root: HTMLElement): void;
48
+ protected abstract updateSkin(state: TState): void;
49
+ /**
50
+ * HELPER: Applies universal Jux behavior (visibility, ID, disabled)
51
+ */
52
+ protected applySkinAttributes(element: HTMLElement, state: TState): void;
53
+ }
54
+ //# sourceMappingURL=BaseSkin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseSkin.d.ts","sourceRoot":"","sources":["BaseSkin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAExD;;;;;;;;GAQG;AACH,8BAAsB,QAAQ,CAAC,MAAM,SAAS,SAAS,EAAE,OAAO,SAAS,UAAU,CAAC,MAAM,CAAC;IACvF,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAQ;gBAE9B,MAAM,EAAE,OAAO;IAI3B;;;;;;;;MAQE;IACF,SAAS,CAAC,QAAQ,KAAK,YAAY,IAAI,MAAM,CAAC;IAG9C;;;;;OAKG;IACI,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAgBpD;;;OAGG;IACH;;;OAGG;IACI,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAMzC;;;OAGG;IACI,UAAU,CAAC,aAAa,EAAE,WAAW,EAAE,IAAI,GAAE,QAAQ,GAAG,SAAoB,GAAG,IAAI;IAqB1F,SAAS,CAAC,UAAU,IAAI,WAAW;IAInC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAEtD,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAElD;;OAEG;IACH,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAoB3E"}
@@ -0,0 +1,22 @@
1
+ type GlobalListener = (data: any) => void;
2
+ /**
3
+ * THE NEIGHBORHOOD (Global Event Mediator)
4
+ *
5
+ * Acts as the certal nervous system where all components post updates.
6
+ * Other components can tune in to specific frequencies (channels) here.
7
+ */
8
+ export declare class JuxGlobalBus {
9
+ private listeners;
10
+ on(channel: string, callback: GlobalListener): void;
11
+ off(channel: string, callback: GlobalListener): void;
12
+ emit(channel: string, data: any): void;
13
+ /**
14
+ * DEBUG: Read-only Snapshot of active channels and listener identities.
15
+ * usage: juxV2.events.registry
16
+ * Returns: { "channelName": ["functionName", "(anonymous)"] }
17
+ */
18
+ get registry(): Record<string, string[]>;
19
+ }
20
+ export declare const GlobalBus: JuxGlobalBus;
21
+ export {};
22
+ //# sourceMappingURL=GlobalBus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalBus.d.ts","sourceRoot":"","sources":["GlobalBus.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;AAE1C;;;;;GAKG;AACH,qBAAa,YAAY;IACrB,OAAO,CAAC,SAAS,CAA0C;IAE3D,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI;IAOnD,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI;IAUpD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI;IAetC;;;;OAIG;IACH,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAOvC;CACJ;AAGD,eAAO,MAAM,SAAS,cAAqB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * REGINALD'S LEDGER
3
+ * A protected reactive container for atomic state management.
4
+ */
5
+ export declare class State<T> {
6
+ #private;
7
+ constructor(initialValue: T);
8
+ get value(): T;
9
+ /**
10
+ * Access the timeline of past states (The Ledger).
11
+ */
12
+ get history(): string[];
13
+ set(newValue: T): void;
14
+ rollback(): void;
15
+ rollforward(): void;
16
+ subscribe(callback: (value: T) => void): () => void;
17
+ }
18
+ //# sourceMappingURL=State.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["State.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,KAAK,CAAC,CAAC;;gBAMJ,YAAY,EAAE,CAAC;IAI3B,IAAI,KAAK,IAAI,CAAC,CAEb;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,EAAE,CAEtB;IAED,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI;IAQtB,QAAQ,IAAI,IAAI;IAShB,WAAW,IAAI,IAAI;IASnB,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI;CAUtD"}
@@ -0,0 +1,7 @@
1
+ import { ElementEngine, ElementOptions } from './engine.js';
2
+ export type ElementComponent = ElementEngine & {
3
+ render: (targetId: string | HTMLElement) => ElementComponent;
4
+ injectCSS: (id: string, cssContent: string) => void;
5
+ };
6
+ export declare function Element(id: string, options?: ElementOptions): ElementComponent;
7
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG5D,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC3C,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,KAAK,gBAAgB,CAAC;IAC7D,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,gBAAgB,CAuBlF"}
@@ -0,0 +1,43 @@
1
+ import { BaseEngine, BaseState } from '../base/BaseEngine.js';
2
+ export interface ElementState extends BaseState {
3
+ tagName: string;
4
+ content: string | null;
5
+ contentType: 'text' | 'html';
6
+ inlineStyle: string;
7
+ }
8
+ export interface ElementOptions {
9
+ tag?: string;
10
+ text?: string;
11
+ html?: string;
12
+ style?: string;
13
+ }
14
+ export declare class ElementEngine extends BaseEngine<ElementState, ElementOptions> {
15
+ constructor(id: string, options?: ElementOptions);
16
+ protected prepareState(id: string, options: ElementOptions): ElementState;
17
+ /**
18
+ * Set the HTML Tag name (e.g. 'div', 'span', 'h1', 'section')
19
+ */
20
+ tag(tagName: string): this;
21
+ /**
22
+ * Set plain text content (automatically escaped)
23
+ */
24
+ text(value: string): this;
25
+ /**
26
+ * Set raw HTML content (innerHTML)
27
+ */
28
+ html(value: string): this;
29
+ /**
30
+ * Append raw HTML to existing content
31
+ */
32
+ appendHtml(value: string): this;
33
+ /**
34
+ * Set inline styles (e.g. "color: red; margin: 10px;")
35
+ */
36
+ style(cssText: string): this;
37
+ /**
38
+ * Receives RAW DOM events from the Skin and emits them to listeners.
39
+ * This keeps the 'emit' logic encapsulated within the Engine.
40
+ */
41
+ handleEvent(eventName: string, content: any): void;
42
+ }
43
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CAEvB;AAED,MAAM,WAAW,cAAc;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,aAAc,SAAQ,UAAU,CAAC,YAAY,EAAE,cAAc,CAAC;gBAC3D,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB;IAIpD,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,YAAY;IAezE;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM1B;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMzB;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKzB;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM/B;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK5B;;;OAGG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,IAAI;CAGrD"}
@@ -0,0 +1,10 @@
1
+ import { BaseSkin } from '../base/BaseSkin.js';
2
+ import { ElementEngine, ElementState } from './engine.js';
3
+ export declare class ElementSkin extends BaseSkin<ElementState, ElementEngine> {
4
+ constructor(engine: ElementEngine);
5
+ protected get structureCss(): string;
6
+ protected createRoot(): HTMLElement;
7
+ protected bindEvents(root: HTMLElement): void;
8
+ protected updateSkin(state: ElementState): void;
9
+ }
10
+ //# sourceMappingURL=skin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skin.d.ts","sourceRoot":"","sources":["skin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG1D,qBAAa,WAAY,SAAQ,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;gBACtD,MAAM,EAAE,aAAa;IAIjC,SAAS,KAAK,YAAY,IAAI,MAAM,CAEnC;IAGD,SAAS,CAAC,UAAU,IAAI,WAAW;IAKnC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAY7C,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;CAoClD"}
@@ -0,0 +1,14 @@
1
+ import { GridEngine, GridOptions, GridInput } from './engine.js';
2
+ export type GridComponent = GridEngine & {
3
+ render: (targetId: string | HTMLElement) => GridComponent;
4
+ injectCSS: (id: string, cssContent: string) => void;
5
+ rows: (config: GridInput) => GridComponent;
6
+ columns: (config: GridInput) => GridComponent;
7
+ gap: (gap: string) => GridComponent;
8
+ width: (width: string) => GridComponent;
9
+ height: (height: string) => GridComponent;
10
+ gridder: (active?: boolean) => GridComponent;
11
+ getCellId: (row: number, col: number) => string;
12
+ };
13
+ export declare function Grid(id: string, options?: GridOptions): GridComponent;
14
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGjE,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG;IACrC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,KAAK,aAAa,CAAC;IAC1D,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAGpD,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,aAAa,CAAC;IAC3C,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,aAAa,CAAC;IAC9C,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,aAAa,CAAC;IACpC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,aAAa,CAAC;IACxC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,aAAa,CAAC;IAG1C,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,aAAa,CAAC;IAG7C,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACnD,CAAC;AAEF,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,aAAa,CA6CzE"}
@@ -0,0 +1,40 @@
1
+ import { BaseEngine, BaseState } from '../base/BaseEngine.js';
2
+ export interface GridTrackConfig {
3
+ size?: string;
4
+ style?: string;
5
+ class?: string;
6
+ }
7
+ export type GridInput = number | GridTrackConfig[];
8
+ export interface GridState extends BaseState {
9
+ rows: GridTrackConfig[];
10
+ columns: GridTrackConfig[];
11
+ gap: string;
12
+ boundaryWidth: string;
13
+ boundaryHeight: string;
14
+ gridder: boolean;
15
+ }
16
+ export interface GridOptions {
17
+ rows?: GridInput;
18
+ columns?: GridInput;
19
+ gap?: string;
20
+ width?: string;
21
+ height?: string;
22
+ gridder?: boolean;
23
+ }
24
+ export declare class GridEngine extends BaseEngine<GridState, GridOptions> {
25
+ constructor(id: string, options?: GridOptions);
26
+ protected prepareState(id: string, options: GridOptions): GridState;
27
+ /**
28
+ * helper: Normalizes simple numbers into full config arrays.
29
+ * Changed from #normalizeTracks to private normalizeTracks to avoid initialization errors
30
+ * when called via BaseEngine constructor -> prepareState.
31
+ */
32
+ private normalizeTracks;
33
+ setRows(input: GridInput): this;
34
+ setColumns(input: GridInput): this;
35
+ setGap(gap: string): this;
36
+ setWidth(width: string): this;
37
+ setHeight(height: string): this;
38
+ toggleGridder(active?: boolean): this;
39
+ }
40
+ //# sourceM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B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM7B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAM/B,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI;CAMxC"}
@@ -0,0 +1,11 @@
1
+ import { BaseSkin } from '../base/BaseSkin.js';
2
+ import { GridEngine, GridState } from './engine.js';
3
+ export declare class GridSkin extends BaseSkin<GridState, GridEngine> {
4
+ #private;
5
+ constructor(engine: GridEngine);
6
+ protected get structureCss(): string;
7
+ protected bindEvents(root: HTMLElement): void;
8
+ protected updateSkin(state: GridState): void;
9
+ protected createRoot(): HTMLElement;
10
+ }
11
+ //# sourceMappingURL=skin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skin.d.ts","sourceRoot":"","sources":["skin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGpD,qBAAa,QAAS,SAAQ,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;;gBAI7C,MAAM,EAAE,UAAU;IAK9B,SAAS,KAAK,YAAY,IAAI,MAAM,CAEnC;IAED,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAW7C,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IA0E5C,SAAS,CAAC,UAAU,IAAI,WAAW;CAGtC"}
@@ -0,0 +1,32 @@
1
+ import { List } from './list/component.js';
2
+ import { Grid } from './grid/component.js';
3
+ import { Input } from './input/component.js';
4
+ import { Element } from './element/component.js';
5
+ export { List, Grid, Input, Element };
6
+ export declare const tree: () => Record<string, any>;
7
+ export declare const use: (query: string) => any;
8
+ export declare const engines: () => string[];
9
+ export declare const log: () => void;
10
+ /**
11
+ * juxDef: Global Introspection & Debugging Tool
12
+ * Exposed to window.juxDef for console access.
13
+ */
14
+ export declare const juxDef: {
15
+ tree: () => Record<string, any>;
16
+ use: (query: string) => any;
17
+ engines: () => string[];
18
+ log: () => void;
19
+ };
20
+ export declare const juxV2: {
21
+ List: typeof List;
22
+ Grid: typeof Grid;
23
+ Input: typeof Input;
24
+ events: import("./base/GlobalBus.js").JuxGlobalBus;
25
+ plugins: {
26
+ ServerSQLitePlugin: (config: import("./plugins/ServerSQLitePlugin.js").ServerSQLiteConfig) => import("./base/BaseEngine.js").JuxServiceContract<import("./base/BaseEngine.js").BaseEngine<any>>;
27
+ LocalStoragePlugin: (config: import("./plugins/LocalStoragePlugin.js").LocalStorageConfig) => import("./base/BaseEngine.js").JuxServiceContract<import("./base/BaseEngine.js").BaseEngine<any>>;
28
+ IndexedDBPlugin: (config: import("./plugins/IndexedDBPlugin.js").IndexedDBConfig) => import("./base/BaseEngine.js").JuxServiceContract<import("./base/BaseEngine.js").BaseEngine<any>>;
29
+ ClientSQLitePlugin: (config: import("./plugins/ClientSQLitePlugin.js").ClientSQLiteConfig) => import("./base/BaseEngine.js").JuxServiceContract<import("./base/BaseEngine.js").BaseEngine<any>>;
30
+ };
31
+ };
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAwCtC,eAAO,MAAM,IAAI,2BAmGhB,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,QA8BhC,CAAC;AAEF,eAAO,MAAM,OAAO,gBAOnB,CAAC;AAEF,eAAO,MAAM,GAAG,YAsBf,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM;;iBArEQ,MAAM;;;CA0EhC,CAAC;AASF,eAAO,MAAM,KAAK;;;;;;;;;;;CAWjB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { InputEngine, InputOptions } from './engine.js';
2
+ export type InputComponent = InputEngine & {
3
+ render: (targetId: string | HTMLElement) => InputComponent;
4
+ };
5
+ export declare function Input(id: string, options?: InputOptions): InputComponent;
6
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGxD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACvC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,KAAK,cAAc,CAAC;CAC9D,CAAC;AAEF,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,cAAc,CAoB5E"}
@@ -0,0 +1,27 @@
1
+ import { BaseEngine, BaseState } from '../base/BaseEngine.js';
2
+ export interface InputState extends BaseState {
3
+ value: string;
4
+ label: string | null;
5
+ placeholder: string;
6
+ type: 'text' | 'number' | 'password' | 'email';
7
+ error: string | null;
8
+ readonly: boolean;
9
+ }
10
+ export interface InputOptions {
11
+ value?: string | number;
12
+ label?: string;
13
+ placeholder?: string;
14
+ type?: 'text' | 'number' | 'password' | 'email';
15
+ readonly?: boolean;
16
+ }
17
+ export declare class InputEngine extends BaseEngine<InputState, InputOptions> {
18
+ constructor(id: string, options?: InputOptions);
19
+ protected prepareState(id: string, options: InputOptions): InputState;
20
+ setValue(value: string | number): this;
21
+ setLabel(label: string): this;
22
+ setPlaceholder(text: string): this;
23
+ setError(message: string | null): this;
24
+ setType(type: 'text' | 'number' | 'password' | 'email'): this;
25
+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,GAAG,OAAO,GAAG,IAAI;IAK7D,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;CAIvC"}
@@ -0,0 +1,11 @@
1
+ import { BaseSkin } from '../base/BaseSkin.js';
2
+ import { InputEngine, InputState } from './engine.js';
3
+ export declare class InputSkin extends BaseSkin<InputState, InputEngine> {
4
+ #private;
5
+ constructor(engine: InputEngine);
6
+ protected get structureCss(): string;
7
+ protected createRoot(): HTMLElement;
8
+ protected bindEvents(root: HTMLElement): void;
9
+ protected updateSkin(state: InputState): void;
10
+ }
11
+ //# sourceMappingURL=skin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skin.d.ts","sourceRoot":"","sources":["skin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGtD,qBAAa,SAAU,SAAQ,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;;gBAMhD,MAAM,EAAE,WAAW;IAK/B,SAAS,KAAK,YAAY,IAAI,MAAM,CAEnC;IAED,SAAS,CAAC,UAAU,IAAI,WAAW;IAInC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAW7C,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;CAyDhD"}
@@ -0,0 +1,27 @@
1
+ import { ListEngine, ListOptions } from './engine.js';
2
+ import { JuxServiceContract } from '../base/BaseEngine.js';
3
+ export type ListKnob = 'add' | 'edit' | 'move' | 'search' | 'delete' | 'sort';
4
+ export type ListComponent = ListEngine & {
5
+ render: (targetId: string | HTMLElement) => ListComponent;
6
+ injectCSS: (id: string, cssContent: string) => void;
7
+ enableSearch: (enabled?: boolean) => ListComponent;
8
+ enableAdd: (enabled?: boolean) => ListComponent;
9
+ enableDelete: (enabled?: boolean) => ListComponent;
10
+ enableEdit: (enabled?: boolean) => ListComponent;
11
+ enableMove: (enabled?: boolean) => ListComponent;
12
+ enableSort: (enabled?: boolean) => ListComponent;
13
+ enableNoItems: (message?: string) => ListComponent;
14
+ knobs: (features: ListKnob[]) => ListComponent;
15
+ addPlugin: (plugin: JuxServiceContract<ListEngine>) => ListComponent;
16
+ };
17
+ /**
18
+ * Factory Function
19
+ * usage: jux.list('my-list', { items: ['A', 'B'] }).render('app')
20
+ *
21
+ * Strategy: FUNCTIONAL COMPOSITION
22
+ * We instantiate the pure Logic (Engine) and the View (Skin).
23
+ * We augment the Engine instance with a function, .render(), that delegates to the Skin method, renderSkin().
24
+ * This keeps the Engine class pure/headless, while offering a convenient API.
25
+ */
26
+ export declare function List(id: string, options?: ListOptions): ListComponent;
27
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAG9E,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG;IACrC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,KAAK,aAAa,CAAC;IAC1D,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpD,YAAY,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,aAAa,CAAC;IACnD,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,aAAa,CAAC;IAChD,YAAY,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,aAAa,CAAC;IACnD,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,aAAa,CAAC;IACjD,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,aAAa,CAAC;IACjD,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,aAAa,CAAC;IACjD,aAAa,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;IACnD,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,aAAa,CAAC;IAE/C,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,UAAU,CAAC,KAAK,aAAa,CAAC;CACxE,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,aAAa,CAgEzE"}
@@ -0,0 +1,69 @@
1
+ import { BaseEngine, BaseState } from '../base/BaseEngine.js';
2
+ export interface ListItem {
3
+ id: string;
4
+ text: string;
5
+ selected: boolean;
6
+ classes: string[];
7
+ [key: string]: any;
8
+ }
9
+ /**
10
+ * Flexible input shape for creating items
11
+ * Allows simple strings or detailed configuration objects.
12
+ */
13
+ export type ListItemInput = string | Record<string, any>;
14
+ export interface ListState extends BaseState {
15
+ items: ListItem[];
16
+ listType: 'unordered' | 'ordered';
17
+ selectionMode: 'single' | 'multiple' | 'none';
18
+ filterText: string;
19
+ sorted: 'asc' | 'desc' | 'none';
20
+ noItemsMessage: string | null;
21
+ columns: (string | {
22
+ key: string;
23
+ label?: string;
24
+ })[];
25
+ idField: string;
26
+ }
27
+ export interface ListOptions {
28
+ items?: ListItemInput[];
29
+ listType?: 'unordered' | 'ordered';
30
+ selectionMode?: 'single' | 'multiple' | 'none';
31
+ noItemsMessage?: string;
32
+ columns?: (string | {
33
+ key: string;
34
+ label?: string;
35
+ })[];
36
+ idField?: string;
37
+ }
38
+ export declare class ListEngine extends BaseEngine<ListState, ListOptions> {
39
+ constructor(id: string, options?: ListOptions);
40
+ /**
41
+ * CONTRACT IMPLEMENTATION:
42
+ * Convert loose Options into STRICT initial state.
43
+ */
44
+ protected prepareState(id: string, options: ListOptions): ListState;
45
+ private static normalizeItem;
46
+ setColumns(cols: (string | {
47
+ key: string;
48
+ label?: string;
49
+ })[]): this;
50
+ /**
51
+ * Set or toggle sort order.
52
+ * @param order Optional specific order. If omitted, cycles none -> asc -> desc -> none.
53
+ */
54
+ toggleSort(order?: 'asc' | 'desc' | 'none'): this;
55
+ enableNoItems(message?: string): this;
56
+ filter(text: string): this;
57
+ addItem(input: ListItemInput): this;
58
+ addItems(items: ListItemInput[]): this;
59
+ clearItems(): this;
60
+ removeItem(identifier: number | string): this;
61
+ updateItem(index: number, updates: Partial<ListItem> | string): this;
62
+ moveItem(fromIndex: number, toIndex: number): this;
63
+ listType(type?: 'unordered' | 'ordered'): this;
64
+ toggleSelection(index: number): this;
65
+ setSelectionMode(mode: 'single' | 'multiple' | 'none'): this;
66
+ addItemClass(className: string, indexes?: number[]): this;
67
+ removeItemClass(className: string, indexes?: number[]): this;
68
+ }
69
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAG9D,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEzD,MAAM,WAAW,SAAU,SAAQ,SAAS;IACxC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC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,aAAa,CAAC,OAAO,GAAE,MAA0B,GAAG,IAAI;IAMxD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAM1B,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAOnC,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI;IAUtC,UAAU,IAAI,IAAI;IAUlB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAuB7C,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,GAAG,IAAI;IAkBpE,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAmBlD,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI;IAgB9C,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAyBpC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI;IAM5D,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI;IA0BzD,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI;CAyB/D"}
@@ -0,0 +1,20 @@
1
+ import { BaseSkin } from '../base/BaseSkin.js';
2
+ import { ListEngine, ListState } from './engine.js';
3
+ export declare class ListSkin extends BaseSkin<ListState, ListEngine> {
4
+ #private;
5
+ constructor(engine: ListEngine);
6
+ enableSearch(enabled: boolean): void;
7
+ enableAdd(enabled: boolean): void;
8
+ enableDelete(enabled: boolean): void;
9
+ enableMove(enabled: boolean): void;
10
+ enableSort(enabled: boolean): void;
11
+ enableNoItems(message?: string): void;
12
+ enableEdit(enabled: boolean): void;
13
+ protected get structureCss(): string;
14
+ protected bindEvents(root: HTMLElement): void;
15
+ /**
16
+ * Skin Contract: Update/Changes
17
+ */
18
+ protected updateSkin(state: ListState): void;
19
+ }
20
+ //# sourceMappingURL=skin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skin.d.ts","sourceRoot":"","sources":["skin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAY,MAAM,aAAa,CAAC;AAI9D,qBAAa,QAAS,SAAQ,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;;gBAqB7C,MAAM,EAAE,UAAU;IAK9B,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IACpC,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IACjC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IACpC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAClC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAClC,aAAa,CAAC,OAAO,GAAE,MAA0B,GAAG,IAAI;IAExD,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIlC,SAAS,KAAK,YAAY,IAAI,MAAM,CAEnC;IAGD,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IA2I7C;;OAEG;IACH,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;CAmL/C"}
@@ -0,0 +1,21 @@
1
+ import { JuxServiceContract, BaseEngine } from '../base/BaseEngine.js';
2
+ export interface ClientSQLiteConfig {
3
+ /** Key used for IndexedDB storage (the "filename") */
4
+ dbName: string;
5
+ /** SQL to run if creating a brand new DB (Schema) */
6
+ initSql?: string;
7
+ /** Main Query to bind to the Engine State */
8
+ query?: string;
9
+ /** State property to bind results to (e.g. 'items') */
10
+ bindTo?: string;
11
+ /** Transform row object to State Item shape */
12
+ mapRow?: (row: any) => any;
13
+ /** If true, persists to IDB after every write operation */
14
+ autoSave?: boolean;
15
+ }
16
+ /**
17
+ * Client-Side SQLite Plugin
18
+ * Runs a real SQLite engine via WebAssembly (WASM) in the browser, persisted to IndexedDB.
19
+ */
20
+ export declare const ClientSQLitePlugin: (config: ClientSQLiteConfig) => JuxServiceContract<BaseEngine<any>>;
21
+ //# sourceMappingURL=ClientSQLitePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientSQLitePlugin.d.ts","sourceRoot":"","sources":["ClientSQLitePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEvE,MAAM,WAAW,kBAAkB;IAC/B,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IAEf,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAE3B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,kBAAkB,KAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC,CA+HhG,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { JuxServiceContract, BaseEngine } from '../base/BaseEngine.js';
2
+ export interface IndexedDBConfig {
3
+ dbName: string;
4
+ storeName: string;
5
+ /**
6
+ * State Binding: The property key on the Engine's state to persist.
7
+ * e.g., 'items'
8
+ */
9
+ bindTo: string;
10
+ /** If true, loads data immediately on install */
11
+ autoLoad?: boolean;
12
+ }
13
+ /**
14
+ * IndexedDB Plugin
15
+ * Asynchronous persistence for larger datasets.
16
+ */
17
+ export declare const IndexedDBPlugin: (config: IndexedDBConfig) => JuxServiceContract<BaseEngine<any>>;
18
+ //# sourceMappingURL=IndexedDBPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexedDBPlugin.d.ts","sourceRoot":"","sources":["IndexedDBPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEvE,MAAM,WAAW,eAAe;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf,iDAAiD;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,eAAe,KAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC,CA2E1F,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { JuxServiceContract, BaseEngine } from '../base/BaseEngine.js';
2
+ export interface LocalStorageConfig {
3
+ /** Unique key for storage (e.g. 'my-app-list-v1') */
4
+ key: string;
5
+ /**
6
+ * State Binding: The property key on the Engine's state to persist.
7
+ * e.g., 'items' for a ListEngine.
8
+ */
9
+ bindTo: string;
10
+ /** If true, clears storage on install (fresh start) */
11
+ clearOnInstall?: boolean;
12
+ /** If true, automatically saves to storage when state changes */
13
+ autoSave?: boolean;
14
+ }
15
+ /**
16
+ * LocalStorage Plugin
17
+ * Persists a slice of Engine State to Browser LocalStorage.
18
+ */
19
+ export declare const LocalStoragePlugin: (config: LocalStorageConfig) => JuxServiceContract<BaseEngine<any>>;
20
+ //# sourceMappingURL=LocalStoragePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalStoragePlugin.d.ts","sourceRoot":"","sources":["LocalStoragePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEvE,MAAM,WAAW,kBAAkB;IAC/B,qDAAqD;IACrD,GAAG,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf,uDAAuD;IACvD,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,kBAAkB,KAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC,CA8DhG,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { JuxServiceContract, BaseEngine } from '../base/BaseEngine.js';
2
+ export interface ServerSQLiteConfig {
3
+ /** The Database Driver Instance (e.g. better-sqlite3) */
4
+ database: any;
5
+ /** Optional: SQL Query to fetch data automatically */
6
+ query?: string;
7
+ /**
8
+ * State Binding: The property key on the Engine's state to populate.
9
+ * e.g., 'items' for a ListEngine, or 'rows' for a GridEngine.
10
+ */
11
+ bindTo?: string;
12
+ /**
13
+ * Transformation Strategy:
14
+ * Converts a raw DB row into the shape expected by the Engine's state.
15
+ */
16
+ mapRow?: (row: any) => any;
17
+ /** If true, runs the query immediately on install */
18
+ autoLoad?: boolean;
19
+ }
20
+ /**
21
+ * Server-Side SQLite Plugin
22
+ * Decoupled Service that injects SQL capabilities and binds data to ANY Engine state.
23
+ */
24
+ export declare const ServerSQLitePlugin: (config: ServerSQLiteConfig) => JuxServiceContract<BaseEngine<any>>;
25
+ //# sourceMappingURL=ServerSQLitePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerSQLitePlugin.d.ts","sourceRoot":"","sources":["ServerSQLitePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEvE,MAAM,WAAW,kBAAkB;IAC/B,yDAAyD;IACzD,QAAQ,EAAE,GAAG,CAAC;IAEd,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAE3B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,kBAAkB,KAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC,CAqEhG,CAAC"}
package/lib/globals.d.ts CHANGED
@@ -1,21 +1,5 @@
1
- /**
2
- * Global types for JUX projects
3
- * This file provides IntelliSense in all .jux files
4
- */
5
-
6
- import type { JuxAPI } from './jux.js';
7
- import type { code } from './components/code.js';
8
-
9
- declare global {
10
- /**
11
- * The main JUX API - available in all .jux files
12
- */
13
- const jux: JuxAPI;
14
-
15
- /**
16
- * Code component factory - available globally
17
- */
18
- const code: typeof code;
19
- }
20
-
21
- export {};
1
+ // CSS Module Support
2
+ declare module '*.css' {
3
+ const content: string;
4
+ export default content;
5
+ }
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Jux Fetch Utility
3
+ *
4
+ * A lightweight fetch wrapper with sensible defaults, error handling, and method chaining.
5
+ * Includes configuration helpers for juxconfig.js integration.
6
+ *
7
+ * Usage:
8
+ * // Configure once (optional)
9
+ * jux.fetch.config({
10
+ * baseUrl: 'https://api.example.com',
11
+ * credentials: 'include',
12
+ * timeout: 10000,
13
+ * log: 'errors',
14
+ * onUnauthorized: () => window.location.href = '/login'
15
+ * });
16
+ *
17
+ * // Simple GET
18
+ * const { data, error } = await jux.fetch('/users').send();
19
+ *
20
+ * // Method chaining
21
+ * const { data, error } = await jux.fetch('/users')
22
+ * .method('POST')
23
+ * .body({ name: 'John' })
24
+ * .params({ limit: 10 })
25
+ * .timeout(5000)
26
+ * .log(true)
27
+ * .send();
28
+ *
29
+ * // With juxconfig services
30
+ * const { data } = await jux.fetch('/users')
31
+ * .baseUrl(jux.fetch.getServiceUrl('database'))
32
+ * .send();
33
+ *
34
+ * // Service client helper
35
+ * const db = jux.fetch.serviceClient('database');
36
+ * const { data } = await db.fetch('/users').send();
37
+ */
38
+ export type LogLevel = boolean | 'errors';
39
+ export interface FetchConfig {
40
+ baseUrl?: string;
41
+ credentials?: RequestCredentials;
42
+ headers?: Record<string, string>;
43
+ timeout?: number;
44
+ log?: LogLevel;
45
+ onUnauthorized?: () => void;
46
+ onError?: (error: FetchError) => void;
47
+ }
48
+ export interface FetchOptions extends Omit<RequestInit, 'body'> {
49
+ params?: Record<string, any>;
50
+ body?: any;
51
+ timeout?: number;
52
+ log?: LogLevel;
53
+ onUnauthorized?: () => void;
54
+ onError?: (error: FetchError) => void;
55
+ parseResponse?: boolean;
56
+ }
57
+ export interface FetchError {
58
+ message: string;
59
+ status?: number;
60
+ statusText?: string;
61
+ data?: any;
62
+ }
63
+ export interface FetchResult<T = any> {
64
+ data: T | null;
65
+ error: FetchError | null;
66
+ status: number;
67
+ response: Response;
68
+ }
69
+ /**
70
+ * Configure global fetch defaults
71
+ */
72
+ export declare function configureFetch(config: FetchConfig): void;
73
+ /**
74
+ * FetchBuilder class for method chaining
75
+ */
76
+ declare class FetchBuilder<T = any> {
77
+ url: string;
78
+ options: FetchOptions;
79
+ constructor(url: string, options?: FetchOptions);
80
+ method(value: string): this;
81
+ body(value: any): this;
82
+ params(value: Record<string, any>): this;
83
+ headers(value: Record<string, string>): this;
84
+ header(key: string, value: string): this;
85
+ timeout(value: number): this;
86
+ credentials(value: RequestCredentials): this;
87
+ log(value: LogLevel): this;
88
+ parseResponse(value: boolean): this;
89
+ onUnauthorized(callback: () => void): this;
90
+ onError(callback: (error: FetchError) => void): this;
91
+ /**
92
+ * Execute the fetch request
93
+ */
94
+ send(): Promise<FetchResult<T>>;
95
+ /**
96
+ * Alias for send()
97
+ */
98
+ fetch(): Promise<FetchResult<T>>;
99
+ /**
100
+ * Make the builder thenable (Promise-like) so it can be awaited directly
101
+ * This allows: await jux.fetch('/users') without needing .send()
102
+ */
103
+ then<TResult1 = FetchResult<T>, TResult2 = never>(onfulfilled?: ((value: FetchResult<T>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
104
+ /**
105
+ * Make the builder catchable for Promise.catch()
106
+ */
107
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<FetchResult<T> | TResult>;
108
+ /**
109
+ * Make the builder finally-able for Promise.finally()
110
+ */
111
+ finally(onfinally?: (() => void) | null): Promise<FetchResult<T>>;
112
+ }
113
+ /**
114
+ * Create a fetch builder
115
+ */
116
+ export declare function juxFetch<T = any>(url: string, options?: FetchOptions): FetchBuilder<T>;
117
+ /**
118
+ * Convenience methods for common HTTP verbs
119
+ */
120
+ export declare const fetchHelpers: {
121
+ get: <T = any>(url: string, options?: Omit<FetchOptions, "method">) => FetchBuilder<T>;
122
+ post: <T = any>(url: string, body?: any, options?: Omit<FetchOptions, "method" | "body">) => FetchBuilder<T>;
123
+ put: <T = any>(url: string, body?: any, options?: Omit<FetchOptions, "method" | "body">) => FetchBuilder<T>;
124
+ patch: <T = any>(url: string, body?: any, options?: Omit<FetchOptions, "method" | "body">) => FetchBuilder<T>;
125
+ delete: <T = any>(url: string, options?: Omit<FetchOptions, "method">) => FetchBuilder<T>;
126
+ };
127
+ /**
128
+ * Fetch multiple URLs in parallel
129
+ */
130
+ export declare function fetchAll<T = any>(urls: string[], options?: FetchOptions): Promise<FetchResult<T>[]>;
131
+ /**
132
+ * Get a service URL from window.juxConfig
133
+ */
134
+ export declare function getServiceUrl(serviceName: string): string | null;
135
+ /**
136
+ * Create a fetch instance preconfigured for a specific service
137
+ *
138
+ * Usage:
139
+ * const api = jux.fetch.serviceClient('database');
140
+ * const { data } = await api.fetch('/users').send();
141
+ */
142
+ export declare function serviceClient(serviceName: string): {
143
+ fetch: (url: string, options?: any) => FetchBuilder<any>;
144
+ baseUrl: string | null;
145
+ };
146
+ /**
147
+ * Setup fetch from juxconfig
148
+ * Call this in your bootstrap function
149
+ *
150
+ * Usage:
151
+ * export default {
152
+ * bootstrap: [
153
+ * async function initFetch() {
154
+ * await jux.fetch.setupConfig();
155
+ * }
156
+ * ]
157
+ * };
158
+ */
159
+ export declare function setupConfig(): Promise<{
160
+ services: any;
161
+ getServiceUrl: typeof getServiceUrl;
162
+ } | undefined>;
163
+ export declare const fetchAPI: typeof juxFetch & {
164
+ all: typeof fetchAll;
165
+ get: <T = any>(url: string, options?: Omit<FetchOptions, "method">) => FetchBuilder<T>;
166
+ post: <T = any>(url: string, body?: any, options?: Omit<FetchOptions, "method" | "body">) => FetchBuilder<T>;
167
+ put: <T = any>(url: string, body?: any, options?: Omit<FetchOptions, "method" | "body">) => FetchBuilder<T>;
168
+ patch: <T = any>(url: string, body?: any, options?: Omit<FetchOptions, "method" | "body">) => FetchBuilder<T>;
169
+ delete: <T = any>(url: string, options?: Omit<FetchOptions, "method">) => FetchBuilder<T>;
170
+ config: typeof configureFetch;
171
+ setupConfig: typeof setupConfig;
172
+ getServiceUrl: typeof getServiceUrl;
173
+ serviceClient: typeof serviceClient;
174
+ };
175
+ export {};
176
+ //# sourceMappingURL=fetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE1C,MAAM,WAAW,WAAW;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,cAAc,CAAC,EAAE,MAAM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AQ;;UA1HX,CAAC,aAAa,MAAM,YAAY,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC;WAG3D,CAAC,aAAa,MAAM,SAAS,GAAG,YAAY,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,MAAM,CAAC;UAGlF,CAAC,aAAa,MAAM,SAAS,GAAG,YAAY,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,MAAM,CAAC;YAG/E,CAAC,aAAa,MAAM,SAAS,GAAG,YAAY,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,MAAM,CAAC;aAGhF,CAAC,aAAa,MAAM,YAAY,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC;;;;;CAqHvE,CAAC"}
package/package.json CHANGED
@@ -1,17 +1,15 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
- "main": "lib/jux.js",
7
- "types": "lib/jux.d.ts",
6
+ "types": "lib/globals.d.ts",
8
7
  "access": "public",
9
8
  "repository": {
10
9
  "type": "git",
11
10
  "url": "git+https://github.com/jux/juxscript.git"
12
11
  },
13
12
  "exports": {
14
- "./types/*": "./types/*",
15
13
  "./package.json": "./package.json"
16
14
  },
17
15
  "files": [
package/types/css.d.ts DELETED
@@ -1,4 +0,0 @@
1
- declare module '*.css' {
2
- const content: string;
3
- export default content;
4
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * Global type declarations for .jux files
3
- */
4
-
5
- import type { jux } from '../lib/jux';
6
-
7
- declare global {
8
- const jux: typeof import('../lib/jux').jux;
9
-
10
- interface Window {
11
- REACTIVE_DEBUG?: boolean;
12
- juxContext?: Record<string, any>;
13
- }
14
- }
15
-
16
- export {};