@fusion.dev/helix 0.172.0 → 0.174.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.
Files changed (41) hide show
  1. package/custom-elements.json +2140 -93
  2. package/dist/copy-button/root/copy-button-root.css.js +1 -1
  3. package/dist/element-events.generated.js +8 -1
  4. package/dist/graph/root/graph-root.css.js +2 -1
  5. package/dist/orb/root/orb-root.css.js +1 -1
  6. package/dist/orb/root/orb-root.d.ts +24 -5
  7. package/dist/orb/root/orb-root.js +24 -6
  8. package/dist/sandbox/index.d.ts +1 -0
  9. package/dist/sandbox/index.js +1 -0
  10. package/dist/sandbox/preview/sandbox-preview.d.ts +39 -2
  11. package/dist/sandbox/preview/sandbox-preview.js +37 -5
  12. package/dist/sandbox/root/sandbox-root.css.js +1 -1
  13. package/dist/sandbox/root/sandbox-root.d.ts +44 -4
  14. package/dist/sandbox/root/sandbox-root.js +92 -17
  15. package/dist/sandbox/source/editing.d.ts +111 -0
  16. package/dist/sandbox/source/editing.js +185 -0
  17. package/dist/sandbox/source/sandbox-source.css.js +2 -1
  18. package/dist/sandbox/source/sandbox-source.d.ts +131 -6
  19. package/dist/sandbox/source/sandbox-source.js +301 -17
  20. package/dist/strands/palette.d.ts +1 -1
  21. package/dist/strands/path.d.ts +17 -6
  22. package/dist/strands/path.js +149 -43
  23. package/dist/strands/renderer.d.ts +14 -0
  24. package/dist/strands/renderer.js +14 -4
  25. package/dist/strands/root/strands-root.css.js +1 -1
  26. package/dist/strands/root/strands-root.d.ts +41 -10
  27. package/dist/strands/root/strands-root.js +32 -5
  28. package/dist/strands/shader.d.ts +3 -3
  29. package/dist/strands/shader.js +35 -12
  30. package/dist/strands/stop/strands-stop.d.ts +5 -5
  31. package/dist/timeline/root/timeline-root.css.js +1 -1
  32. package/dist/virtual-list/reorder/index.d.ts +1 -0
  33. package/dist/virtual-list/reorder/index.js +5 -0
  34. package/dist/virtual-list/reorder/virtual-list-reorder.css.d.ts +1 -0
  35. package/dist/virtual-list/reorder/virtual-list-reorder.css.js +12 -0
  36. package/dist/virtual-list/root/virtual-list-root.d.ts +9 -0
  37. package/lint.json +1 -1
  38. package/package.json +6 -6
  39. package/types/jsx.d.ts +919 -79
  40. package/types/vue.d.ts +214 -15
  41. package/types/words.d.ts +27 -0
@@ -1,9 +1,9 @@
1
1
  /** Each strand as a ribbon of quads, wide enough to anti-alias and to blur. */
