juxscript 1.0.16 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/lib/components/docs-data.json +7 -1
- package/lib/components/req.ts +3 -1
- package/lib/components/token-calculator.ts +1 -68
- package/package.json +1 -1
- package/presets/notion.css +1567 -843
- package/presets/notion.jux +0 -27
package/README.md
CHANGED
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
- [ ] Distributable Bundle (Static Sites)
|
|
13
13
|
- [ ] Tree Shake/Efficiencies.
|
|
14
14
|
|
|
15
|
+
- [ ] Data
|
|
16
|
+
- [ ] Drivers: File, S3, Database.
|
|
17
|
+
- [ ] const d = jux.data('id',{});
|
|
18
|
+
- [ ] d.driver(file|s3|database)
|
|
19
|
+
- [ ] d.items([] | juxitem)
|
|
20
|
+
- [ ] d.store(callback)
|
|
21
|
+
|
|
15
22
|
- [X] Layouts (100% done.)
|
|
16
23
|
- [ ] *Authoring Layout Pages* - `docs`
|
|
17
24
|
- [ ] *Authoring Application Pages* - `docs`
|
|
@@ -22,7 +29,7 @@
|
|
|
22
29
|
- [X] Reactivity (90% done.)
|
|
23
30
|
- [ ] Client Components (99% of what would be needed.)
|
|
24
31
|
- [X] Charts
|
|
25
|
-
- [
|
|
32
|
+
- [X] Poor Intellisense support? Could be this issue. - fixed.
|
|
26
33
|
- [ ] Api Wrapper
|
|
27
34
|
- [X] Params/Active State for Menu/Nav matching - built in.
|
|
28
35
|
- [ ] CDN Bundle (import CDN/'state', 'jux' from cdn.)
|
|
@@ -3471,6 +3471,12 @@
|
|
|
3471
3471
|
"description": "Write - Simple content writer with no component tracking",
|
|
3472
3472
|
"constructor": "jux.write(content: string, options: WriteOptions = {})",
|
|
3473
3473
|
"fluentMethods": [
|
|
3474
|
+
{
|
|
3475
|
+
"name": "html",
|
|
3476
|
+
"params": "(enabled)",
|
|
3477
|
+
"returns": "this",
|
|
3478
|
+
"description": "Set html"
|
|
3479
|
+
},
|
|
3474
3480
|
{
|
|
3475
3481
|
"name": "render",
|
|
3476
3482
|
"params": "(targetSelector?)",
|
|
@@ -3512,5 +3518,5 @@
|
|
|
3512
3518
|
}
|
|
3513
3519
|
],
|
|
3514
3520
|
"version": "1.0.0",
|
|
3515
|
-
"lastUpdated": "2026-01-
|
|
3521
|
+
"lastUpdated": "2026-01-22T14:21:19.068Z"
|
|
3516
3522
|
}
|
package/lib/components/req.ts
CHANGED
|
@@ -211,8 +211,10 @@ export class Req {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
// Starts with match (for parent routes)
|
|
214
|
+
// Must be followed by a path separator or end of string
|
|
214
215
|
// e.g., "/examples/sample" matches "/examples/sample/dashboards"
|
|
215
|
-
|
|
216
|
+
// but "/examples/sam" does NOT match "/examples/sample/dashboards"
|
|
217
|
+
if (href !== '/' && (this.path === href || this.path.startsWith(href + '/'))) {
|
|
216
218
|
return true;
|
|
217
219
|
}
|
|
218
220
|
|
|
@@ -184,9 +184,7 @@ export class TokenCalculator {
|
|
|
184
184
|
const content = wrapper.querySelector('.jux-token-calculator-content');
|
|
185
185
|
if (content) {
|
|
186
186
|
content.innerHTML = this._buildContent();
|
|
187
|
-
|
|
188
|
-
this._animateNumbers();
|
|
189
|
-
}
|
|
187
|
+
|
|
190
188
|
}
|
|
191
189
|
}
|
|
192
190
|
|
|
@@ -195,26 +193,7 @@ export class TokenCalculator {
|
|
|
195
193
|
const { estimates } = summary;
|
|
196
194
|
|
|
197
195
|
return `
|
|
198
|
-
<div class="jux-token-summary">
|
|
199
|
-
<div class="jux-token-stat">
|
|
200
|
-
<div class="jux-token-stat-value" data-value="${summary.juxTokens}">0</div>
|
|
201
|
-
<div class="jux-token-stat-label">JUX Tokens</div>
|
|
202
|
-
</div>
|
|
203
|
-
<div class="jux-token-stat jux-token-stat-highlight">
|
|
204
|
-
<div class="jux-token-stat-value" data-value="${summary.averageTokenSavings}">0</div>
|
|
205
|
-
<div class="jux-token-stat-label">Avg. Tokens Saved</div>
|
|
206
|
-
</div>
|
|
207
|
-
<div class="jux-token-stat">
|
|
208
|
-
<div class="jux-token-stat-value" data-value="${summary.averageReduction}">0</div>
|
|
209
|
-
<div class="jux-token-stat-label">% Reduction</div>
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
|
|
213
196
|
${this.state.showComparison ? `
|
|
214
|
-
<div class="jux-token-comparison">
|
|
215
|
-
${estimates.map(est => this._buildComparisonBar(est)).join('')}
|
|
216
|
-
</div>
|
|
217
|
-
|
|
218
197
|
<div class="jux-token-details">
|
|
219
198
|
<table class="jux-token-table">
|
|
220
199
|
<thead>
|
|
@@ -267,47 +246,7 @@ export class TokenCalculator {
|
|
|
267
246
|
`;
|
|
268
247
|
}
|
|
269
248
|
|
|
270
|
-
private _animateNumbers(): void {
|
|
271
|
-
if (!this.container) return;
|
|
272
249
|
|
|
273
|
-
const values = this.container.querySelectorAll('.jux-token-stat-value[data-value]');
|
|
274
|
-
const bars = this.container.querySelectorAll('.jux-token-bar[data-width]');
|
|
275
|
-
|
|
276
|
-
// Animate stat numbers
|
|
277
|
-
values.forEach((el) => {
|
|
278
|
-
const target = parseInt((el as HTMLElement).dataset.value || '0');
|
|
279
|
-
this._animateValue(el as HTMLElement, 0, target, 1000);
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
// Animate bars
|
|
283
|
-
setTimeout(() => {
|
|
284
|
-
bars.forEach((bar) => {
|
|
285
|
-
const width = (bar as HTMLElement).dataset.width;
|
|
286
|
-
(bar as HTMLElement).style.width = `${width}%`;
|
|
287
|
-
});
|
|
288
|
-
}, 100);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
private _animateValue(element: HTMLElement, start: number, end: number, duration: number): void {
|
|
292
|
-
const startTime = performance.now();
|
|
293
|
-
|
|
294
|
-
const animate = (currentTime: number) => {
|
|
295
|
-
const elapsed = currentTime - startTime;
|
|
296
|
-
const progress = Math.min(elapsed / duration, 1);
|
|
297
|
-
|
|
298
|
-
// Ease out cubic
|
|
299
|
-
const easeProgress = 1 - Math.pow(1 - progress, 3);
|
|
300
|
-
const current = Math.round(start + (end - start) * easeProgress);
|
|
301
|
-
|
|
302
|
-
element.textContent = current.toLocaleString();
|
|
303
|
-
|
|
304
|
-
if (progress < 1) {
|
|
305
|
-
this.animationFrame = requestAnimationFrame(animate);
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
this.animationFrame = requestAnimationFrame(animate);
|
|
310
|
-
}
|
|
311
250
|
|
|
312
251
|
/* -------------------------
|
|
313
252
|
* Render
|
|
@@ -346,12 +285,6 @@ export class TokenCalculator {
|
|
|
346
285
|
`;
|
|
347
286
|
|
|
348
287
|
container.appendChild(wrapper);
|
|
349
|
-
|
|
350
|
-
// Trigger animations
|
|
351
|
-
if (this.state.animated) {
|
|
352
|
-
requestAnimationFrame(() => this._animateNumbers());
|
|
353
|
-
}
|
|
354
|
-
|
|
355
288
|
return this;
|
|
356
289
|
}
|
|
357
290
|
|