@pathscale/ui 0.0.150 → 0.0.152

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.
Files changed (2) hide show
  1. package/dist/index.js +39 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10568,6 +10568,33 @@ const FloatingDockDesktop = (props)=>{
10568
10568
  let prevTime = 0;
10569
10569
  let lastMousePos = 1 / 0;
10570
10570
  let loopRunning = false;
10571
+ let anchorCenters = [];
10572
+ const captureAnchors = ()=>{
10573
+ for(let i = 0; i < itemSprings.length; i++){
10574
+ const s = itemSprings[i];
10575
+ s.sW.snap();
10576
+ s.sH.snap();
10577
+ s.sIW.snap();
10578
+ s.sIH.snap();
10579
+ if (s.wrapRef) {
10580
+ s.wrapRef.style.width = `${s.sW.get()}px`;
10581
+ s.wrapRef.style.height = `${s.sH.get()}px`;
10582
+ }
10583
+ if (s.iconRef) {
10584
+ s.iconRef.style.width = `${s.sIW.get()}px`;
10585
+ s.iconRef.style.height = `${s.sIH.get()}px`;
10586
+ }
10587
+ }
10588
+ stopLoop();
10589
+ anchorCenters = [];
10590
+ for(let i = 0; i < itemSprings.length; i++){
10591
+ const wrap = itemSprings[i].wrapRef;
10592
+ if (wrap) {
10593
+ const b = wrap.getBoundingClientRect();
10594
+ anchorCenters[i] = isH() ? b.x + b.width / 2 : b.y + b.height / 2;
10595
+ }
10596
+ }
10597
+ };
10571
10598
  const startLoop = ()=>{
10572
10599
  if (loopRunning || !cfg.magnify) return;
10573
10600
  loopRunning = true;
@@ -10585,18 +10612,10 @@ const FloatingDockDesktop = (props)=>{
10585
10612
  const mp = mousePos();
10586
10613
  if (mp !== lastMousePos) {
10587
10614
  lastMousePos = mp;
10588
- const centers = [];
10589
- for(let i = 0; i < itemSprings.length; i++){
10590
- const wrap = itemSprings[i].wrapRef;
10591
- if (wrap) {
10592
- const b = wrap.getBoundingClientRect();
10593
- centers[i] = isH() ? b.x + b.width / 2 : b.y + b.height / 2;
10594
- } else centers[i] = 0;
10595
- }
10596
10615
  for(let i = 0; i < itemSprings.length; i++){
10597
10616
  const s = itemSprings[i];
10598
- if (!s.wrapRef) continue;
10599
- const dist = Math.abs(mp - centers[i]);
10617
+ if (!s.wrapRef || void 0 === anchorCenters[i]) continue;
10618
+ const dist = Math.abs(mp - anchorCenters[i]);
10600
10619
  const ts = mp === 1 / 0 ? cfg.baseSize : mapRange(dist, 0, cfg.magnifyRange, cfg.hoverSize, cfg.baseSize);
10601
10620
  const ti = mp === 1 / 0 ? cfg.iconSize : mapRange(dist, 0, cfg.magnifyRange, cfg.hoverIconSize, cfg.iconSize);
10602
10621
  s.sW.set(ts);
@@ -10628,20 +10647,20 @@ const FloatingDockDesktop = (props)=>{
10628
10647
  if (allSettled) return void stopLoop();
10629
10648
  rafId = requestAnimationFrame(tick);
10630
10649
  };
10631
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
10632
- if (!cfg.magnify) return;
10633
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
10634
- mousePos();
10635
- startLoop();
10636
- });
10637
- });
10638
10650
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
10639
10651
  stopLoop();
10640
10652
  });
10641
10653
  return (()=>{
10642
10654
  var _el$6 = FloatingDock_tmpl$5();
10643
- _el$6.addEventListener("mouseleave", ()=>setMousePos(1 / 0));
10644
- _el$6.$$mousemove = (e)=>setMousePos(isH() ? e.clientX : e.clientY);
10655
+ _el$6.addEventListener("mouseleave", ()=>{
10656
+ setMousePos(1 / 0);
10657
+ startLoop();
10658
+ });
10659
+ _el$6.$$mousemove = (e)=>{
10660
+ setMousePos(isH() ? e.clientX : e.clientY);
10661
+ startLoop();
10662
+ };
10663
+ _el$6.addEventListener("mouseenter", captureAnchors);
10645
10664
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
10646
10665
  get each () {
10647
10666
  return props.items;
@@ -11037,7 +11056,7 @@ const GlassPanel = (props)=>{
11037
11056
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$5, "id", contentId);
11038
11057
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, ()=>local.children);
11039
11058
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
11040
- var _v$3 = !local.collapsible || isOpen() ? "1fr" : "0fr", _v$4 = `overflow-hidden ${contentClasses()}`;
11059
+ var _v$3 = !local.collapsible || isOpen() ? "1fr" : "0fr", _v$4 = `${!local.collapsible || isOpen() ? "overflow-visible" : "overflow-hidden"} ${contentClasses()}`;
11041
11060
  _v$3 !== _p$.e && (null != (_p$.e = _v$3) ? _el$5.style.setProperty("grid-template-rows", _v$3) : _el$5.style.removeProperty("grid-template-rows"));
11042
11061
  _v$4 !== _p$.t && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$6, _p$.t = _v$4);
11043
11062
  return _p$;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/ui",
3
- "version": "0.0.150",
3
+ "version": "0.0.152",
4
4
  "author": "pathscale",
5
5
  "repository": {
6
6
  "type": "git",