2
- export declare const LINE_VERTEX = "#version 300 es\nlayout(location = 0) in vec2 aVert;\nlayout(location = 1) in float aId;\nuniform float uDpr;\nuniform float uSoftness;\nuniform vec3 uGlow;\nuniform vec3 uTint;\nuniform vec3 uPeak;\nout float vSide;\nout vec3 vColor;\n\nuniform vec4 uPts[96];\nuniform int uCount;\nuniform vec2 uView;\nuniform float uScroll;\nuniform vec2 uT;\nuniform float uTime;\nuniform float uSpread;\n\nfloat h1(float n) { return fract(sin(n * 127.1 + 311.7) * 43758.5453); }\n\nvec4 pt(int i) { return uPts[clamp(i, 0, uCount - 1)]; }\n\nvec4 spline(float t) {\n float s = clamp(t, 0.0, 1.0) * float(uCount - 1);\n int i = min(int(floor(s)), uCount - 2);\n float f = s - float(i);\n vec4 p0 = pt(i - 1);\n vec4 p1 = pt(i);\n vec4 p2 = pt(i + 1);\n vec4 p3 = pt(i + 2);\n float f2 = f * f;\n float f3 = f2 * f;\n return 0.5 * ((2.0 * p1) + (-p0 + p2) * f + (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3) * f2\n + (-p0 + 3.0 * p1 - 3.0 * p2 + p3) * f3);\n}\n\nvec2 place(vec4 c) { return vec2(c.x * uView.x, c.y - uScroll); }\n\nvec3 strandAt(float id, float t, out vec3 info) {\n vec4 c = spline(t);\n vec2 p = place(c);\n vec2 q = place(spline(t + 0.0004));\n vec2 tg = q - p;\n tg = length(tg) > 1e-4 ? normalize(tg) : vec2(0.0, 1.0);\n vec2 nr = vec2(-tg.y, tg.x);\n float r1 = h1(id + 0.13);\n float r2 = h1(id + 1.71);\n float r3 = h1(id + 3.37);\n float r4 = h1(id + 5.93);\n float n = (r1 + r2 + r3) / 1.5 - 1.0;\n float z = (r4 - 0.5) * 2.0;\n float along = c.y + c.x * uView.x;\n float th = along * 0.0033 + uTime * 0.25 + r2 * 0.5;\n float width = c.z * uSpread;\n float fan = width * uView.x * (1.0 + 0.25 * sin(uTime * 0.4 + along * 0.0045));\n float sway = sin(along * 0.006 + uTime * 0.23) * mix(6.0, 30.0, smoothstep(0.02, 0.2, width));\n float lat = sway + fan * (n * cos(th) + z * 0.55 * sin(th));\n lat += sin(along * 0.01 + uTime * (0.6 + 0.5 * r1) + r1 * 6.283) * 12.0 * (0.3 + r3);\n info = vec3(max(c.w, 0.0), width, along);\n return vec3(p + nr * lat, z * sin(th));\n}\n\nvoid main() {\n float id = aId;\n float r5 = h1(id + 7.77);\n float r6 = h1(id + 9.19);\n float r7 = h1(id + 11.3);\n float t = mix(uT.x, uT.y, aVert.x);\n vec3 info;\n vec3 unused;\n vec3 a = strandAt(id, t, info);\n vec3 b = strandAt(id, t + (uT.y - uT.x) / 700.0, unused);\n vec2 tg = b.xy - a.xy;\n tg = length(tg) > 1e-4 ? normalize(tg) : vec2(0.0, 1.0);\n vec2 nrm = vec2(-tg.y, tg.x);\n float soft = smoothstep(0.06, 0.28, info.y) * step(1.0 - uSoftness, r6);\n float base = mix(0.35, 1.3, r7 * r7) * uDpr * (1.0 + 0.3 * a.z);\n float w = max(base + soft * mix(8.0, 36.0, r6) * uDpr, 1.0);\n float drawW = w + 2.5 * uDpr;\n vec2 res = uView * uDpr;\n vec2 px = a.xy * uDpr + nrm * aVert.y * drawW * 0.5;\n gl_Position = vec4(px.x / res.x * 2.0 - 1.0, 1.0 - px.y / res.y * 2.0, 0.0, 1.0);\n vSide = aVert.y * drawW / w;\n float shimmer = 0.5 + 0.5 * sin(info.z * 0.044 - uTime * (2.0 + 2.0 * r5) + r6 * 6.283);\n shimmer *= shimmer;\n float bright = mix(0.25, 1.0, pow(r5, 1.4));\n float energy = min(base, w) / w;\n float depth = 0.7 + 0.3 * a.z;\n vec3 col = mix(uGlow, uTint, step(0.83, r6) * 0.9);\n col = mix(col, uPeak, step(0.93, r7) * 0.6);\n vColor = col * energy * info.x * (0.35 + 0.65 * shimmer) * bright * depth;\n}\n";
2
+ export declare const LINE_VERTEX = "#version 300 es\nlayout(location = 0) in vec2 aVert;\nlayout(location = 1) in float aId;\nuniform float uDpr;\nuniform float uSoftness;\nuniform float uContrast;\nuniform vec3 uGlow;\nuniform vec3 uTint;\nuniform vec3 uPeak;\nout float vSide;\nout vec3 vColor;\n\nuniform vec4 uPts[96];\nuniform int uCount;\nuniform vec2 uView;\nuniform float uScroll;\nuniform vec2 uT;\nuniform float uTime;\nuniform float uSpread;\nuniform float uDepth;\nuniform float uDrift;\n\nfloat h1(float n) { return fract(sin(n * 127.1 + 311.7) * 43758.5453); }\n\nvec4 pt(int i) { return uPts[clamp(i, 0, uCount - 1)]; }\n\nvec4 spline(float t) {\n float s = clamp(t, 0.0, 1.0) * float(uCount - 1);\n int i = min(int(floor(s)), uCount - 2);\n float f = s - float(i);\n vec4 p0 = pt(i - 1);\n vec4 p1 = pt(i);\n vec4 p2 = pt(i + 1);\n vec4 p3 = pt(i + 2);\n float f2 = f * f;\n float f3 = f2 * f;\n return 0.5 * ((2.0 * p1) + (-p0 + p2) * f + (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3) * f2\n + (-p0 + 3.0 * p1 - 3.0 * p2 + p3) * f3);\n}\n\nvec2 place(vec4 c) { return vec2(c.x * uView.x, c.y - uScroll); }\n\nvec3 strandAt(float id, float t, out vec3 info) {\n vec4 c = spline(t);\n vec2 p = place(c);\n vec2 q = place(spline(t + 0.0004));\n vec2 tg = q - p;\n tg = length(tg) > 1e-4 ? normalize(tg) : vec2(0.0, 1.0);\n vec2 nr = vec2(-tg.y, tg.x);\n float r1 = h1(id + 0.13);\n float r2 = h1(id + 1.71);\n float r3 = h1(id + 3.37);\n float r4 = h1(id + 5.93);\n float r8 = h1(id + 13.7);\n float r9 = h1(id + 17.3);\n float n = (r1 + r2 + r3) / 1.5 - 1.0;\n float z = (r4 - 0.5) * 2.0;\n float along = c.y + c.x * uView.x;\n float pace = 1.0 + uDrift * (r8 - 0.5) * 1.2;\n float th = along * 0.002 * (1.0 + uDrift * (r9 - 0.5) * 0.3) + uTime * 0.25 * pace\n + r2 * (0.5 + uDrift * 2.6);\n float width = c.z * uSpread;\n float breadth = width * uView.x * (1.0 + 0.25 * sin(uTime * 0.4 + along * 0.0045));\n float sway = sin(along * 0.006 + uTime * 0.23) * mix(6.0, 30.0, smoothstep(0.02, 0.2, width));\n float ct = cos(th);\n float st = sin(th);\n float depth = clamp((z * 0.55 * ct - n * st) / 1.15, -1.0, 1.0);\n float lat = sway + breadth * (n * ct + z * 0.55 * st) * (1.0 + uDepth * 0.35 * depth);\n lat += sin(along * 0.006 * (1.0 + uDrift * (r9 - 0.5) * 0.3) + uTime * (0.6 + 0.5 * r1) * pace\n + r1 * 6.283) * 12.0 * (0.3 + r3) * (1.0 + uDrift * 0.5);\n info = vec3(max(c.w, 0.0), width, along);\n return vec3(p + nr * lat, depth);\n}\n\nvoid main() {\n float id = aId;\n float r5 = h1(id + 7.77);\n float r6 = h1(id + 9.19);\n float r7 = h1(id + 11.3);\n float t = mix(uT.x, uT.y, aVert.x);\n vec3 info;\n vec3 unused;\n vec3 a = strandAt(id, t, info);\n vec3 b = strandAt(id, t + (uT.y - uT.x) / 700.0, unused);\n vec2 tg = b.xy - a.xy;\n tg = length(tg) > 1e-4 ? normalize(tg) : vec2(0.0, 1.0);\n vec2 nrm = vec2(-tg.y, tg.x);\n float soft = smoothstep(0.06, 0.28, info.y) * step(1.0 - uSoftness, r6);\n /* Nearer is thicker, and the back of the ribbon falls out of focus: wider\n at the same energy, so it reads as haze behind the sharp strands. */\n float base = mix(0.35, 1.3, r7 * r7) * uDpr * (1.0 + (0.3 + 0.5 * uDepth) * a.z);\n float focus = uDepth * smoothstep(-0.1, -0.9, a.z) * 10.0 * uDpr;\n float w = max(base + soft * mix(8.0, 36.0, r6) * uDpr + focus, 1.0);\n float drawW = w + 2.5 * uDpr;\n vec2 res = uView * uDpr;\n vec2 px = a.xy * uDpr + nrm * aVert.y * drawW * 0.5;\n gl_Position = vec4(px.x / res.x * 2.0 - 1.0, 1.0 - px.y / res.y * 2.0, 0.0, 1.0);\n vSide = aVert.y * drawW / w;\n float shimmer = 0.5 + 0.5 * sin(info.z * 0.044 - uTime * (2.0 + 2.0 * r5) + r6 * 6.283);\n shimmer *= shimmer;\n /* Contrast spreads the strands' brightness: a few burn and most fall back.\n The mean is held, so the ribbon as a whole keeps its strength. */\n float spread = mix(1.4, 4.5, uContrast);\n float least = mix(0.25, 0.04, uContrast);\n float bright = mix(least, 1.0, pow(r5, spread)) * 0.5625 / (least + (1.0 - least) / (spread + 1.0));\n float energy = min(base, w) / w;\n float fall = 0.3 + 0.5 * uDepth;\n float depth = (1.0 - fall * (1.0 - a.z) * 0.5) / (1.0 - fall * 0.5);\n float rest = mix(0.35, 0.15, uContrast);\n vec3 col = mix(uGlow, uTint, step(0.83, r6) * 0.9);\n col = mix(col, uPeak, step(0.93, r7) * 0.6);\n vColor = col * energy * info.x * (rest + (1.0 - rest) * shimmer) * bright * depth;\n}\n";
3
3
  /** A soft profile across the ribbon, added into the buffer. */
