juxscript 1.1.239 → 1.1.243
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.js +7 -137
- package/lib/components/dataframe.ts +0 -569
- package/lib/components/tag.ts +68 -0
- package/lib/styles/shadcn.css +20 -7
- package/lib/utils/idgen.ts +6 -0
- package/package.json +5 -6
- package/index.d.ts +0 -239
- package/index.d.ts.map +0 -1
- package/lib/components/alert.d.ts +0 -36
- package/lib/components/alert.d.ts.map +0 -1
- package/lib/components/alert.js +0 -172
- package/lib/components/alert.ts +0 -219
- package/lib/components/app.d.ts +0 -89
- package/lib/components/app.d.ts.map +0 -1
- package/lib/components/app.js +0 -175
- package/lib/components/app.ts +0 -247
- package/lib/components/badge.d.ts +0 -26
- package/lib/components/badge.d.ts.map +0 -1
- package/lib/components/badge.js +0 -91
- package/lib/components/badge.ts +0 -118
- package/lib/components/base/Animations.d.ts +0 -36
- package/lib/components/base/Animations.d.ts.map +0 -1
- package/lib/components/base/Animations.js +0 -70
- package/lib/components/base/Animations.ts +0 -112
- package/lib/components/base/BaseComponent.d.ts +0 -294
- package/lib/components/base/BaseComponent.d.ts.map +0 -1
- package/lib/components/base/BaseComponent.js +0 -735
- package/lib/components/base/BaseComponent.ts +0 -884
- package/lib/components/base/FormInput.d.ts +0 -77
- package/lib/components/base/FormInput.d.ts.map +0 -1
- package/lib/components/base/FormInput.js +0 -171
- package/lib/components/base/FormInput.ts +0 -237
- package/lib/components/blueprint.d.ts +0 -40
- package/lib/components/blueprint.d.ts.map +0 -1
- package/lib/components/blueprint.js +0 -327
- package/lib/components/button.d.ts +0 -70
- package/lib/components/button.d.ts.map +0 -1
- package/lib/components/button.js +0 -177
- package/lib/components/button.ts +0 -237
- package/lib/components/card.d.ts +0 -35
- package/lib/components/card.d.ts.map +0 -1
- package/lib/components/card.js +0 -130
- package/lib/components/card.ts +0 -177
- package/lib/components/chart.d.ts +0 -49
- package/lib/components/chart.d.ts.map +0 -1
- package/lib/components/chart.js +0 -205
- package/lib/components/chart.ts +0 -254
- package/lib/components/checkbox.d.ts +0 -33
- package/lib/components/checkbox.d.ts.map +0 -1
- package/lib/components/checkbox.js +0 -202
- package/lib/components/checkbox.ts +0 -260
- package/lib/components/code.d.ts +0 -52
- package/lib/components/code.d.ts.map +0 -1
- package/lib/components/code.js +0 -201
- package/lib/components/code.ts +0 -260
- package/lib/components/container.d.ts +0 -60
- package/lib/components/container.d.ts.map +0 -1
- package/lib/components/container.js +0 -195
- package/lib/components/container.ts +0 -259
- package/lib/components/data.d.ts +0 -36
- package/lib/components/data.d.ts.map +0 -1
- package/lib/components/data.js +0 -110
- package/lib/components/data.ts +0 -135
- package/lib/components/dataframe/DataFrameSource.d.ts +0 -118
- package/lib/components/dataframe/DataFrameSource.d.ts.map +0 -1
- package/lib/components/dataframe/DataFrameSource.js +0 -421
- package/lib/components/dataframe/DataFrameSource.ts +0 -532
- package/lib/components/dataframe/ImportSettingsModal.d.ts +0 -60
- package/lib/components/dataframe/ImportSettingsModal.d.ts.map +0 -1
- package/lib/components/dataframe/ImportSettingsModal.js +0 -442
- package/lib/components/dataframe/ImportSettingsModal.ts +0 -531
- package/lib/components/dataframe.d.ts +0 -110
- package/lib/components/dataframe.d.ts.map +0 -1
- package/lib/components/dataframe.js +0 -470
- package/lib/components/datepicker.d.ts +0 -40
- package/lib/components/datepicker.d.ts.map +0 -1
- package/lib/components/datepicker.js +0 -193
- package/lib/components/datepicker.ts +0 -251
- package/lib/components/dialog.d.ts +0 -39
- package/lib/components/dialog.d.ts.map +0 -1
- package/lib/components/dialog.js +0 -131
- package/lib/components/dialog.ts +0 -178
- package/lib/components/divider.d.ts +0 -31
- package/lib/components/divider.d.ts.map +0 -1
- package/lib/components/divider.js +0 -72
- package/lib/components/divider.ts +0 -104
- package/lib/components/dropdown-menu.d.ts +0 -42
- package/lib/components/dropdown-menu.d.ts.map +0 -1
- package/lib/components/dropdown-menu.js +0 -177
- package/lib/components/dropdown-menu.ts +0 -214
- package/lib/components/dropdown.d.ts +0 -41
- package/lib/components/dropdown.d.ts.map +0 -1
- package/lib/components/dropdown.js +0 -136
- package/lib/components/dropdown.ts +0 -188
- package/lib/components/element.d.ts +0 -51
- package/lib/components/element.d.ts.map +0 -1
- package/lib/components/element.js +0 -209
- package/lib/components/element.ts +0 -271
- package/lib/components/event-chain.d.ts +0 -9
- package/lib/components/event-chain.d.ts.map +0 -1
- package/lib/components/event-chain.js +0 -33
- package/lib/components/fileupload.d.ts +0 -98
- package/lib/components/fileupload.d.ts.map +0 -1
- package/lib/components/fileupload.js +0 -351
- package/lib/components/fileupload.ts +0 -449
- package/lib/components/grid.d.ts +0 -88
- package/lib/components/grid.d.ts.map +0 -1
- package/lib/components/grid.js +0 -208
- package/lib/components/grid.ts +0 -295
- package/lib/components/heading.d.ts +0 -25
- package/lib/components/heading.d.ts.map +0 -1
- package/lib/components/heading.js +0 -83
- package/lib/components/heading.ts +0 -113
- package/lib/components/helpers.d.ts +0 -9
- package/lib/components/helpers.d.ts.map +0 -1
- package/lib/components/helpers.js +0 -30
- package/lib/components/helpers.ts +0 -41
- package/lib/components/hero.d.ts +0 -60
- package/lib/components/hero.d.ts.map +0 -1
- package/lib/components/hero.js +0 -239
- package/lib/components/hero.ts +0 -302
- package/lib/components/history/StateHistory.d.ts +0 -91
- package/lib/components/history/StateHistory.d.ts.map +0 -1
- package/lib/components/history/StateHistory.js +0 -154
- package/lib/components/history/StateHistory.ts +0 -200
- package/lib/components/icon.d.ts +0 -36
- package/lib/components/icon.d.ts.map +0 -1
- package/lib/components/icon.js +0 -135
- package/lib/components/icon.ts +0 -182
- package/lib/components/icons.d.ts +0 -25
- package/lib/components/icons.d.ts.map +0 -1
- package/lib/components/icons.js +0 -440
- package/lib/components/icons.ts +0 -464
- package/lib/components/image.d.ts +0 -42
- package/lib/components/image.d.ts.map +0 -1
- package/lib/components/image.js +0 -204
- package/lib/components/image.ts +0 -260
- package/lib/components/include.d.ts +0 -86
- package/lib/components/include.d.ts.map +0 -1
- package/lib/components/include.js +0 -238
- package/lib/components/include.ts +0 -281
- package/lib/components/input.d.ts +0 -85
- package/lib/components/input.d.ts.map +0 -1
- package/lib/components/input.js +0 -362
- package/lib/components/input.ts +0 -473
- package/lib/components/layer.d.ts +0 -72
- package/lib/components/layer.d.ts.map +0 -1
- package/lib/components/layer.js +0 -219
- package/lib/components/layer.ts +0 -304
- package/lib/components/link.d.ts +0 -41
- package/lib/components/link.d.ts.map +0 -1
- package/lib/components/link.js +0 -216
- package/lib/components/link.ts +0 -268
- package/lib/components/list.d.ts +0 -83
- package/lib/components/list.d.ts.map +0 -1
- package/lib/components/list.js +0 -314
- package/lib/components/list.ts +0 -423
- package/lib/components/loading.d.ts +0 -25
- package/lib/components/loading.d.ts.map +0 -1
- package/lib/components/loading.js +0 -76
- package/lib/components/loading.ts +0 -104
- package/lib/components/menu.d.ts +0 -38
- package/lib/components/menu.d.ts.map +0 -1
- package/lib/components/menu.js +0 -205
- package/lib/components/menu.ts +0 -279
- package/lib/components/modal.d.ts +0 -97
- package/lib/components/modal.d.ts.map +0 -1
- package/lib/components/modal.js +0 -463
- package/lib/components/modal.ts +0 -576
- package/lib/components/nav.d.ts +0 -46
- package/lib/components/nav.d.ts.map +0 -1
- package/lib/components/nav.js +0 -193
- package/lib/components/nav.ts +0 -261
- package/lib/components/paragraph.d.ts +0 -30
- package/lib/components/paragraph.d.ts.map +0 -1
- package/lib/components/paragraph.js +0 -93
- package/lib/components/paragraph.ts +0 -123
- package/lib/components/pen.d.ts +0 -125
- package/lib/components/pen.d.ts.map +0 -1
- package/lib/components/pen.js +0 -443
- package/lib/components/pen.ts +0 -567
- package/lib/components/progress.d.ts +0 -40
- package/lib/components/progress.d.ts.map +0 -1
- package/lib/components/progress.js +0 -116
- package/lib/components/progress.ts +0 -163
- package/lib/components/radio.d.ts +0 -43
- package/lib/components/radio.d.ts.map +0 -1
- package/lib/components/radio.js +0 -226
- package/lib/components/radio.ts +0 -303
- package/lib/components/registry.d.ts +0 -34
- package/lib/components/registry.d.ts.map +0 -1
- package/lib/components/registry.js +0 -163
- package/lib/components/registry.ts +0 -193
- package/lib/components/req.d.ts +0 -155
- package/lib/components/req.d.ts.map +0 -1
- package/lib/components/req.js +0 -253
- package/lib/components/req.ts +0 -303
- package/lib/components/script.d.ts +0 -14
- package/lib/components/script.d.ts.map +0 -1
- package/lib/components/script.js +0 -33
- package/lib/components/script.ts +0 -41
- package/lib/components/select.d.ts +0 -42
- package/lib/components/select.d.ts.map +0 -1
- package/lib/components/select.js +0 -209
- package/lib/components/select.ts +0 -281
- package/lib/components/sidebar.d.ts +0 -59
- package/lib/components/sidebar.d.ts.map +0 -1
- package/lib/components/sidebar.js +0 -298
- package/lib/components/sidebar.ts +0 -395
- package/lib/components/stack/BaseStack.d.ts +0 -65
- package/lib/components/stack/BaseStack.d.ts.map +0 -1
- package/lib/components/stack/BaseStack.js +0 -274
- package/lib/components/stack/BaseStack.ts +0 -328
- package/lib/components/stack/HStack.d.ts +0 -18
- package/lib/components/stack/HStack.d.ts.map +0 -1
- package/lib/components/stack/HStack.js +0 -22
- package/lib/components/stack/HStack.ts +0 -25
- package/lib/components/stack/VStack.d.ts +0 -19
- package/lib/components/stack/VStack.d.ts.map +0 -1
- package/lib/components/stack/VStack.js +0 -23
- package/lib/components/stack/VStack.ts +0 -26
- package/lib/components/stack/ZStack.d.ts +0 -18
- package/lib/components/stack/ZStack.d.ts.map +0 -1
- package/lib/components/stack/ZStack.js +0 -22
- package/lib/components/stack/ZStack.ts +0 -25
- package/lib/components/style.d.ts +0 -14
- package/lib/components/style.d.ts.map +0 -1
- package/lib/components/style.js +0 -33
- package/lib/components/style.ts +0 -41
- package/lib/components/switch.d.ts +0 -34
- package/lib/components/switch.d.ts.map +0 -1
- package/lib/components/switch.js +0 -209
- package/lib/components/switch.ts +0 -272
- package/lib/components/table.d.ts +0 -137
- package/lib/components/table.d.ts.map +0 -1
- package/lib/components/table.js +0 -1019
- package/lib/components/table.ts +0 -1225
- package/lib/components/tabs.d.ts +0 -53
- package/lib/components/tabs.d.ts.map +0 -1
- package/lib/components/tabs.js +0 -275
- package/lib/components/tabs.ts +0 -349
- package/lib/components/theme-toggle.d.ts +0 -45
- package/lib/components/theme-toggle.d.ts.map +0 -1
- package/lib/components/theme-toggle.js +0 -218
- package/lib/components/theme-toggle.ts +0 -297
- package/lib/components/tooltip.d.ts +0 -31
- package/lib/components/tooltip.d.ts.map +0 -1
- package/lib/components/tooltip.js +0 -112
- package/lib/components/tooltip.ts +0 -148
- package/lib/components/watcher.d.ts +0 -195
- package/lib/components/watcher.d.ts.map +0 -1
- package/lib/components/watcher.js +0 -241
- package/lib/components/watcher.ts +0 -261
- package/lib/components/write.d.ts +0 -107
- package/lib/components/write.d.ts.map +0 -1
- package/lib/components/write.js +0 -222
- package/lib/components/write.ts +0 -272
- package/lib/data/DataPipeline.d.ts +0 -113
- package/lib/data/DataPipeline.d.ts.map +0 -1
- package/lib/data/DataPipeline.js +0 -359
- package/lib/data/DataPipeline.ts +0 -452
- package/lib/facades/dataframe.jux +0 -0
- package/lib/globals.d.ts +0 -21
- package/lib/reactivity/state.d.ts +0 -36
- package/lib/reactivity/state.d.ts.map +0 -1
- package/lib/reactivity/state.js +0 -67
- package/lib/reactivity/state.ts +0 -78
- package/lib/storage/DataFrame.d.ts +0 -284
- package/lib/storage/DataFrame.d.ts.map +0 -1
- package/lib/storage/DataFrame.js +0 -1022
- package/lib/storage/DataFrame.ts +0 -1195
- package/lib/storage/DataFrameSource.d.ts +0 -158
- package/lib/storage/DataFrameSource.d.ts.map +0 -1
- package/lib/storage/DataFrameSource.js +0 -409
- package/lib/storage/DataFrameSource.ts +0 -556
- package/lib/storage/FileStorage.d.ts +0 -53
- package/lib/storage/FileStorage.d.ts.map +0 -1
- package/lib/storage/FileStorage.js +0 -80
- package/lib/storage/FileStorage.ts +0 -95
- package/lib/storage/IndexedDBDriver.d.ts +0 -75
- package/lib/storage/IndexedDBDriver.d.ts.map +0 -1
- package/lib/storage/IndexedDBDriver.js +0 -177
- package/lib/storage/IndexedDBDriver.ts +0 -226
- package/lib/storage/TabularDriver.d.ts +0 -118
- package/lib/storage/TabularDriver.d.ts.map +0 -1
- package/lib/storage/TabularDriver.js +0 -731
- package/lib/storage/TabularDriver.ts +0 -874
- package/lib/utils/codeparser.d.ts +0 -29
- package/lib/utils/codeparser.d.ts.map +0 -1
- package/lib/utils/codeparser.js +0 -409
- package/lib/utils/fetch.d.ts +0 -176
- package/lib/utils/fetch.d.ts.map +0 -1
- package/lib/utils/fetch.js +0 -427
- package/lib/utils/formatId.d.ts +0 -16
- package/lib/utils/formatId.d.ts.map +0 -1
- package/lib/utils/formatId.js +0 -27
- package/lib/utils/path-resolver.js +0 -23
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* State History Tracker
|
|
3
|
-
* Tracks all state mutations for time-travel debugging and undo/redo
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export interface StateSnapshot<T = any> {
|
|
7
|
-
timestamp: number;
|
|
8
|
-
componentId: string;
|
|
9
|
-
property: string;
|
|
10
|
-
oldValue: T;
|
|
11
|
-
newValue: T;
|
|
12
|
-
stackTrace?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface EventSnapshot {
|
|
16
|
-
timestamp: number;
|
|
17
|
-
componentId: string;
|
|
18
|
-
eventType: 'bind' | 'sync' | 'callback' | 'trigger';
|
|
19
|
-
eventName: string;
|
|
20
|
-
details: Record<string, any>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export class StateHistory {
|
|
24
|
-
private stateSnapshots: StateSnapshot[] = [];
|
|
25
|
-
private eventSnapshots: EventSnapshot[] = [];
|
|
26
|
-
private maxHistory: number = 100;
|
|
27
|
-
private currentIndex: number = -1;
|
|
28
|
-
private isReplaying: boolean = false;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Record a state change
|
|
32
|
-
*/
|
|
33
|
-
recordStateChange<T>(
|
|
34
|
-
componentId: string,
|
|
35
|
-
property: string,
|
|
36
|
-
oldValue: T,
|
|
37
|
-
newValue: T
|
|
38
|
-
): void {
|
|
39
|
-
if (this.isReplaying) return; // Don't record during replay
|
|
40
|
-
|
|
41
|
-
const snapshot: StateSnapshot<T> = {
|
|
42
|
-
timestamp: Date.now(),
|
|
43
|
-
componentId,
|
|
44
|
-
property,
|
|
45
|
-
oldValue,
|
|
46
|
-
newValue,
|
|
47
|
-
stackTrace: new Error().stack
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// Trim future history if we're not at the end
|
|
51
|
-
if (this.currentIndex < this.stateSnapshots.length - 1) {
|
|
52
|
-
this.stateSnapshots = this.stateSnapshots.slice(0, this.currentIndex + 1);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
this.stateSnapshots.push(snapshot);
|
|
56
|
-
this.currentIndex = this.stateSnapshots.length - 1;
|
|
57
|
-
|
|
58
|
-
// Trim if exceeds max
|
|
59
|
-
if (this.stateSnapshots.length > this.maxHistory) {
|
|
60
|
-
this.stateSnapshots.shift();
|
|
61
|
-
this.currentIndex--;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Record an event (bind, sync, callback, trigger)
|
|
67
|
-
*/
|
|
68
|
-
recordEvent(
|
|
69
|
-
componentId: string,
|
|
70
|
-
eventType: 'bind' | 'sync' | 'callback' | 'trigger',
|
|
71
|
-
eventName: string,
|
|
72
|
-
details: Record<string, any> = {}
|
|
73
|
-
): void {
|
|
74
|
-
const snapshot: EventSnapshot = {
|
|
75
|
-
timestamp: Date.now(),
|
|
76
|
-
componentId,
|
|
77
|
-
eventType,
|
|
78
|
-
eventName,
|
|
79
|
-
details
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
this.eventSnapshots.push(snapshot);
|
|
83
|
-
|
|
84
|
-
// Trim if exceeds max
|
|
85
|
-
if (this.eventSnapshots.length > this.maxHistory) {
|
|
86
|
-
this.eventSnapshots.shift();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Get timeline of all changes and events
|
|
92
|
-
*/
|
|
93
|
-
getTimeline(): Array<StateSnapshot | EventSnapshot> {
|
|
94
|
-
return [...this.stateSnapshots, ...this.eventSnapshots]
|
|
95
|
-
.sort((a, b) => a.timestamp - b.timestamp);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Get state snapshots for a specific component
|
|
100
|
-
*/
|
|
101
|
-
getComponentHistory(componentId: string): StateSnapshot[] {
|
|
102
|
-
return this.stateSnapshots.filter(s => s.componentId === componentId);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Get event snapshots for a specific component
|
|
107
|
-
*/
|
|
108
|
-
getComponentEvents(componentId: string): EventSnapshot[] {
|
|
109
|
-
return this.eventSnapshots.filter(s => s.componentId === componentId);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Check if we can roll back
|
|
114
|
-
*/
|
|
115
|
-
canRollback(): boolean {
|
|
116
|
-
return this.currentIndex > 0;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Check if we can roll forward
|
|
121
|
-
*/
|
|
122
|
-
canRollforward(): boolean {
|
|
123
|
-
return this.currentIndex < this.stateSnapshots.length - 1;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Get the current snapshot (for rollback)
|
|
128
|
-
*/
|
|
129
|
-
getCurrentSnapshot(): StateSnapshot | null {
|
|
130
|
-
if (this.currentIndex >= 0 && this.currentIndex < this.stateSnapshots.length) {
|
|
131
|
-
return this.stateSnapshots[this.currentIndex];
|
|
132
|
-
}
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Move index for rollback
|
|
138
|
-
*/
|
|
139
|
-
moveBack(): StateSnapshot | null {
|
|
140
|
-
if (this.canRollback()) {
|
|
141
|
-
this.currentIndex--;
|
|
142
|
-
return this.stateSnapshots[this.currentIndex];
|
|
143
|
-
}
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Move index for rollforward
|
|
149
|
-
*/
|
|
150
|
-
moveForward(): StateSnapshot | null {
|
|
151
|
-
if (this.canRollforward()) {
|
|
152
|
-
this.currentIndex++;
|
|
153
|
-
return this.stateSnapshots[this.currentIndex];
|
|
154
|
-
}
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Mark as replaying to prevent recursive recording
|
|
160
|
-
*/
|
|
161
|
-
startReplay(): void {
|
|
162
|
-
this.isReplaying = true;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* End replay mode
|
|
167
|
-
*/
|
|
168
|
-
endReplay(): void {
|
|
169
|
-
this.isReplaying = false;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Clear all history
|
|
174
|
-
*/
|
|
175
|
-
clear(): void {
|
|
176
|
-
this.stateSnapshots = [];
|
|
177
|
-
this.eventSnapshots = [];
|
|
178
|
-
this.currentIndex = -1;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Get summary statistics
|
|
183
|
-
*/
|
|
184
|
-
getStats() {
|
|
185
|
-
return {
|
|
186
|
-
totalStateChanges: this.stateSnapshots.length,
|
|
187
|
-
totalEvents: this.eventSnapshots.length,
|
|
188
|
-
currentIndex: this.currentIndex,
|
|
189
|
-
canRollback: this.canRollback(),
|
|
190
|
-
canRollforward: this.canRollforward(),
|
|
191
|
-
components: new Set([
|
|
192
|
-
...this.stateSnapshots.map(s => s.componentId),
|
|
193
|
-
...this.eventSnapshots.map(s => s.componentId)
|
|
194
|
-
]).size
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Global singleton
|
|
200
|
-
export const stateHistory = new StateHistory();
|
package/lib/components/icon.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { BaseComponent } from './base/BaseComponent.js';
|
|
2
|
-
export interface IconOptions {
|
|
3
|
-
value?: string;
|
|
4
|
-
size?: string;
|
|
5
|
-
color?: string;
|
|
6
|
-
useEmoji?: boolean;
|
|
7
|
-
iconCollection?: string;
|
|
8
|
-
style?: string;
|
|
9
|
-
class?: string;
|
|
10
|
-
}
|
|
11
|
-
type IconState = {
|
|
12
|
-
value: string;
|
|
13
|
-
size: string;
|
|
14
|
-
color: string;
|
|
15
|
-
useEmoji: boolean;
|
|
16
|
-
iconCollection: string;
|
|
17
|
-
style: string;
|
|
18
|
-
class: string;
|
|
19
|
-
};
|
|
20
|
-
export declare class Icon extends BaseComponent<IconState> {
|
|
21
|
-
constructor(id: string, options?: IconOptions);
|
|
22
|
-
protected getTriggerEvents(): readonly string[];
|
|
23
|
-
protected getCallbackEvents(): readonly string[];
|
|
24
|
-
value(value: string): this;
|
|
25
|
-
size(value: string): this;
|
|
26
|
-
color(value: string): this;
|
|
27
|
-
useEmoji(value: boolean): this;
|
|
28
|
-
iconCollection(value: string): this;
|
|
29
|
-
style(value: string): this;
|
|
30
|
-
class(value: string): this;
|
|
31
|
-
render(targetId?: string | HTMLElement | BaseComponent<any>): this;
|
|
32
|
-
update(prop: string, value: any): void;
|
|
33
|
-
}
|
|
34
|
-
export declare function icon(id: string, options: IconOptions): Icon;
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAOxD,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,SAAS,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,IAAK,SAAQ,aAAa,CAAC,SAAS,CAAC;gBAClC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB;IAYjD,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAI/C,SAAS,CAAC,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAUhD,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKzB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAK9B,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKnC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK1B,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAS1B,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IAiFlE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;CAGzC;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAE3D"}
|
package/lib/components/icon.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { BaseComponent } from './base/BaseComponent.js';
|
|
2
|
-
import { renderIcon, renderEmoji } from './icons.js';
|
|
3
|
-
// Event definitions
|
|
4
|
-
const TRIGGER_EVENTS = [];
|
|
5
|
-
const CALLBACK_EVENTS = [];
|
|
6
|
-
export class Icon extends BaseComponent {
|
|
7
|
-
constructor(id, options = {}) {
|
|
8
|
-
super(id, {
|
|
9
|
-
value: options.value ?? '',
|
|
10
|
-
size: options.size ?? '24px',
|
|
11
|
-
color: options.color ?? '',
|
|
12
|
-
useEmoji: options.useEmoji ?? false,
|
|
13
|
-
iconCollection: options.iconCollection ?? '',
|
|
14
|
-
style: options.style ?? '',
|
|
15
|
-
class: options.class ?? ''
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
getTriggerEvents() {
|
|
19
|
-
return TRIGGER_EVENTS;
|
|
20
|
-
}
|
|
21
|
-
getCallbackEvents() {
|
|
22
|
-
return CALLBACK_EVENTS;
|
|
23
|
-
}
|
|
24
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
25
|
-
* FLUENT API
|
|
26
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
27
|
-
// ✅ Inherited from BaseComponent
|
|
28
|
-
value(value) {
|
|
29
|
-
this.state.value = value;
|
|
30
|
-
return this;
|
|
31
|
-
}
|
|
32
|
-
size(value) {
|
|
33
|
-
this.state.size = value;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
color(value) {
|
|
37
|
-
this.state.color = value;
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
useEmoji(value) {
|
|
41
|
-
this.state.useEmoji = value;
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
iconCollection(value) {
|
|
45
|
-
this.state.iconCollection = value;
|
|
46
|
-
return this;
|
|
47
|
-
}
|
|
48
|
-
style(value) {
|
|
49
|
-
this.state.style = value;
|
|
50
|
-
return this;
|
|
51
|
-
}
|
|
52
|
-
class(value) {
|
|
53
|
-
this.state.class = value;
|
|
54
|
-
return this;
|
|
55
|
-
}
|
|
56
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
57
|
-
* RENDER
|
|
58
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
59
|
-
render(targetId) {
|
|
60
|
-
const container = this._setupContainer(targetId);
|
|
61
|
-
const { value, size, color, useEmoji, iconCollection, style, class: className } = this.state;
|
|
62
|
-
const wrapper = document.createElement('span');
|
|
63
|
-
wrapper.className = 'jux-icon';
|
|
64
|
-
wrapper.id = this._id;
|
|
65
|
-
if (className)
|
|
66
|
-
wrapper.className += ` ${className}`;
|
|
67
|
-
if (style)
|
|
68
|
-
wrapper.setAttribute('style', style);
|
|
69
|
-
const iconElement = useEmoji ? renderEmoji(value) : renderIcon(value, iconCollection);
|
|
70
|
-
iconElement.style.width = size;
|
|
71
|
-
iconElement.style.height = size;
|
|
72
|
-
if (color)
|
|
73
|
-
iconElement.style.color = color;
|
|
74
|
-
wrapper.appendChild(iconElement);
|
|
75
|
-
this._wireStandardEvents(wrapper);
|
|
76
|
-
// Wire sync bindings
|
|
77
|
-
this._syncBindings.forEach(({ property, stateObj, toState, toComponent }) => {
|
|
78
|
-
if (property === 'value') {
|
|
79
|
-
const transform = toComponent || ((v) => String(v));
|
|
80
|
-
stateObj.subscribe((val) => {
|
|
81
|
-
const transformed = transform(val);
|
|
82
|
-
this.state.value = transformed;
|
|
83
|
-
wrapper.innerHTML = '';
|
|
84
|
-
const newIcon = this.state.useEmoji ? renderEmoji(transformed) : renderIcon(transformed, this.state.iconCollection);
|
|
85
|
-
newIcon.style.width = this.state.size;
|
|
86
|
-
newIcon.style.height = this.state.size;
|
|
87
|
-
if (this.state.color)
|
|
88
|
-
newIcon.style.color = this.state.color;
|
|
89
|
-
wrapper.appendChild(newIcon);
|
|
90
|
-
requestAnimationFrame(() => {
|
|
91
|
-
if (window.Iconify) {
|
|
92
|
-
window.Iconify.scan();
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
else if (property === 'size') {
|
|
98
|
-
const transform = toComponent || ((v) => String(v));
|
|
99
|
-
stateObj.subscribe((val) => {
|
|
100
|
-
const transformed = transform(val);
|
|
101
|
-
const icon = wrapper.querySelector('img, svg, span');
|
|
102
|
-
if (icon instanceof HTMLElement) {
|
|
103
|
-
icon.style.width = transformed;
|
|
104
|
-
icon.style.height = transformed;
|
|
105
|
-
}
|
|
106
|
-
this.state.size = transformed;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
else if (property === 'color') {
|
|
110
|
-
const transform = toComponent || ((v) => String(v));
|
|
111
|
-
stateObj.subscribe((val) => {
|
|
112
|
-
const transformed = transform(val);
|
|
113
|
-
const icon = wrapper.querySelector('img, svg, span');
|
|
114
|
-
if (icon instanceof HTMLElement) {
|
|
115
|
-
icon.style.color = transformed;
|
|
116
|
-
}
|
|
117
|
-
this.state.color = transformed;
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
container.appendChild(wrapper);
|
|
122
|
-
requestAnimationFrame(() => {
|
|
123
|
-
if (window.lucide) {
|
|
124
|
-
window.lucide.createIcons();
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
return this;
|
|
128
|
-
}
|
|
129
|
-
update(prop, value) {
|
|
130
|
-
// No reactive updates needed
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
export function icon(id, options) {
|
|
134
|
-
return new Icon(id, options);
|
|
135
|
-
}
|
package/lib/components/icon.ts
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { BaseComponent } from './base/BaseComponent.js';
|
|
2
|
-
import { renderIcon, renderEmoji } from './icons.js';
|
|
3
|
-
|
|
4
|
-
// Event definitions
|
|
5
|
-
const TRIGGER_EVENTS = [] as const;
|
|
6
|
-
const CALLBACK_EVENTS = [] as const;
|
|
7
|
-
|
|
8
|
-
export interface IconOptions {
|
|
9
|
-
value?: string;
|
|
10
|
-
size?: string;
|
|
11
|
-
color?: string;
|
|
12
|
-
useEmoji?: boolean;
|
|
13
|
-
iconCollection?: string;
|
|
14
|
-
style?: string;
|
|
15
|
-
class?: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type IconState = {
|
|
19
|
-
value: string;
|
|
20
|
-
size: string;
|
|
21
|
-
color: string;
|
|
22
|
-
useEmoji: boolean;
|
|
23
|
-
iconCollection: string;
|
|
24
|
-
style: string;
|
|
25
|
-
class: string;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export class Icon extends BaseComponent<IconState> {
|
|
29
|
-
constructor(id: string, options: IconOptions = {}) {
|
|
30
|
-
super(id, {
|
|
31
|
-
value: options.value ?? '',
|
|
32
|
-
size: options.size ?? '24px',
|
|
33
|
-
color: options.color ?? '',
|
|
34
|
-
useEmoji: options.useEmoji ?? false,
|
|
35
|
-
iconCollection: options.iconCollection ?? '',
|
|
36
|
-
style: options.style ?? '',
|
|
37
|
-
class: options.class ?? ''
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
protected getTriggerEvents(): readonly string[] {
|
|
42
|
-
return TRIGGER_EVENTS;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
protected getCallbackEvents(): readonly string[] {
|
|
46
|
-
return CALLBACK_EVENTS;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
50
|
-
* FLUENT API
|
|
51
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
52
|
-
|
|
53
|
-
// ✅ Inherited from BaseComponent
|
|
54
|
-
|
|
55
|
-
value(value: string): this {
|
|
56
|
-
this.state.value = value;
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
size(value: string): this {
|
|
61
|
-
this.state.size = value;
|
|
62
|
-
return this;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
color(value: string): this {
|
|
66
|
-
this.state.color = value;
|
|
67
|
-
return this;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
useEmoji(value: boolean): this {
|
|
71
|
-
this.state.useEmoji = value;
|
|
72
|
-
return this;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
iconCollection(value: string): this {
|
|
76
|
-
this.state.iconCollection = value;
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
style(value: string): this {
|
|
81
|
-
this.state.style = value;
|
|
82
|
-
return this;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
class(value: string): this {
|
|
86
|
-
this.state.class = value;
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
91
|
-
* RENDER
|
|
92
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
93
|
-
|
|
94
|
-
render(targetId?: string | HTMLElement | BaseComponent<any>): this {
|
|
95
|
-
const container = this._setupContainer(targetId);
|
|
96
|
-
|
|
97
|
-
const { value, size, color, useEmoji, iconCollection, style, class: className } = this.state;
|
|
98
|
-
|
|
99
|
-
const wrapper = document.createElement('span');
|
|
100
|
-
wrapper.className = 'jux-icon';
|
|
101
|
-
wrapper.id = this._id;
|
|
102
|
-
if (className) wrapper.className += ` ${className}`;
|
|
103
|
-
if (style) wrapper.setAttribute('style', style);
|
|
104
|
-
|
|
105
|
-
const iconElement = useEmoji ? renderEmoji(value) : renderIcon(value, iconCollection);
|
|
106
|
-
iconElement.style.width = size;
|
|
107
|
-
iconElement.style.height = size;
|
|
108
|
-
if (color) iconElement.style.color = color;
|
|
109
|
-
|
|
110
|
-
wrapper.appendChild(iconElement);
|
|
111
|
-
|
|
112
|
-
this._wireStandardEvents(wrapper);
|
|
113
|
-
|
|
114
|
-
// Wire sync bindings
|
|
115
|
-
this._syncBindings.forEach(({ property, stateObj, toState, toComponent }) => {
|
|
116
|
-
if (property === 'value') {
|
|
117
|
-
const transform = toComponent || ((v: any) => String(v));
|
|
118
|
-
|
|
119
|
-
stateObj.subscribe((val: any) => {
|
|
120
|
-
const transformed = transform(val);
|
|
121
|
-
this.state.value = transformed;
|
|
122
|
-
|
|
123
|
-
wrapper.innerHTML = '';
|
|
124
|
-
const newIcon = this.state.useEmoji ? renderEmoji(transformed) : renderIcon(transformed, this.state.iconCollection);
|
|
125
|
-
newIcon.style.width = this.state.size;
|
|
126
|
-
newIcon.style.height = this.state.size;
|
|
127
|
-
if (this.state.color) newIcon.style.color = this.state.color;
|
|
128
|
-
wrapper.appendChild(newIcon);
|
|
129
|
-
|
|
130
|
-
requestAnimationFrame(() => {
|
|
131
|
-
if ((window as any).Iconify) {
|
|
132
|
-
(window as any).Iconify.scan();
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
else if (property === 'size') {
|
|
138
|
-
const transform = toComponent || ((v: any) => String(v));
|
|
139
|
-
|
|
140
|
-
stateObj.subscribe((val: any) => {
|
|
141
|
-
const transformed = transform(val);
|
|
142
|
-
const icon = wrapper.querySelector('img, svg, span');
|
|
143
|
-
if (icon instanceof HTMLElement) {
|
|
144
|
-
icon.style.width = transformed;
|
|
145
|
-
icon.style.height = transformed;
|
|
146
|
-
}
|
|
147
|
-
this.state.size = transformed;
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
else if (property === 'color') {
|
|
151
|
-
const transform = toComponent || ((v: any) => String(v));
|
|
152
|
-
|
|
153
|
-
stateObj.subscribe((val: any) => {
|
|
154
|
-
const transformed = transform(val);
|
|
155
|
-
const icon = wrapper.querySelector('img, svg, span');
|
|
156
|
-
if (icon instanceof HTMLElement) {
|
|
157
|
-
icon.style.color = transformed;
|
|
158
|
-
}
|
|
159
|
-
this.state.color = transformed;
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
container.appendChild(wrapper);
|
|
165
|
-
|
|
166
|
-
requestAnimationFrame(() => {
|
|
167
|
-
if ((window as any).lucide) {
|
|
168
|
-
(window as any).lucide.createIcons();
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
return this;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
update(prop: string, value: any): void {
|
|
176
|
-
// No reactive updates needed
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export function icon(id: string, options: IconOptions): Icon {
|
|
181
|
-
return new Icon(id, options);
|
|
182
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Icon utilities for components
|
|
3
|
-
* All icons are rendered through Iconify with configurable collections (lucide, heroicons, streamline, etc.)
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Render an icon from emoji, icon name, or image path
|
|
7
|
-
* @param value - Emoji (🚀), icon name (rocket), or image path (/icon.png)
|
|
8
|
-
* @param collection - Optional icon collection override (lucide, mdi, tabler, etc.)
|
|
9
|
-
* @returns HTMLElement containing the icon
|
|
10
|
-
*
|
|
11
|
-
* Usage:
|
|
12
|
-
* const icon = renderIcon('🚀'); // Default collection icon
|
|
13
|
-
* const icon = renderIcon('📎', 'mdi'); // MDI collection
|
|
14
|
-
* const icon = renderIcon('lucide:rocket'); // Explicit lucide collection
|
|
15
|
-
* const icon = renderIcon('mdi:home'); // Explicit mdi collection
|
|
16
|
-
* const icon = renderIcon('/icon.png'); // Image element
|
|
17
|
-
*/
|
|
18
|
-
export declare function renderIcon(value: string, collection?: string): HTMLElement;
|
|
19
|
-
/**
|
|
20
|
-
* Render raw emoji without conversion
|
|
21
|
-
* @param emoji - The emoji character
|
|
22
|
-
* @returns HTMLElement containing just the emoji
|
|
23
|
-
*/
|
|
24
|
-
export declare function renderEmoji(emoji: string): HTMLElement;
|
|
25
|
-
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["icons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqSH;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,WAAW,CAoC1E;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAEtD"}
|