@squadbase/vantage 0.2.1 → 0.2.3
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 +6 -2
- package/dist/{chunk-UHZ7XSAN.js → chunk-3QKPNWKJ.js} +3 -3
- package/dist/{chunk-UHZ7XSAN.js.map → chunk-3QKPNWKJ.js.map} +1 -1
- package/dist/cli.js +395 -52
- package/dist/cli.js.map +1 -1
- package/dist/components/index.js +40 -10
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/vite/index.js +1 -1
- package/docs/en/agent-skills.md +21 -4
- package/docs/en/changelog.md +55 -0
- package/docs/en/cli-reference.md +53 -2
- package/docs/en/parts/echart.md +4 -2
- package/docs/ja/agent-skills.md +21 -4
- package/docs/ja/changelog.md +50 -0
- package/docs/ja/cli-reference.md +53 -2
- package/docs/ja/parts/echart.md +3 -2
- package/package.json +1 -1
- package/skills/vantage-add-feature/SKILL.md +12 -2
- package/skills/vantage-app/SKILL.md +1 -1
- package/skills/vantage-pitfalls/SKILL.md +3 -2
- package/templates/AGENTS.md +14 -10
package/dist/components/index.js
CHANGED
|
@@ -517,6 +517,45 @@ function sameChartTokens(a, b) {
|
|
|
517
517
|
if (!a || !b) return false;
|
|
518
518
|
return a.series.length === b.series.length && a.series.every((color, i) => color === b.series[i]) && a.foreground === b.foreground && a.mutedForeground === b.mutedForeground && a.border === b.border && a.popover === b.popover && a.popoverForeground === b.popoverForeground;
|
|
519
519
|
}
|
|
520
|
+
function watchChartTokens(onChange) {
|
|
521
|
+
if (typeof document === "undefined") return () => {
|
|
522
|
+
};
|
|
523
|
+
let frame = 0;
|
|
524
|
+
const schedule = () => {
|
|
525
|
+
if (frame) return;
|
|
526
|
+
frame = requestAnimationFrame(() => {
|
|
527
|
+
frame = 0;
|
|
528
|
+
onChange();
|
|
529
|
+
});
|
|
530
|
+
};
|
|
531
|
+
const themeObserver = new MutationObserver(schedule);
|
|
532
|
+
const attributeFilter = ["class", "style", "data-theme"];
|
|
533
|
+
themeObserver.observe(document.documentElement, { attributes: true, attributeFilter });
|
|
534
|
+
if (document.body) themeObserver.observe(document.body, { attributes: true, attributeFilter });
|
|
535
|
+
const styleObserver = new MutationObserver(schedule);
|
|
536
|
+
if (document.head) {
|
|
537
|
+
styleObserver.observe(document.head, {
|
|
538
|
+
childList: true,
|
|
539
|
+
subtree: true,
|
|
540
|
+
characterData: true,
|
|
541
|
+
attributes: true,
|
|
542
|
+
attributeFilter: ["href", "media", "disabled"]
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
const onLoad = (event) => {
|
|
546
|
+
if (event.target instanceof HTMLLinkElement) schedule();
|
|
547
|
+
};
|
|
548
|
+
document.addEventListener("load", onLoad, true);
|
|
549
|
+
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
550
|
+
media.addEventListener("change", schedule);
|
|
551
|
+
return () => {
|
|
552
|
+
if (frame) cancelAnimationFrame(frame);
|
|
553
|
+
themeObserver.disconnect();
|
|
554
|
+
styleObserver.disconnect();
|
|
555
|
+
document.removeEventListener("load", onLoad, true);
|
|
556
|
+
media.removeEventListener("change", schedule);
|
|
557
|
+
};
|
|
558
|
+
}
|
|
520
559
|
function axisTheme(tokens, splitLine) {
|
|
521
560
|
const line = tokens.border ?? void 0;
|
|
522
561
|
return {
|
|
@@ -575,16 +614,7 @@ var EChart = forwardRef(function EChart2({
|
|
|
575
614
|
});
|
|
576
615
|
};
|
|
577
616
|
sync();
|
|
578
|
-
|
|
579
|
-
const attributeFilter = ["class", "style", "data-theme"];
|
|
580
|
-
observer.observe(document.documentElement, { attributes: true, attributeFilter });
|
|
581
|
-
if (document.body) observer.observe(document.body, { attributes: true, attributeFilter });
|
|
582
|
-
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
583
|
-
media.addEventListener("change", sync);
|
|
584
|
-
return () => {
|
|
585
|
-
observer.disconnect();
|
|
586
|
-
media.removeEventListener("change", sync);
|
|
587
|
-
};
|
|
617
|
+
return watchChartTokens(sync);
|
|
588
618
|
}, [theme]);
|
|
589
619
|
const autoTheme = useMemo(() => tokens ? buildChartTheme(tokens) : void 0, [tokens]);
|
|
590
620
|
const resolvedTheme = theme ?? autoTheme;
|