4
4
  export declare const LINE_FRAGMENT = "#version 300 es\nprecision highp float;\nin float vSide;\nin vec3 vColor;\nuniform float uScale;\nout vec4 outColor;\nvoid main() {\n outColor = vec4(vColor * exp(-vSide * vSide * 2.4) * uScale, 1.0);\n}\n";
5
5
  /** Specks drifting along the strands, thickest where the ribbon is bright. */
6
- export declare const DUST_VERTEX = "#version 300 es\nuniform float uDpr;\nuniform float uStrands;\nuniform vec3 uGlow;\nuniform vec3 uPeak;\nout vec3 vColor;\n\nuniform vec4 uPts[96];\nuniform int uCount;\nuniform vec2 uView;\nuniform float uScroll;\nuniform vec2 uT;\nuniform float uTime;\nuniform float uSpread;\n\nfloat h1(float n) { return fract(sin(n * 127.1 + 311.7) * 43758.5453); }\n\nvec4 pt(int i) { return uPts[clamp(i, 0, uCount - 1)]; }\n\nvec4 spline(float t) {\n float s = clamp(t, 0.0, 1.0) * float(uCount - 1);\n int i = min(int(floor(s)), uCount - 2);\n float f = s - float(i);\n vec4 p0 = pt(i - 1);\n vec4 p1 = pt(i);\n vec4 p2 = pt(i + 1);\n vec4 p3 = pt(i + 2);\n float f2 = f * f;\n float f3 = f2 * f;\n return 0.5 * ((2.0 * p1) + (-p0 + p2) * f + (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3) * f2\n + (-p0 + 3.0 * p1 - 3.0 * p2 + p3) * f3);\n}\n\nvec2 place(vec4 c) { return vec2(c.x * uView.x, c.y - uScroll); }\n\nvec3 strandAt(float id, float t, out vec3 info) {\n vec4 c = spline(t);\n vec2 p = place(c);\n vec2 q = place(spline(t + 0.0004));\n vec2 tg = q - p;\n tg = length(tg) > 1e-4 ? normalize(tg) : vec2(0.0, 1.0);\n vec2 nr = vec2(-tg.y, tg.x);\n float r1 = h1(id + 0.13);\n float r2 = h1(id + 1.71);\n float r3 = h1(id + 3.37);\n float r4 = h1(id + 5.93);\n float n = (r1 + r2 + r3) / 1.5 - 1.0;\n float z = (r4 - 0.5) * 2.0;\n float along = c.y + c.x * uView.x;\n float th = along * 0.0033 + uTime * 0.25 + r2 * 0.5;\n float width = c.z * uSpread;\n float fan = width * uView.x * (1.0 + 0.25 * sin(uTime * 0.4 + along * 0.0045));\n float sway = sin(along * 0.006 + uTime * 0.23) * mix(6.0, 30.0, smoothstep(0.02, 0.2, width));\n float lat = sway + fan * (n * cos(th) + z * 0.55 * sin(th));\n lat += sin(along * 0.01 + uTime * (0.6 + 0.5 * r1) + r1 * 6.283) * 12.0 * (0.3 + r3);\n info = vec3(max(c.w, 0.0), width, along);\n return vec3(p + nr * lat, z * sin(th));\n}\n\nvoid main() {\n float id = float(gl_VertexID);\n float sid = floor(h1(id + 0.5) * uStrands);\n float r = h1(id + 2.3);\n float r2 = h1(id + 4.1);\n float t = mix(uT.x, uT.y, fract(r + uTime * 0.003 * (0.3 + r2)));\n vec3 info;\n vec3 a = strandAt(sid, t, info);\n vec2 off = (vec2(h1(id + 6.1), h1(id + 8.3)) - 0.5) * (24.0 + (150.0 + info.y * uView.x) * h1(id + 9.7));\n vec2 res = uView * uDpr;\n vec2 px = (a.xy + off) * uDpr;\n gl_Position = vec4(px.x / res.x * 2.0 - 1.0, 1.0 - px.y / res.y * 2.0, 0.0, 1.0);\n gl_PointSize = mix(1.2, 3.4, r2 * r2) * uDpr;\n float tw = 0.35 + 0.65 * (0.5 + 0.5 * sin(uTime * (0.5 + 1.8 * r) + r2 * 40.0));\n vColor = mix(uGlow, uPeak, 0.55) * tw * mix(0.2, 0.9, r) * info.x * 0.8;\n}\n";
6
+ export declare const DUST_VERTEX = "#version 300 es\nuniform float uDpr;\nuniform float uStrands;\nuniform vec3 uGlow;\nuniform vec3 uPeak;\nout vec3 vColor;\n\nuniform vec4 uPts[96];\nuniform int uCount;\nuniform vec2 uView;\nuniform float uScroll;\nuniform vec2 uT;\nuniform float uTime;\nuniform float uSpread;\nuniform float uDepth;\nuniform float uDrift;\n\nfloat h1(float n) { return fract(sin(n * 127.1 + 311.7) * 43758.5453); }\n\nvec4 pt(int i) { return uPts[clamp(i, 0, uCount - 1)]; }\n\nvec4 spline(float t) {\n float s = clamp(t, 0.0, 1.0) * float(uCount - 1);\n int i = min(int(floor(s)), uCount - 2);\n float f = s - float(i);\n vec4 p0 = pt(i - 1);\n vec4 p1 = pt(i);\n vec4 p2 = pt(i + 1);\n vec4 p3 = pt(i + 2);\n float f2 = f * f;\n float f3 = f2 * f;\n return 0.5 * ((2.0 * p1) + (-p0 + p2) * f + (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3) * f2\n + (-p0 + 3.0 * p1 - 3.0 * p2 + p3) * f3);\n}\n\nvec2 place(vec4 c) { return vec2(c.x * uView.x, c.y - uScroll); }\n\nvec3 strandAt(float id, float t, out vec3 info) {\n vec4 c = spline(t);\n vec2 p = place(c);\n vec2 q = place(spline(t + 0.0004));\n vec2 tg = q - p;\n tg = length(tg) > 1e-4 ? normalize(tg) : vec2(0.0, 1.0);\n vec2 nr = vec2(-tg.y, tg.x);\n float r1 = h1(id + 0.13);\n float r2 = h1(id + 1.71);\n float r3 = h1(id + 3.37);\n float r4 = h1(id + 5.93);\n float r8 = h1(id + 13.7);\n float r9 = h1(id + 17.3);\n float n = (r1 + r2 + r3) / 1.5 - 1.0;\n float z = (r4 - 0.5) * 2.0;\n float along = c.y + c.x * uView.x;\n float pace = 1.0 + uDrift * (r8 - 0.5) * 1.2;\n float th = along * 0.002 * (1.0 + uDrift * (r9 - 0.5) * 0.3) + uTime * 0.25 * pace\n + r2 * (0.5 + uDrift * 2.6);\n float width = c.z * uSpread;\n float breadth = width * uView.x * (1.0 + 0.25 * sin(uTime * 0.4 + along * 0.0045));\n float sway = sin(along * 0.006 + uTime * 0.23) * mix(6.0, 30.0, smoothstep(0.02, 0.2, width));\n float ct = cos(th);\n float st = sin(th);\n float depth = clamp((z * 0.55 * ct - n * st) / 1.15, -1.0, 1.0);\n float lat = sway + breadth * (n * ct + z * 0.55 * st) * (1.0 + uDepth * 0.35 * depth);\n lat += sin(along * 0.006 * (1.0 + uDrift * (r9 - 0.5) * 0.3) + uTime * (0.6 + 0.5 * r1) * pace\n + r1 * 6.283) * 12.0 * (0.3 + r3) * (1.0 + uDrift * 0.5);\n info = vec3(max(c.w, 0.0), width, along);\n return vec3(p + nr * lat, depth);\n}\n\nvoid main() {\n float id = float(gl_VertexID);\n float sid = floor(h1(id + 0.5) * uStrands);\n float r = h1(id + 2.3);\n float r2 = h1(id + 4.1);\n float t = mix(uT.x, uT.y, fract(r + uTime * 0.003 * (0.3 + r2)));\n vec3 info;\n vec3 a = strandAt(sid, t, info);\n vec2 off = (vec2(h1(id + 6.1), h1(id + 8.3)) - 0.5) * (24.0 + (150.0 + info.y * uView.x) * h1(id + 9.7));\n vec2 res = uView * uDpr;\n vec2 px = (a.xy + off) * uDpr;\n gl_Position = vec4(px.x / res.x * 2.0 - 1.0, 1.0 - px.y / res.y * 2.0, 0.0, 1.0);\n gl_PointSize = mix(1.2, 3.4, r2 * r2) * uDpr;\n float tw = 0.35 + 0.65 * (0.5 + 0.5 * sin(uTime * (0.5 + 1.8 * r) + r2 * 40.0));\n /* By the root of the ribbon's brightness, so specks show along a dim ribbon\n as well as round a bright bend. */\n vColor = mix(uGlow, uPeak, 0.55) * tw * mix(0.2, 0.9, r) * sqrt(info.x) * 0.8;\n}\n";
7
7
  export declare const DUST_FRAGMENT = "#version 300 es\nprecision highp float;\nin vec3 vColor;\nuniform float uScale;\nout vec4 outColor;\nvoid main() {\n vec2 c = gl_PointCoord - 0.5;\n outColor = vec4(vColor * exp(-dot(c, c) * 16.0) * uScale, 1.0);\n}\n";
