@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,6 +1,6 @@
1
1
  {
2
2
  "name": "@pg-labs-incubator/cobweb",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Cobweb components library, based on Material 3 design, for SolidJS.",
5
5
  "license": "MPL-2.0",
6
6
  "homepage": "https://pglabs.ai/projects/cobweb",
@@ -1 +1 @@
1
- import{getOwner as a,onCleanup as f}from"solid-js";import{applySpringMotion as b}from"./spring";const g=0.5;function m(o,s,p={}){let i,t;const n=new ResizeObserver(([d])=>{const e=d?.borderBoxSize[0];if(e===void 0)return;const r=getComputedStyle(o),c=Number.parseFloat(r.blockSize);e.inlineSize!==t||r.opacity==="0"?(i?.cancel(),o.style.blockSize=`${e.blockSize}px`):i?.playState==="running"?i.retarget(e.blockSize):Math.abs(e.blockSize-c)>=g&&(i=b(o,"block-size",c,e.blockSize,{role:"spatial",speed:"default",...p,unit:"px"})),t=e.inlineSize;}),l={cancel(){n.disconnect(),i?.cancel();},async settled(){await i?.finished.catch(()=>{});}};return n.observe(s,{box:"border-box"}),a()!==null&&f(l.cancel),l;}export{m as followHeight};
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. Height here is the block size, in a vertical writing mode too.
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));