@pg-labs-incubator/cobweb 0.0.7 → 0.0.8
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getOwner as
|
|
1
|
+
import{getOwner as p,onCleanup as a}from"solid-js";import{applySpringMotion as f}from"./spring";const b=0.5;function S(n,c,s={}){let i,t,o=0;const l=new ResizeObserver(([d])=>{const e=d?.borderBoxSize[0];if(e!==void 0){if(e.inlineSize!==t||getComputedStyle(n).opacity==="0")i?.cancel(),n.style.blockSize=`${e.blockSize}px`;else if(i?.playState==="running")i.retarget(e.blockSize);else if(Math.abs(e.blockSize-o)>=b)i=f(n,"block-size",o,e.blockSize,{role:"spatial",speed:"default",...s,unit:"px"});else return;t=e.inlineSize,o=e.blockSize;}}),r={cancel(){l.disconnect(),i?.cancel();},async settled(){await i?.finished.catch(()=>{});}};return l.observe(c,{box:"border-box"}),p()!==null&&a(r.cancel),r;}export{S as followHeight};
|
|
@@ -31,7 +31,8 @@ export interface FollowedHeight {
|
|
|
31
31
|
*
|
|
32
32
|
* The container must clip what overflows it, as the content does while the container grows, and
|
|
33
33
|
* while an expressive spring overshoots as it shrinks. It holds nothing but its content, without
|
|
34
|
-
* padding or a border of its own
|
|
34
|
+
* padding or a border of its own, and nothing else sets its height, which springs from where it was
|
|
35
|
+
* last left. Height here is the block size, in a vertical writing mode too.
|
|
35
36
|
*
|
|
36
37
|
* ```tsx
|
|
37
38
|
* onMount(() => void followHeight(frame, content));
|