8
8
  /** One triangle over the whole target, from three vertex ids and no buffer. */
9
9
  export declare const QUAD_VERTEX = "#version 300 es\nout vec2 vUv;\nvoid main() {\n vec2 p = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2);\n vUv = p;\n gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);\n}\n";
@@ -19,4 +19,4 @@ export declare const BLUR_FRAGMENT = "#version 300 es\nprecision highp float;\ni
19
19
  * the same energy darkens the ground toward the peak as ink. A step of noise
20
20
  * under a code value hides the banding a slow gradient shows on eight bits.
21
21
  */
22
- export declare const COMPOSITE_FRAGMENT = "#version 300 es\nprecision highp float;\nin vec2 vUv;\nuniform sampler2D uScene;\nuniform sampler2D uNear;\nuniform sampler2D uFar;\nuniform vec3 uGround;\nuniform vec3 uInk;\nuniform float uLight;\nuniform float uGain;\nout vec4 outColor;\nfloat hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }\nvoid main() {\n vec3 e = texture(uScene, vUv).rgb + texture(uNear, vUv).rgb * 1.1 + texture(uFar, vUv).rgb * 0.9;\n e *= uGain;\n vec3 dark = 1.0 - (1.0 - uGround) * exp(-e);\n float lum = dot(e, vec3(0.3, 0.55, 0.15));\n vec3 light = mix(uGround, uInk, 1.0 - exp(-lum * 1.4));\n vec3 c = mix(dark, light, uLight);\n c += (hash(gl_FragCoord.xy) - 0.5) / 255.0;\n outColor = vec4(c, 1.0);\n}\n";
22
+ export declare const COMPOSITE_FRAGMENT = "#version 300 es\nprecision highp float;\nin vec2 vUv;\nuniform sampler2D uScene;\nuniform sampler2D uNear;\nuniform sampler2D uFar;\nuniform vec3 uGround;\nuniform vec3 uInk;\nuniform float uLight;\nuniform float uGain;\nuniform float uBloom;\nout vec4 outColor;\nfloat hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }\nvoid main() {\n vec3 e = texture(uScene, vUv).rgb + (texture(uNear, vUv).rgb * 1.1 + texture(uFar, vUv).rgb * 0.9) * uBloom;\n e *= uGain;\n vec3 dark = 1.0 - (1.0 - uGround) * exp(-e);\n float lum = dot(e, vec3(0.3, 0.55, 0.15));\n vec3 light = mix(uGround, uInk, 1.0 - exp(-lum * 1.4));\n vec3 c = mix(dark, light, uLight);\n c += (hash(gl_FragCoord.xy) - 0.5) / 255.0;\n outColor = vec4(c, 1.0);\n}\n";
@@ -7,6 +7,8 @@ uniform float uScroll;
7
7
  uniform vec2 uT;
