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
package/lib/components/hero.ts
DELETED
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { BaseComponent, BaseState } from './base/BaseComponent.js';
|
|
2
|
-
|
|
3
|
-
// Event definitions - Hero is display-only, but CTA button can trigger actions
|
|
4
|
-
const TRIGGER_EVENTS = [] as const;
|
|
5
|
-
const CALLBACK_EVENTS = ['ctaClick'] as const;
|
|
6
|
-
|
|
7
|
-
export interface HeroOptions {
|
|
8
|
-
title?: string;
|
|
9
|
-
subtitle?: string;
|
|
10
|
-
content?: string;
|
|
11
|
-
cta?: string;
|
|
12
|
-
ctaLink?: string;
|
|
13
|
-
backgroundImage?: string | { url: string; size?: string; repeat?: string };
|
|
14
|
-
backgroundOverlay?: boolean;
|
|
15
|
-
variant?: 'default' | 'centered' | 'split';
|
|
16
|
-
centered?: boolean;
|
|
17
|
-
style?: string;
|
|
18
|
-
class?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
type HeroState = BaseState & {
|
|
22
|
-
title: string;
|
|
23
|
-
subtitle: string;
|
|
24
|
-
content: string;
|
|
25
|
-
cta: string;
|
|
26
|
-
ctaLink: string;
|
|
27
|
-
backgroundImage: { url: string; size: string; repeat: string };
|
|
28
|
-
backgroundOverlay: boolean;
|
|
29
|
-
variant: string;
|
|
30
|
-
centered: boolean;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export class Hero extends BaseComponent<HeroState> {
|
|
34
|
-
constructor(id: string, options: HeroOptions = {}) {
|
|
35
|
-
const bgImage = typeof options.backgroundImage === 'string'
|
|
36
|
-
? { url: options.backgroundImage, size: 'cover', repeat: 'no-repeat' }
|
|
37
|
-
: options.backgroundImage || { url: '', size: 'cover', repeat: 'no-repeat' };
|
|
38
|
-
|
|
39
|
-
super(id, {
|
|
40
|
-
title: options.title ?? '',
|
|
41
|
-
subtitle: options.subtitle ?? '',
|
|
42
|
-
content: options.content ?? '',
|
|
43
|
-
cta: options.cta ?? '',
|
|
44
|
-
ctaLink: options.ctaLink ?? '#',
|
|
45
|
-
backgroundImage: { url: bgImage.url, size: bgImage.size || 'cover', repeat: bgImage.repeat || 'no-repeat' },
|
|
46
|
-
backgroundOverlay: options.backgroundOverlay ?? false,
|
|
47
|
-
variant: options.variant ?? 'default',
|
|
48
|
-
centered: options.centered ?? false,
|
|
49
|
-
style: options.style ?? '',
|
|
50
|
-
class: options.class ?? ''
|
|
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
|
-
* REACTIVE DOM UPDATES
|
|
64
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Called automatically by BaseComponent when state changes.
|
|
68
|
-
* Centralizes DOM manipulation so setters don't have to drill/repeat logic.
|
|
69
|
-
*/
|
|
70
|
-
update(prop: string, value: any): void {
|
|
71
|
-
super.update(prop, value); // Handle base properties
|
|
72
|
-
|
|
73
|
-
const hero = document.getElementById(this._id);
|
|
74
|
-
if (!hero) return;
|
|
75
|
-
|
|
76
|
-
const contentContainer = hero.querySelector('.jux-hero-content');
|
|
77
|
-
if (!contentContainer) return;
|
|
78
|
-
|
|
79
|
-
switch (prop) {
|
|
80
|
-
case 'title':
|
|
81
|
-
let titleEl = document.getElementById(`${this._id}-title`);
|
|
82
|
-
if (!titleEl) {
|
|
83
|
-
// ✅ Create title element if it doesn't exist
|
|
84
|
-
titleEl = document.createElement('h1');
|
|
85
|
-
titleEl.className = 'jux-hero-title';
|
|
86
|
-
titleEl.id = `${this._id}-title`;
|
|
87
|
-
contentContainer.insertBefore(titleEl, contentContainer.firstChild);
|
|
88
|
-
}
|
|
89
|
-
titleEl.textContent = value;
|
|
90
|
-
break;
|
|
91
|
-
|
|
92
|
-
case 'subtitle':
|
|
93
|
-
let subtitleEl = document.getElementById(`${this._id}-subtitle`);
|
|
94
|
-
if (!subtitleEl) {
|
|
95
|
-
// ✅ Create subtitle element if it doesn't exist
|
|
96
|
-
subtitleEl = document.createElement('p');
|
|
97
|
-
subtitleEl.className = 'jux-hero-subtitle';
|
|
98
|
-
subtitleEl.id = `${this._id}-subtitle`;
|
|
99
|
-
|
|
100
|
-
// Insert after title if exists, otherwise at start
|
|
101
|
-
const titleEl = document.getElementById(`${this._id}-title`);
|
|
102
|
-
if (titleEl) {
|
|
103
|
-
titleEl.after(subtitleEl);
|
|
104
|
-
} else {
|
|
105
|
-
contentContainer.insertBefore(subtitleEl, contentContainer.firstChild);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
subtitleEl.textContent = value;
|
|
109
|
-
break;
|
|
110
|
-
|
|
111
|
-
case 'content':
|
|
112
|
-
let contentEl = hero.querySelector('.jux-hero-body');
|
|
113
|
-
if (!contentEl) {
|
|
114
|
-
// ✅ Create content element if it doesn't exist
|
|
115
|
-
contentEl = document.createElement('div');
|
|
116
|
-
contentEl.className = 'jux-hero-body';
|
|
117
|
-
|
|
118
|
-
// Insert after subtitle if exists, otherwise after title, otherwise at start
|
|
119
|
-
const subtitleEl = document.getElementById(`${this._id}-subtitle`);
|
|
120
|
-
const titleEl = document.getElementById(`${this._id}-title`);
|
|
121
|
-
if (subtitleEl) {
|
|
122
|
-
subtitleEl.after(contentEl);
|
|
123
|
-
} else if (titleEl) {
|
|
124
|
-
titleEl.after(contentEl);
|
|
125
|
-
} else {
|
|
126
|
-
contentContainer.insertBefore(contentEl, contentContainer.firstChild);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
contentEl.innerHTML = value;
|
|
130
|
-
break;
|
|
131
|
-
|
|
132
|
-
case 'cta':
|
|
133
|
-
let ctaEl = hero.querySelector('.jux-hero-cta') as HTMLAnchorElement;
|
|
134
|
-
if (!ctaEl) {
|
|
135
|
-
// ✅ Create CTA element if it doesn't exist
|
|
136
|
-
ctaEl = document.createElement('a');
|
|
137
|
-
ctaEl.className = 'jux-hero-cta';
|
|
138
|
-
ctaEl.href = this.state.ctaLink;
|
|
139
|
-
|
|
140
|
-
ctaEl.addEventListener('click', (e) => {
|
|
141
|
-
this._triggerCallback('ctaClick', e);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
contentContainer.appendChild(ctaEl);
|
|
145
|
-
}
|
|
146
|
-
ctaEl.textContent = value;
|
|
147
|
-
break;
|
|
148
|
-
|
|
149
|
-
case 'ctaLink':
|
|
150
|
-
const ctaLinkEl = hero.querySelector('.jux-hero-cta') as HTMLAnchorElement;
|
|
151
|
-
if (ctaLinkEl) ctaLinkEl.href = value;
|
|
152
|
-
break;
|
|
153
|
-
|
|
154
|
-
case 'backgroundImage':
|
|
155
|
-
hero.style.backgroundImage = `url(${value.url})`;
|
|
156
|
-
hero.style.backgroundSize = value.size;
|
|
157
|
-
hero.style.backgroundRepeat = value.repeat;
|
|
158
|
-
break;
|
|
159
|
-
|
|
160
|
-
case 'centered':
|
|
161
|
-
hero.classList.toggle('jux-hero-centered', value);
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
167
|
-
* FLUENT API (Simplified - just updates state)
|
|
168
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
169
|
-
|
|
170
|
-
title(value: string): this {
|
|
171
|
-
this.state.title = value; // Triggers update('title', value) via Proxy
|
|
172
|
-
return this;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
subtitle(value: string): this {
|
|
176
|
-
this.state.subtitle = value;
|
|
177
|
-
return this;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
content(value: string): this {
|
|
181
|
-
this.state.content = value;
|
|
182
|
-
return this;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
cta(value: string): this {
|
|
186
|
-
this.state.cta = value;
|
|
187
|
-
return this;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
ctaLink(value: string): this {
|
|
191
|
-
this.state.ctaLink = value;
|
|
192
|
-
return this;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
backgroundImage(value: string | { url: string; size?: string; repeat?: string }): this {
|
|
196
|
-
if (typeof value === 'string') {
|
|
197
|
-
this.state.backgroundImage = { url: value, size: 'cover', repeat: 'no-repeat' };
|
|
198
|
-
} else {
|
|
199
|
-
this.state.backgroundImage = {
|
|
200
|
-
url: value.url,
|
|
201
|
-
size: value.size || 'cover',
|
|
202
|
-
repeat: value.repeat || 'no-repeat'
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
return this;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
backgroundOverlay(value: boolean): this {
|
|
209
|
-
this.state.backgroundOverlay = value;
|
|
210
|
-
return this;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
variant(value: string): this {
|
|
214
|
-
this.state.variant = value;
|
|
215
|
-
return this;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
centered(value: boolean): this {
|
|
219
|
-
this.state.centered = value;
|
|
220
|
-
return this;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/* ═════════════════════════════════════════════════════════════════
|
|
224
|
-
* RENDER
|
|
225
|
-
* ═════════════════════════════════════════════════════════════════ */
|
|
226
|
-
|
|
227
|
-
render(targetId?: string | HTMLElement | BaseComponent<any>): this {
|
|
228
|
-
const container = this._setupContainer(targetId);
|
|
229
|
-
|
|
230
|
-
const { title, subtitle, content, backgroundImage, backgroundOverlay, centered, style, class: className } = this.state;
|
|
231
|
-
|
|
232
|
-
const hero = document.createElement('section');
|
|
233
|
-
hero.className = 'jux-hero';
|
|
234
|
-
hero.id = this._id;
|
|
235
|
-
if (centered) hero.classList.add('jux-hero-centered');
|
|
236
|
-
if (className) hero.className += ` ${className}`;
|
|
237
|
-
if (style) hero.setAttribute('style', style);
|
|
238
|
-
|
|
239
|
-
if (backgroundImage.url) {
|
|
240
|
-
hero.style.backgroundImage = `url(${backgroundImage.url})`;
|
|
241
|
-
hero.style.backgroundSize = backgroundImage.size;
|
|
242
|
-
hero.style.backgroundRepeat = backgroundImage.repeat;
|
|
243
|
-
if (backgroundOverlay) {
|
|
244
|
-
const overlay = document.createElement('div');
|
|
245
|
-
overlay.className = 'jux-hero-overlay';
|
|
246
|
-
hero.appendChild(overlay);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const contentContainer = document.createElement('div');
|
|
251
|
-
contentContainer.className = 'jux-hero-content';
|
|
252
|
-
|
|
253
|
-
if (title) {
|
|
254
|
-
const titleEl = document.createElement('h1');
|
|
255
|
-
titleEl.className = 'jux-hero-title';
|
|
256
|
-
titleEl.id = `${this._id}-title`;
|
|
257
|
-
titleEl.textContent = title;
|
|
258
|
-
contentContainer.appendChild(titleEl);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
if (subtitle) {
|
|
262
|
-
const subtitleEl = document.createElement('p');
|
|
263
|
-
subtitleEl.className = 'jux-hero-subtitle';
|
|
264
|
-
subtitleEl.id = `${this._id}-subtitle`;
|
|
265
|
-
subtitleEl.textContent = subtitle;
|
|
266
|
-
contentContainer.appendChild(subtitleEl);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
if (content) {
|
|
270
|
-
const contentEl = document.createElement('div');
|
|
271
|
-
contentEl.className = 'jux-hero-body';
|
|
272
|
-
contentEl.innerHTML = content;
|
|
273
|
-
contentContainer.appendChild(contentEl);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
if (this.state.cta) {
|
|
277
|
-
const ctaButton = document.createElement('a');
|
|
278
|
-
ctaButton.className = 'jux-hero-cta';
|
|
279
|
-
ctaButton.href = this.state.ctaLink;
|
|
280
|
-
ctaButton.textContent = this.state.cta;
|
|
281
|
-
|
|
282
|
-
ctaButton.addEventListener('click', (e) => {
|
|
283
|
-
this._triggerCallback('ctaClick', e);
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
contentContainer.appendChild(ctaButton);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
hero.appendChild(contentContainer);
|
|
290
|
-
|
|
291
|
-
this._wireStandardEvents(hero);
|
|
292
|
-
this._wireAllSyncs();
|
|
293
|
-
|
|
294
|
-
container.appendChild(hero);
|
|
295
|
-
return this;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export function hero(id: string, options: HeroOptions = {}): Hero {
|
|
300
|
-
return new Hero(id, options);
|
|
301
|
-
}
|
|
302
|
-
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* State History Tracker
|
|
3
|
-
* Tracks all state mutations for time-travel debugging and undo/redo
|
|
4
|
-
*/
|
|
5
|
-
export interface StateSnapshot<T = any> {
|
|
6
|
-
timestamp: number;
|
|
7
|
-
componentId: string;
|
|
8
|
-
property: string;
|
|
9
|
-
oldValue: T;
|
|
10
|
-
newValue: T;
|
|
11
|
-
stackTrace?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface EventSnapshot {
|
|
14
|
-
timestamp: number;
|
|
15
|
-
componentId: string;
|
|
16
|
-
eventType: 'bind' | 'sync' | 'callback' | 'trigger';
|
|
17
|
-
eventName: string;
|
|
18
|
-
details: Record<string, any>;
|
|
19
|
-
}
|
|
20
|
-
export declare class StateHistory {
|
|
21
|
-
private stateSnapshots;
|
|
22
|
-
private eventSnapshots;
|
|
23
|
-
private maxHistory;
|
|
24
|
-
private currentIndex;
|
|
25
|
-
private isReplaying;
|
|
26
|
-
/**
|
|
27
|
-
* Record a state change
|
|
28
|
-
*/
|
|
29
|
-
recordStateChange<T>(componentId: string, property: string, oldValue: T, newValue: T): void;
|
|
30
|
-
/**
|
|
31
|
-
* Record an event (bind, sync, callback, trigger)
|
|
32
|
-
*/
|
|
33
|
-
recordEvent(componentId: string, eventType: 'bind' | 'sync' | 'callback' | 'trigger', eventName: string, details?: Record<string, any>): void;
|
|
34
|
-
/**
|
|
35
|
-
* Get timeline of all changes and events
|
|
36
|
-
*/
|
|
37
|
-
getTimeline(): Array<StateSnapshot | EventSnapshot>;
|
|
38
|
-
/**
|
|
39
|
-
* Get state snapshots for a specific component
|
|
40
|
-
*/
|
|
41
|
-
getComponentHistory(componentId: string): StateSnapshot[];
|
|
42
|
-
/**
|
|
43
|
-
* Get event snapshots for a specific component
|
|
44
|
-
*/
|
|
45
|
-
getComponentEvents(componentId: string): EventSnapshot[];
|
|
46
|
-
/**
|
|
47
|
-
* Check if we can roll back
|
|
48
|
-
*/
|
|
49
|
-
canRollback(): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Check if we can roll forward
|
|
52
|
-
*/
|
|
53
|
-
canRollforward(): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Get the current snapshot (for rollback)
|
|
56
|
-
*/
|
|
57
|
-
getCurrentSnapshot(): StateSnapshot | null;
|
|
58
|
-
/**
|
|
59
|
-
* Move index for rollback
|
|
60
|
-
*/
|
|
61
|
-
moveBack(): StateSnapshot | null;
|
|
62
|
-
/**
|
|
63
|
-
* Move index for rollforward
|
|
64
|
-
*/
|
|
65
|
-
moveForward(): StateSnapshot | null;
|
|
66
|
-
/**
|
|
67
|
-
* Mark as replaying to prevent recursive recording
|
|
68
|
-
*/
|
|
69
|
-
startReplay(): void;
|
|
70
|
-
/**
|
|
71
|
-
* End replay mode
|
|
72
|
-
*/
|
|
73
|
-
endReplay(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Clear all history
|
|
76
|
-
*/
|
|
77
|
-
clear(): void;
|
|
78
|
-
/**
|
|
79
|
-
* Get summary statistics
|
|
80
|
-
*/
|
|
81
|
-
getStats(): {
|
|
82
|
-
totalStateChanges: number;
|
|
83
|
-
totalEvents: number;
|
|
84
|
-
currentIndex: number;
|
|
85
|
-
canRollback: boolean;
|
|
86
|
-
canRollforward: boolean;
|
|
87
|
-
components: number;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
export declare const stateHistory: StateHistory;
|
|
91
|
-
//# sourceMappingURL=StateHistory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StateHistory.d.ts","sourceRoot":"","sources":["StateHistory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,GAAG;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,CAAC;IACZ,QAAQ,EAAE,CAAC,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,qBAAa,YAAY;IACrB,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,UAAU,CAAe;IACjC,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,WAAW,CAAkB;IAErC;;OAEG;IACH,iBAAiB,CAAC,CAAC,EACf,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,CAAC,GACZ,IAAI;IA2BP;;OAEG;IACH,WAAW,CACP,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,EACnD,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAClC,IAAI;IAiBP;;OAEG;IACH,WAAW,IAAI,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;IAKnD;;OAEG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,EAAE;IAIzD;;OAEG;IACH,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,EAAE;IAIxD;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,cAAc,IAAI,OAAO;IAIzB;;OAEG;IACH,kBAAkB,IAAI,aAAa,GAAG,IAAI;IAO1C;;OAEG;IACH,QAAQ,IAAI,aAAa,GAAG,IAAI;IAQhC;;OAEG;IACH,WAAW,IAAI,aAAa,GAAG,IAAI;IAQnC;;OAEG;IACH,WAAW,IAAI,IAAI;IAInB;;OAEG;IACH,SAAS,IAAI,IAAI;IAIjB;;OAEG;IACH,KAAK,IAAI,IAAI;IAMb;;OAEG;IACH,QAAQ;;;;;;;;CAaX;AAGD,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* State History Tracker
|
|
3
|
-
* Tracks all state mutations for time-travel debugging and undo/redo
|
|
4
|
-
*/
|
|
5
|
-
export class StateHistory {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.stateSnapshots = [];
|
|
8
|
-
this.eventSnapshots = [];
|
|
9
|
-
this.maxHistory = 100;
|
|
10
|
-
this.currentIndex = -1;
|
|
11
|
-
this.isReplaying = false;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Record a state change
|
|
15
|
-
*/
|
|
16
|
-
recordStateChange(componentId, property, oldValue, newValue) {
|
|
17
|
-
if (this.isReplaying)
|
|
18
|
-
return; // Don't record during replay
|
|
19
|
-
const snapshot = {
|
|
20
|
-
timestamp: Date.now(),
|
|
21
|
-
componentId,
|
|
22
|
-
property,
|
|
23
|
-
oldValue,
|
|
24
|
-
newValue,
|
|
25
|
-
stackTrace: new Error().stack
|
|
26
|
-
};
|
|
27
|
-
// Trim future history if we're not at the end
|
|
28
|
-
if (this.currentIndex < this.stateSnapshots.length - 1) {
|
|
29
|
-
this.stateSnapshots = this.stateSnapshots.slice(0, this.currentIndex + 1);
|
|
30
|
-
}
|
|
31
|
-
this.stateSnapshots.push(snapshot);
|
|
32
|
-
this.currentIndex = this.stateSnapshots.length - 1;
|
|
33
|
-
// Trim if exceeds max
|
|
34
|
-
if (this.stateSnapshots.length > this.maxHistory) {
|
|
35
|
-
this.stateSnapshots.shift();
|
|
36
|
-
this.currentIndex--;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Record an event (bind, sync, callback, trigger)
|
|
41
|
-
*/
|
|
42
|
-
recordEvent(componentId, eventType, eventName, details = {}) {
|
|
43
|
-
const snapshot = {
|
|
44
|
-
timestamp: Date.now(),
|
|
45
|
-
componentId,
|
|
46
|
-
eventType,
|
|
47
|
-
eventName,
|
|
48
|
-
details
|
|
49
|
-
};
|
|
50
|
-
this.eventSnapshots.push(snapshot);
|
|
51
|
-
// Trim if exceeds max
|
|
52
|
-
if (this.eventSnapshots.length > this.maxHistory) {
|
|
53
|
-
this.eventSnapshots.shift();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get timeline of all changes and events
|
|
58
|
-
*/
|
|
59
|
-
getTimeline() {
|
|
60
|
-
return [...this.stateSnapshots, ...this.eventSnapshots]
|
|
61
|
-
.sort((a, b) => a.timestamp - b.timestamp);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Get state snapshots for a specific component
|
|
65
|
-
*/
|
|
66
|
-
getComponentHistory(componentId) {
|
|
67
|
-
return this.stateSnapshots.filter(s => s.componentId === componentId);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Get event snapshots for a specific component
|
|
71
|
-
*/
|
|
72
|
-
getComponentEvents(componentId) {
|
|
73
|
-
return this.eventSnapshots.filter(s => s.componentId === componentId);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Check if we can roll back
|
|
77
|
-
*/
|
|
78
|
-
canRollback() {
|
|
79
|
-
return this.currentIndex > 0;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Check if we can roll forward
|
|
83
|
-
*/
|
|
84
|
-
canRollforward() {
|
|
85
|
-
return this.currentIndex < this.stateSnapshots.length - 1;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Get the current snapshot (for rollback)
|
|
89
|
-
*/
|
|
90
|
-
getCurrentSnapshot() {
|
|
91
|
-
if (this.currentIndex >= 0 && this.currentIndex < this.stateSnapshots.length) {
|
|
92
|
-
return this.stateSnapshots[this.currentIndex];
|
|
93
|
-
}
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Move index for rollback
|
|
98
|
-
*/
|
|
99
|
-
moveBack() {
|
|
100
|
-
if (this.canRollback()) {
|
|
101
|
-
this.currentIndex--;
|
|
102
|
-
return this.stateSnapshots[this.currentIndex];
|
|
103
|
-
}
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Move index for rollforward
|
|
108
|
-
*/
|
|
109
|
-
moveForward() {
|
|
110
|
-
if (this.canRollforward()) {
|
|
111
|
-
this.currentIndex++;
|
|
112
|
-
return this.stateSnapshots[this.currentIndex];
|
|
113
|
-
}
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Mark as replaying to prevent recursive recording
|
|
118
|
-
*/
|
|
119
|
-
startReplay() {
|
|
120
|
-
this.isReplaying = true;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* End replay mode
|
|
124
|
-
*/
|
|
125
|
-
endReplay() {
|
|
126
|
-
this.isReplaying = false;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Clear all history
|
|
130
|
-
*/
|
|
131
|
-
clear() {
|
|
132
|
-
this.stateSnapshots = [];
|
|
133
|
-
this.eventSnapshots = [];
|
|
134
|
-
this.currentIndex = -1;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Get summary statistics
|
|
138
|
-
*/
|
|
139
|
-
getStats() {
|
|
140
|
-
return {
|
|
141
|
-
totalStateChanges: this.stateSnapshots.length,
|
|
142
|
-
totalEvents: this.eventSnapshots.length,
|
|
143
|
-
currentIndex: this.currentIndex,
|
|
144
|
-
canRollback: this.canRollback(),
|
|
145
|
-
canRollforward: this.canRollforward(),
|
|
146
|
-
components: new Set([
|
|
147
|
-
...this.stateSnapshots.map(s => s.componentId),
|
|
148
|
-
...this.eventSnapshots.map(s => s.componentId)
|
|
149
|
-
]).size
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
// Global singleton
|
|
154
|
-
export const stateHistory = new StateHistory();
|