vireglass 2.3.0 → 2.3.1

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/dist/dom.d.cts CHANGED
@@ -2,7 +2,7 @@ import { B as BackdropSample } from './adaptation-BSbbdExK.cjs';
2
2
  import { V as VireGlassGeometry } from './geometry-RhKd7CM5.cjs';
3
3
  import { V as VireGlassOptics, a as VireGlassMaterial } from './material-CnUmdKg1.cjs';
4
4
  import { T as TouchWarp, M as MorphShape, V as VireGlassAccessibility, S as ScrollEdgeStyle, G as GroupPlane } from './group-model-DwtixGhG.cjs';
5
- import { V as VireGlassAccent } from './adapters-DugC6Qri.cjs';
5
+ import { V as VireGlassAccent } from './adapters-BOPIRMnL.cjs';
6
6
 
7
7
  /** Any `backdrop-filter` at all (e.g. `blur()`) — the fallback path's own requirement. */
8
8
  declare function supportsBackdropFilter(): boolean;
package/dist/dom.d.ts CHANGED
@@ -2,7 +2,7 @@ import { B as BackdropSample } from './adaptation-BSbbdExK.js';
2
2
  import { V as VireGlassGeometry } from './geometry-GvXtt-_S.js';
3
3
  import { V as VireGlassOptics, a as VireGlassMaterial } from './material-CnUmdKg1.js';
4
4
  import { T as TouchWarp, M as MorphShape, V as VireGlassAccessibility, S as ScrollEdgeStyle, G as GroupPlane } from './group-model-z4N27qsC.js';
5
- import { V as VireGlassAccent } from './adapters-BfeAopGO.js';
5
+ import { V as VireGlassAccent } from './adapters-B_amRBqc.js';
6
6
 
7
7
  /** Any `backdrop-filter` at all (e.g. `blur()`) — the fallback path's own requirement. */
8
8
  declare function supportsBackdropFilter(): boolean;
package/dist/dom.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { shadowTint, NO_ACCESSIBILITY, createGroupState, createDeform, elasticAllowed, contrastRimLuma, concentricRadius, scrollEdgeStrength, scrollEdgeStyle, applyGlassScale, GLASS_SCALE_DEFAULT, applyAccessibility, applyAppear, accentTone, accentAmount, raiseIntoGlass } from './chunk-CTTZNZFV.js';
2
2
  import { ambientFrom, shouldInkBeLight, INK_LIGHT, INK_DARK } from './chunk-JNRZNMJJ.js';
3
- import { touchWarp, sceneDistance, sceneGradient, sdfRoundedRect, VIREGLASS_MATERIAL, REST_LIGHT, resolveOptics, refractionStrength } from './chunk-H5QTBF67.js';
3
+ import { touchWarp, sceneDistance, sceneGradient, sdfRoundedRect, VIREGLASS_MATERIAL, REST_LIGHT, resolveOptics, refractionStrength } from './chunk-V47YU75P.js';
4
4
  import { shadowOpacity, bevelDp, thicknessDp, rimDp, shadowOpacityFrom, shadowReachDp, halfMinDp, MAX_STRETCH, roundedRectGeometry } from './chunk-SLRPHDV7.js';
5
5
  import { LENS, BODY, RIM, TOUCH, SHADOW, SHADOW_GAP, SCROLL_EDGE, BEVEL, SPECTRAL, DISPERSION } from './chunk-MMPK6DCK.js';
6
6
 
package/dist/index.cjs CHANGED
@@ -2476,6 +2476,26 @@ function convertEvalCalls(src) {
2476
2476
  out += src.slice(cursor);
2477
2477
  return out;
2478
2478
  }
2479
+ function stripComments(src) {
2480
+ let out = "";
2481
+ let i = 0;
2482
+ while (i < src.length) {
2483
+ if (src.startsWith("//", i)) {
2484
+ const end = src.indexOf("\n", i);
2485
+ i = end < 0 ? src.length : end;
2486
+ } else if (src.startsWith("/*", i)) {
2487
+ const end = src.indexOf("*/", i + 2);
2488
+ if (end < 0) throw new Error("vireglass/targets/glsl: unterminated block comment");
2489
+ const stop = end + 2;
2490
+ out += src.slice(i, stop).replace(/[^\n]/g, "");
2491
+ i = stop;
2492
+ } else {
2493
+ out += src[i];
2494
+ i += 1;
2495
+ }
2496
+ }
2497
+ return out;
2498
+ }
2479
2499
  function convertReturns(mainBody) {
2480
2500
  return mainBody.replace(/\breturn\s+([^;]+);/g, "fragColor = $1; return;");
2481
2501
  }
@@ -2506,7 +2526,7 @@ function addPrologue(src) {
2506
2526
  return "#version 300 es\nprecision highp float;\n\nout vec4 fragColor;\nuniform vec2 u_resolution;\n\n" + src;
2507
2527
  }
2508
2528
  function toGLSL(shaderSource) {
2509
- let out = shaderSource;
2529
+ let out = stripComments(shaderSource);
2510
2530
  out = convertEntryPoint(out);
2511
2531
  out = convertShaderUniforms(out);
2512
2532
  out = convertEvalCalls(out);
@@ -2637,6 +2657,7 @@ exports.smin = smin;
2637
2657
  exports.smoothPlane = smoothPlane;
2638
2658
  exports.specularPower = specularPower;
2639
2659
  exports.specularStrength = specularStrength;
2660
+ exports.stripComments = stripComments;
2640
2661
  exports.surfacePadDp = surfacePadDp;
2641
2662
  exports.thicknessDp = thicknessDp;
2642
2663
  exports.toAGSL = toAGSL;