8
8
  uniform float uTime;
9
9
  uniform float uSpread;
10
+ uniform float uDepth;
11
+ uniform float uDrift;
10
12
 
11
13
  float h1(float n) { return fract(sin(n * 127.1 + 311.7) * 43758.5453); }
12
14
 
@@ -39,17 +41,25 @@ vec3 strandAt(float id, float t, out vec3 info) {
39
41
  float r2 = h1(id + 1.71);
40
42
  float r3 = h1(id + 3.37);
41
43
  float r4 = h1(id + 5.93);
44
+ float r8 = h1(id + 13.7);
45
+ float r9 = h1(id + 17.3);
42
46
  float n = (r1 + r2 + r3) / 1.5 - 1.0;
43
47
  float z = (r4 - 0.5) * 2.0;
44
48
  float along = c.y + c.x * uView.x;
45
- float th = along * 0.0033 + uTime * 0.25 + r2 * 0.5;
49
+ float pace = 1.0 + uDrift * (r8 - 0.5) * 1.2;
50
+ float th = along * 0.002 * (1.0 + uDrift * (r9 - 0.5) * 0.3) + uTime * 0.25 * pace
51
+ + r2 * (0.5 + uDrift * 2.6);
46
52
  float width = c.z * uSpread;
47
- float fan = width * uView.x * (1.0 + 0.25 * sin(uTime * 0.4 + along * 0.0045));
53
+ float breadth = width * uView.x * (1.0 + 0.25 * sin(uTime * 0.4 + along * 0.0045));
48
54
  float sway = sin(along * 0.006 + uTime * 0.23) * mix(6.0, 30.0, smoothstep(0.02, 0.2, width));
49
- float lat = sway + fan * (n * cos(th) + z * 0.55 * sin(th));
50
- lat += sin(along * 0.01 + uTime * (0.6 + 0.5 * r1) + r1 * 6.283) * 12.0 * (0.3 + r3);
55
+ float ct = cos(th);
56
+ float st = sin(th);
57
+ float depth = clamp((z * 0.55 * ct - n * st) / 1.15, -1.0, 1.0);
58
+ float lat = sway + breadth * (n * ct + z * 0.55 * st) * (1.0 + uDepth * 0.35 * depth);
59
+ lat += sin(along * 0.006 * (1.0 + uDrift * (r9 - 0.5) * 0.3) + uTime * (0.6 + 0.5 * r1) * pace
60
+ + r1 * 6.283) * 12.0 * (0.3 + r3) * (1.0 + uDrift * 0.5);
51
61
  info = vec3(max(c.w, 0.0), width, along);
52
- return vec3(p + nr * lat, z * sin(th));
62
+ return vec3(p + nr * lat, depth);
53
63
  }
