@vanduo-oss/framework 1.4.6 → 1.5.0
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/CHANGELOG.md +11 -0
- package/README.md +9 -4
- package/css/primitives/primitives.css +257 -0
- package/css/vanduo.css +7 -0
- package/dist/build-info.json +3 -3
- package/dist/vanduo-core.css +436 -1
- package/dist/vanduo-core.css.map +1 -1
- package/dist/vanduo-core.min.css +2 -2
- package/dist/vanduo-core.min.css.map +1 -1
- package/dist/vanduo.cjs.js +33 -14
- package/dist/vanduo.cjs.js.map +2 -2
- package/dist/vanduo.cjs.min.js +5 -5
- package/dist/vanduo.cjs.min.js.map +3 -3
- package/dist/vanduo.css +436 -1
- package/dist/vanduo.css.map +1 -1
- package/dist/vanduo.esm.js +33 -14
- package/dist/vanduo.esm.js.map +2 -2
- package/dist/vanduo.esm.min.js +5 -5
- package/dist/vanduo.esm.min.js.map +3 -3
- package/dist/vanduo.js +33 -14
- package/dist/vanduo.js.map +2 -2
- package/dist/vanduo.min.css +2 -2
- package/dist/vanduo.min.css.map +1 -1
- package/dist/vanduo.min.js +5 -5
- package/dist/vanduo.min.js.map +3 -3
- package/js/components/spotlight.js +46 -16
- package/package.json +1 -1
- package/js/components/vd-hex.js +0 -838
- package/js/utils/hex-math.js +0 -233
package/dist/vanduo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Vanduo v1.
|
|
1
|
+
/*! Vanduo v1.5.0 | Built: 2026-06-18T19:13:58.613Z | git:8f0e1b5 | development */
|
|
2
2
|
(() => {
|
|
3
3
|
// js/utils/lifecycle.js
|
|
4
4
|
(function() {
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
// js/vanduo.js
|
|
177
177
|
(function() {
|
|
178
178
|
"use strict";
|
|
179
|
-
const VANDUO_VERSION = true ? "1.
|
|
179
|
+
const VANDUO_VERSION = true ? "1.5.0" : "0.0.0-dev";
|
|
180
180
|
const hasOwn = Object.prototype.hasOwnProperty;
|
|
181
181
|
const Vanduo2 = {
|
|
182
182
|
version: VANDUO_VERSION,
|
|
@@ -10416,6 +10416,7 @@
|
|
|
10416
10416
|
_cleanup: [],
|
|
10417
10417
|
_boundTriggers: /* @__PURE__ */ new WeakMap(),
|
|
10418
10418
|
_triggerElement: null,
|
|
10419
|
+
_currentTarget: null,
|
|
10419
10420
|
init: function(root) {
|
|
10420
10421
|
const triggers = window.Vanduo.queryAll(root, "[data-vd-spotlight]");
|
|
10421
10422
|
triggers.forEach((trigger) => {
|
|
@@ -10484,8 +10485,29 @@
|
|
|
10484
10485
|
document.addEventListener("keydown", escHandler);
|
|
10485
10486
|
this._cleanup.push(() => document.removeEventListener("keydown", escHandler));
|
|
10486
10487
|
overlay.addEventListener("click", () => this.stop());
|
|
10488
|
+
const reposition = () => {
|
|
10489
|
+
if (this._active && this._currentTarget) this._positionTooltip(this._currentTarget);
|
|
10490
|
+
};
|
|
10491
|
+
window.addEventListener("scroll", reposition, { passive: true });
|
|
10492
|
+
window.addEventListener("resize", reposition);
|
|
10493
|
+
this._cleanup.push(() => window.removeEventListener("scroll", reposition));
|
|
10494
|
+
this._cleanup.push(() => window.removeEventListener("resize", reposition));
|
|
10487
10495
|
this._showStep(this._currentStep);
|
|
10488
10496
|
},
|
|
10497
|
+
_positionTooltip: function(target) {
|
|
10498
|
+
const tooltip = this._elements.tooltip;
|
|
10499
|
+
if (!tooltip || !target || !target.isConnected) return;
|
|
10500
|
+
const rect = target.getBoundingClientRect();
|
|
10501
|
+
const tRect = tooltip.getBoundingClientRect();
|
|
10502
|
+
let top = rect.bottom + 12 + window.scrollY;
|
|
10503
|
+
let left = rect.left + (rect.width - tRect.width) / 2 + window.scrollX;
|
|
10504
|
+
left = Math.max(8, Math.min(left, window.innerWidth - tRect.width - 8));
|
|
10505
|
+
if (top + tRect.height > window.innerHeight + window.scrollY) {
|
|
10506
|
+
top = rect.top - tRect.height - 12 + window.scrollY;
|
|
10507
|
+
}
|
|
10508
|
+
tooltip.style.top = top + "px";
|
|
10509
|
+
tooltip.style.left = left + "px";
|
|
10510
|
+
},
|
|
10489
10511
|
_showStep: function(index) {
|
|
10490
10512
|
const step = this._steps[index];
|
|
10491
10513
|
if (!step) return;
|
|
@@ -10558,19 +10580,15 @@
|
|
|
10558
10580
|
footer.appendChild(counter);
|
|
10559
10581
|
footer.appendChild(actions);
|
|
10560
10582
|
tooltip.appendChild(footer);
|
|
10583
|
+
this._currentTarget = target || null;
|
|
10561
10584
|
if (target) {
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
top = rect.top - tRect.height - 12 + window.scrollY;
|
|
10570
|
-
}
|
|
10571
|
-
tooltip.style.top = top + "px";
|
|
10572
|
-
tooltip.style.left = left + "px";
|
|
10573
|
-
});
|
|
10585
|
+
let frames = 0;
|
|
10586
|
+
const settle = () => {
|
|
10587
|
+
if (!this._active || this._currentTarget !== target) return;
|
|
10588
|
+
this._positionTooltip(target);
|
|
10589
|
+
if (frames++ < 30) requestAnimationFrame(settle);
|
|
10590
|
+
};
|
|
10591
|
+
requestAnimationFrame(settle);
|
|
10574
10592
|
}
|
|
10575
10593
|
document.dispatchEvent(new CustomEvent("spotlight:step", {
|
|
10576
10594
|
detail: { index, step: index, total, data: step }
|
|
@@ -10611,6 +10629,7 @@
|
|
|
10611
10629
|
this._elements = {};
|
|
10612
10630
|
this._steps = [];
|
|
10613
10631
|
this._currentStep = 0;
|
|
10632
|
+
this._currentTarget = null;
|
|
10614
10633
|
if (this._triggerElement && this._triggerElement.isConnected && typeof this._triggerElement.focus === "function") {
|
|
10615
10634
|
this._triggerElement.focus();
|
|
10616
10635
|
}
|