asciify-engine 4.28.0 → 4.29.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciify-engine",
3
- "version": "4.28.0",
3
+ "version": "4.29.0",
4
4
  "description": "Framework-agnostic ASCII art engine. Convert images, videos, and GIFs into ASCII art rendered on canvas, or run full-bleed GPU character fields with a fluid cursor wake.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -2,13 +2,13 @@
2
2
  name: asciify-engine
3
3
  description: Apply Asciify the way asciify.org does - ASCII components and backgrounds that belong in a real interface, inked from the theme, clear around text, inside the page's radii and motion. Use for UI components in characters (loading, status, toasts, tabs, AI states, charts, transitions, pages), animated ASCII backgrounds, and also photo, video and GIF conversion, GPU character fields, artwork looks for wallpapers, posters and prints, art styles and export, hover and motion, layered typography and rendering performance.
4
4
  metadata:
5
- tested-engine: "4.28.0"
5
+ tested-engine: "4.29.0"
6
6
  updated: "2026-10-17"
7
7
  ---
8
8
 
9
9
  # Asciify Engine
10
10
 
11
- Use the published `asciify-engine` npm package. Tested against **4.28.0**. Check the application's installed version and its public types before using newer options; a local checkout can contain unpublished changes.
11
+ Use the published `asciify-engine` npm package. Tested against **4.29.0**. Check the application's installed version and its public types before using newer options; a local checkout can contain unpublished changes.
12
12
 
13
13
  - Agent entry: https://asciify.org/skill (redirects to this Markdown document).
14
14
  - Components: https://asciify.org/components · Looks: https://asciify.org/looks · Backgrounds: https://asciify.org/backgrounds
@@ -1 +0,0 @@
1
- import{mergeOptions as e,prefersReduced as t,hash as o,mountSurface as n}from"./chunk-GF72XM4C.js";import{isGlyphFieldSupported as l,watchPointer as i,watchVisibility as r,watchMotionPreference as a}from"../field.js";var s={style:"trail",charset:" .:-=+*#%@",cellSize:9,zIndex:1e3},c='input, textarea, select, [contenteditable], dialog, [role="dialog"], [role="alertdialog"], [data-ascii-cursor-skip]',u={trail:64,wake:48,water:20,sparkle:140},d=e=>{const t=Math.round(255*Math.max(0,Math.min(1,e)));return`rgb(${t},${t},${t})`};function h(e,t,o,n,l,i,r){for(let a=1;a<t.length;a++){const s=t[a-1],c=t[a],u=t[a-2]??s,h=1-(n-c.t)/l;h<=0||(e.strokeStyle=d(r(h)),e.lineWidth=Math.max(1,i(h)*o),e.beginPath(),e.moveTo((u.x+s.x)/2*o,(u.y+s.y)/2*o),e.quadraticCurveTo(s.x*o,s.y*o,(s.x+c.x)/2*o,(s.y+c.y)/2*o),e.lineTo(c.x*o,c.y*o),e.stroke())}}function f(e,t,o,n,l,i,r){if(e.lineCap="round",e.lineJoin="round",e.globalCompositeOperation="lighten","trail"===o)h(e,t,r,n,l,e=>i*(.5+.95*e),e=>e**1.25);else if("wake"===o)h(e,t,r,n,l,e=>i*(2+3.2*e),e=>.34*e**1.6),h(e,t,r,n,l,e=>i*(.8+1.4*e),e=>.62*e**1.4);else if("water"===o)for(const o of t){const t=n-o.t,a=1-t/l;a<=0||(e.strokeStyle=d(.9*a**1.5),e.lineWidth=Math.max(1,i*(.45+.5*a)*r),e.beginPath(),e.arc(o.x*r,o.y*r,(.8*i+.085*t)*r,0,2*Math.PI),e.stroke())}else for(const o of t){const t=n-o.t,a=1-t/l;if(a<=0)continue;const s=.55+.45*Math.sin(.028*t+6.28*o.seed),c=i*(.55+.6*o.seed)*(.6+.4*a)*r;e.fillStyle=d(a**1.2*s),e.fillRect((o.x+o.vx*t)*r-c/2,(o.y+o.vy*t)*r-c/2,c,c)}e.globalCompositeOperation="source-over"}function p(d={}){const h={current:{...s,...d}},p=()=>h.current;let y=[],k=null,m=null,g=!1,x=!1,v=!1,M=0;const w="undefined"!=typeof document&&"undefined"!=typeof window&&l(),b=()=>!!(p().reducedMotion??t()),z=()=>({mark:"glyph",charset:p().charset,cellSize:p().cellSize,cellAspect:.62,glyphScale:.92,shade:.6,contrast:1,...p().look}),S=e=>{e.style.cssText=`position:fixed;left:0;top:0;width:100vw;height:100vh;pointer-events:none;z-index:${p().zIndex};contain:strict`},C=({pen:e,now:t,scale:o})=>{const n=p().life??("water"===p().style?950:800);return y=y.filter(e=>t-e.t<n),!!y.length&&(f(e,y,p().style,t,n,p().cellSize,o),!0)},$=w?[i({target:window,move:e=>{if(x||v||"touch"===e.pointerType||"function"==typeof matchMedia&&matchMedia("(hover: none)").matches&&matchMedia("(pointer: coarse)").matches||b()||(e=>{const t=e;return!!t?.closest&&!!t.closest(p().skip?`${c}, ${p().skip}`:c)})(e.target))return;const t=performance.now(),l=e.clientX,i=e.clientY,r=p().style,a=y[y.length-1],s=a?Math.hypot(l-a.x,i-a.y):1/0;if(!("water"===r?s<2.6*p().cellSize&&t-M<90:s<2)){if(M=t,"sparkle"===r)for(let e=0;e<2;e++){const n=o(t+17*e,l+i),r=o(i+e,t)*Math.PI*2,a=1.4*p().cellSize*o(l,t+e);y.push({x:l+Math.cos(r)*a,y:i+Math.sin(r)*a,t:t,seed:n,vx:.012*Math.cos(r),vy:.012*Math.sin(r)+.01})}else y.push({x:l,y:i,t:t,seed:0,vx:0,vy:0});for(;y.length>u[r];)y.shift();k||g||x||!w||(m=document.createElement("div"),m.setAttribute("aria-hidden","true"),m.dataset.asciiCursor="",S(m),document.body.appendChild(m),k=n({host:m,kit:{get current(){return{lazy:!1,globalLook:p().globalLook??!1}}},look:z,ink:()=>p().ink??"--ascii-ink",resolution:.5,paint:C,reducedMotion:()=>p().reducedMotion,onFail:()=>{g=!0,k=null,m?.remove(),m=null}}),k||(g=!0,m.remove(),m=null)),k?.kick()}},leave(){}}),r(()=>{document.hidden&&(y=[])}),a(()=>{b()&&(y=[]),k?.kick()})]:[];return{get supported(){return w&&!g&&!x},get field(){return x?null:k?.field??null},get active(){return y.length>0},clear(){y=[],k?.kick()},update(t){if(x)return;const o=p().style;h.current={...s,...e(h.current,t)},p().style!==o&&(y=[]),m&&S(m),k?.refresh()},play(){x||(v=!1,k?.play())},pause(){x||(v=!0,y=[],k?.pause())},destroy(){if(!x){x=!0;for(const e of $)e();y=[],k?.destroy(),k=null,m?.remove(),m=null}}}}export{p as cursorTrail,f as cursorTrailFrame};//# sourceMappingURL=chunk-2MLFWO4U.js.map