54
64
  `;
55
65
  export const LINE_VERTEX = `#version 300 es
@@ -57,6 +67,7 @@ layout(location = 0) in vec2 aVert;
57
67
  layout(location = 1) in float aId;
58
68
  uniform float uDpr;
59
69
  uniform float uSoftness;
70
+ uniform float uContrast;
60
71
  uniform vec3 uGlow;
61
72
  uniform vec3 uTint;
62
73
  uniform vec3 uPeak;
@@ -77,8 +88,11 @@ void main() {
77
88
  tg = length(tg) > 1e-4 ? normalize(tg) : vec2(0.0, 1.0);
78
89
  vec2 nrm = vec2(-tg.y, tg.x);
79
90
  float soft = smoothstep(0.06, 0.28, info.y) * step(1.0 - uSoftness, r6);
80
- float base = mix(0.35, 1.3, r7 * r7) * uDpr * (1.0 + 0.3 * a.z);
81
- float w = max(base + soft * mix(8.0, 36.0, r6) * uDpr, 1.0);
91
+ /* Nearer is thicker, and the back of the ribbon falls out of focus: wider
92
+ at the same energy, so it reads as haze behind the sharp strands. */
93
+ float base = mix(0.35, 1.3, r7 * r7) * uDpr * (1.0 + (0.3 + 0.5 * uDepth) * a.z);
94
+ float focus = uDepth * smoothstep(-0.1, -0.9, a.z) * 10.0 * uDpr;
95
+ float w = max(base + soft * mix(8.0, 36.0, r6) * uDpr + focus, 1.0);
82
96
  float drawW = w + 2.5 * uDpr;
83
97
  vec2 res = uView * uDpr;
84
98
  vec2 px = a.xy * uDpr + nrm * aVert.y * drawW * 0.5;
@@ -86,12 +100,18 @@ void main() {
86
100
  vSide = aVert.y * drawW / w;
87
101
  float shimmer = 0.5 + 0.5 * sin(info.z * 0.044 - uTime * (2.0 + 2.0 * r5) + r6 * 6.283);
88
102
  shimmer *= shimmer;
89
- float bright = mix(0.25, 1.0, pow(r5, 1.4));
103
+ /* Contrast spreads the strands' brightness: a few burn and most fall back.
104
+ The mean is held, so the ribbon as a whole keeps its strength. */
105
+ float spread = mix(1.4, 4.5, uContrast);
106
+ float least = mix(0.25, 0.04, uContrast);
107
+ float bright = mix(least, 1.0, pow(r5, spread)) * 0.5625 / (least + (1.0 - least) / (spread + 1.0));
90
108
  float energy = min(base, w) / w;
91
- float depth = 0.7 + 0.3 * a.z;
109
+ float fall = 0.3 + 0.5 * uDepth;
110
+ float depth = (1.0 - fall * (1.0 - a.z) * 0.5) / (1.0 - fall * 0.5);
111
+ float rest = mix(0.35, 0.15, uContrast);
92
112
  vec3 col = mix(uGlow, uTint, step(0.83, r6) * 0.9);
93
113
  col = mix(col, uPeak, step(0.93, r7) * 0.6);
94
- vColor = col * energy * info.x * (0.35 + 0.65 * shimmer) * bright * depth;
114
+ vColor = col * energy * info.x * (rest + (1.0 - rest) * shimmer) * bright * depth;
95
115
  }
96
116
  `;
97
117
  export const LINE_FRAGMENT = `#version 300 es
@@ -125,7 +145,9 @@ void main() {
125
145
  gl_Position = vec4(px.x / res.x * 2.0 - 1.0, 1.0 - px.y / res.y * 2.0, 0.0, 1.0);
126
146
  gl_PointSize = mix(1.2, 3.4, r2 * r2) * uDpr;
127
147
  float tw = 0.35 + 0.65 * (0.5 + 0.5 * sin(uTime * (0.5 + 1.8 * r) + r2 * 40.0));
128
- vColor = mix(uGlow, uPeak, 0.55) * tw * mix(0.2, 0.9, r) * info.x * 0.8;
148
+ /* By the root of the ribbon's brightness, so specks show along a dim ribbon
149
+ as well as round a bright bend. */
150
+ vColor = mix(uGlow, uPeak, 0.55) * tw * mix(0.2, 0.9, r) * sqrt(info.x) * 0.8;
129
151
  }
130
152
  `;
131
153
  export const DUST_FRAGMENT = `#version 300 es
@@ -183,10 +205,11 @@ uniform vec3 uGround;
183
205
  uniform vec3 uInk;
184
206
  uniform float uLight;
185
207
  uniform float uGain;
208
+ uniform float uBloom;
186
209
  out vec4 outColor;
187
210
  float hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }
188
211
  void main() {
189
- vec3 e = texture(uScene, vUv).rgb + texture(uNear, vUv).rgb * 1.1 + texture(uFar, vUv).rgb * 0.9;
212
+ vec3 e = texture(uScene, vUv).rgb + (texture(uNear, vUv).rgb * 1.1 + texture(uFar, vUv).rgb * 0.9) * uBloom;
190
213
  e *= uGain;
191
214
  vec3 dark = 1.0 - (1.0 - uGround) * exp(-e);
192
215
  float lum = dot(e, vec3(0.3, 0.55, 0.15));
@@ -7,8 +7,8 @@ import type { StrandsVariant } from '../path.js';
7
7
  *
8
8
  * @description
9
9
  * Placed inside a `helix-strands` with `travel`, a stop names an element with
10
- * `for` and says which form the ribbon takes when the page reaches it: a `fan`
11
- * bending through it, a `ribbon` passing through `at`, or `waves` crossing at
10
+ * `for` and says which form the ribbon takes when the page reaches it: a `bend`
11
+ * turning through it, a `ribbon` passing through `at`, or `waves` crossing at
12
12
  * its top edge. The stops are read in page order, whatever order they are
13
13
  * written in, and a stop naming no element is skipped.
14
14
  *
@@ -26,9 +26,9 @@ import type { StrandsVariant } from '../path.js';
26
26
  export declare class HelixStrandsStop extends HelixElement {
27
27
  static styles: CSSResultGroup;
28
28
  /**
29
- * Where the form sits across the page, as a share of the width: the fan's
30
- * bend or the ribbon's axis. A wave crosses the whole width and does not
31
- * read it. Unset, a fan bends at `0.4` and a ribbon runs down the middle.
29
+ * Where the form sits across the page, as a share of the width: the bend's
30
+ * apex or the ribbon's axis. A wave crosses the whole width and does not
31
+ * read it. Unset, a bend's apex sits at `0.5` and a ribbon runs down the middle.
32
32
  */
33
33
  at?: number;
34
34
  /** The id of the element the form is pinned to, in the same tree as the stop. */
@@ -1,2 +1,2 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {display: flex;flex-direction: column;}:host([layout="opposite"]) {--_timeline-columns: minmax(0, 1fr) auto minmax(0, 1fr);--_timeline-content-column: 3;--_timeline-rail-column: 2;--_timeline-time-align: end;--_timeline-time-column: 1;--_timeline-time-row: 2;}:host([layout="alternate"]) {--_timeline-columns: minmax(0, 1fr) auto minmax(0, 1fr);--_timeline-content-column: 3;--_timeline-even-align: end;--_timeline-even-column: 1;--_timeline-rail-column: 2;--_timeline-time-column: 3;}:host([orientation="horizontal"]) {--_timeline-arrive-display: none;--_timeline-columns: minmax(0, 1fr);--_timeline-content-block-end: var(--helix-space-none);--_timeline-content-column: 1;--_timeline-content-inline-end: var(--timeline-gap, var(--helix-space-lg));--_timeline-content-row: 3;--_timeline-direction: row;--_timeline-entry-flex: 1 1 0;--_timeline-even-align: initial;--_timeline-even-column: initial;--_timeline-leave-align: center;--_timeline-leave-block-size: var(--timeline-rail-size, var(--helix-border-thin));--_timeline-leave-column: 2;--_timeline-leave-inline-size: auto;--_timeline-leave-justify: stretch;--_timeline-leave-margin-block: var(--helix-space-none);--_timeline-leave-row: 1;--_timeline-marker-row: 1;--_timeline-rail-align: center;--_timeline-rail-column: 1;--_timeline-rail-columns: auto minmax(0, 1fr);--_timeline-rail-justify: start;--_timeline-rail-row: 1;--_timeline-rail-rows: auto;--_timeline-rows: auto auto minmax(0, 1fr);--_timeline-time-align: initial;--_timeline-time-column: 1;--_timeline-time-row: 2;flex-direction: row;}:host([orientation="horizontal"]) ::slotted(*) {flex: 1 1 0;min-inline-size: 0;}@media print {:host {print-color-adjust: economy;}}`);
2
+ export const styles = createSheet(`:host {display: flex;flex-direction: column;}:host([layout="opposite"]) {--_timeline-columns: minmax(0, 1fr) auto minmax(0, 1fr);--_timeline-content-column: 3;--_timeline-rail-column: 2;--_timeline-time-align: end;--_timeline-time-column: 1;--_timeline-time-row: 2;}:host([layout="alternate"]) {--_timeline-columns: minmax(0, 1fr) auto minmax(0, 1fr);--_timeline-content-column: 3;--_timeline-even-align: end;--_timeline-even-column: 1;--_timeline-rail-column: 2;--_timeline-time-column: 3;}:host([orientation="horizontal"]) {--_timeline-arrive-display: none;--_timeline-columns: minmax(0, 1fr);--_timeline-content-block-end: var(--helix-space-none);--_timeline-content-column: 1;--_timeline-content-inline-end: var(--timeline-gap, var(--helix-space-lg));--_timeline-content-row: 3;--_timeline-direction: row;--_timeline-entry-flex: 1 1 0;--_timeline-even-align: initial;--_timeline-even-column: initial;--_timeline-leave-align: center;--_timeline-leave-block-size: var(--timeline-rail-size, var(--helix-border-thin));--_timeline-leave-column: 2;--_timeline-leave-inline-size: auto;--_timeline-leave-justify: stretch;--_timeline-leave-margin-block: var(--helix-space-none);--_timeline-leave-row: 1;--_timeline-marker-row: 1;--_timeline-rail-align: center;--_timeline-rail-column: 1;--_timeline-rail-columns: auto minmax(0, 1fr);--_timeline-rail-justify: start;--_timeline-rail-row: 1;--_timeline-rail-rows: auto;--_timeline-rows: auto auto minmax(0, 1fr);--_timeline-time-align: initial;--_timeline-time-column: 1;--_timeline-time-row: 2;flex-direction: row;}:host([orientation="horizontal"]) ::slotted(*) {flex: 1 1 0;min-inline-size: 0;}[part="loading"] {color: var(--timeline-time-color, var(--helix-color-foreground-muted));font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);padding-block-start: var(--timeline-gap, var(--helix-space-lg));}:host([orientation="horizontal"]) [part="loading"] {padding-block-start: var(--helix-space-none);}@media print {:host {print-color-adjust: economy;}}`);
@@ -0,0 +1 @@
1
+ export { reorderVirtualList, VirtualListReorderController, } from '@fusion.dev/helix-headless/virtual-list/reorder';
@@ -0,0 +1,5 @@
1
+ import { reorderVirtualList } from '@fusion.dev/helix-headless/virtual-list/reorder';
2
+ import { HelixVirtualList } from '../root/virtual-list-root.js';
3
+ import { styles } from './virtual-list-reorder.css.js';
4
+ reorderVirtualList(HelixVirtualList, styles);
5
+ export { reorderVirtualList, VirtualListReorderController, } from '@fusion.dev/helix-headless/virtual-list/reorder';
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,12 @@
1
+ import { createSheet } from '@fusion.dev/helix-core';
2
+ export const styles = createSheet(`::slotted([data-index]) {cursor: grab;user-select: none;}::slotted([data-dragging]) {opacity: var(--virtual-list-dragging-opacity, 0.5);}::slotted([data-drop-before]) {box-shadow: inset 0 var(--virtual-list-drop-indicator-size, var(--helix-border-thick)) 0 0
3
+ var(--virtual-list-drop-indicator-color, var(--helix-color-primary));}::slotted([data-drop-after]) {box-shadow: inset 0 calc(-1 * var(--virtual-list-drop-indicator-size, var(--helix-border-thick)))
4
+ 0 0 var(--virtual-list-drop-indicator-color, var(--helix-color-primary));}:host(:state(horizontal)) ::slotted([data-drop-before]) {box-shadow: inset var(--virtual-list-drop-indicator-size, var(--helix-border-thick)) 0 0 0
5
+ var(--virtual-list-drop-indicator-color, var(--helix-color-primary));}:host(:state(horizontal)) ::slotted([data-drop-after]) {box-shadow: inset calc(-1 * var(--virtual-list-drop-indicator-size, var(--helix-border-thick))) 0
6
+ 0 0 var(--virtual-list-drop-indicator-color, var(--helix-color-primary));}:host(:state(horizontal):dir(rtl)) ::slotted([data-drop-before]) {box-shadow: inset calc(-1 * var(--virtual-list-drop-indicator-size, var(--helix-border-thick))) 0
7
+ 0 0 var(--virtual-list-drop-indicator-color, var(--helix-color-primary));}:host(:state(horizontal):dir(rtl)) ::slotted([data-drop-after]) {box-shadow: inset var(--virtual-list-drop-indicator-size, var(--helix-border-thick)) 0 0 0
8
+ var(--virtual-list-drop-indicator-color, var(--helix-color-primary));}[popover] {background-color: var(
9
+ --virtual-list-drag-preview-background-color,
10
+ var(--helix-color-surface-raised)
11
+ );border: var(--virtual-list-drag-preview-border-width, var(--helix-border-floating)) solid
12
+ var(--virtual-list-drag-preview-border-color, var(--helix-color-border));border-radius: var(--virtual-list-drag-preview-radius, var(--helix-radii-sm));box-shadow: var(--virtual-list-drag-preview-shadow, var(--helix-shadow-floating));opacity: var(--virtual-list-drag-preview-opacity, 0.9);}[data-reorder-live] {block-size: 1px;clip-path: inset(50%);inline-size: 1px;overflow: hidden;position: absolute;white-space: nowrap;}`);
@@ -24,6 +24,15 @@ import type { CSSResultGroup } from 'lit';
24
24
  *
25
25
  * @cssproperty --virtual-list-block-size - How tall the scrolling box is. A list that runs across is as tall as its rows unless you set it.
26
26
  * @cssproperty --virtual-list-disabled-opacity - How faint a row `disabled-keys` names is drawn.
27
+ * @cssproperty --virtual-list-drag-preview-background-color - The fill behind the copy of a row a pointer drags, in a `reorderable` list with `@fusion.dev/helix/virtual-list/reorder` imported.
28
+ * @cssproperty --virtual-list-drag-preview-border-color - The color of the edge around the copy of a row a pointer drags.
29
+ * @cssproperty --virtual-list-drag-preview-border-width - The width of the edge around the copy of a row a pointer drags. None by default, where the shadow lifts it.
30
+ * @cssproperty --virtual-list-drag-preview-opacity - The opacity of the copy of a row a pointer drags.
31
+ * @cssproperty --virtual-list-drag-preview-radius - The corner radius of the copy of a row a pointer drags.
32
+ * @cssproperty --virtual-list-drag-preview-shadow - The shadow that raises the copy of a row a pointer drags over the page.
33
+ * @cssproperty --virtual-list-dragging-opacity - The opacity of a row being dragged, in a `reorderable` list with `@fusion.dev/helix/virtual-list/reorder` imported.
34
+ * @cssproperty --virtual-list-drop-indicator-color - The color of the line where a dragged row would land.
35
+ * @cssproperty --virtual-list-drop-indicator-size - The thickness of the line where a dragged row would land.
27
36
  * @cssproperty --virtual-list-empty-color - The color of the text in the row shown when there are no items.
28
37
  * @cssproperty --virtual-list-empty-padding - The space around the text in the row shown when there are no items.
29
38
  * @cssproperty --virtual-list-loading-color - The color of the text in the row drawn while `loading` is set.