@pathscale/ui 0.0.41 → 0.0.42

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 (2) hide show
  1. package/dist/index.js +44 -43
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7493,7 +7493,7 @@ const steps_Steps = Object.assign(Steps, {
7493
7493
  Step: Step
7494
7494
  });
7495
7495
  const steps = steps_Steps;
7496
- var SvgBackground_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><div class="absolute inset-0 z-0"></div><div class="relative z-10 h-full w-full">'), SvgBackground_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="absolute inset-0 z-5">');
7496
+ var SvgBackground_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><svg class="absolute inset-0 w-full h-full z-0"viewBox="0 0 700 700"xmlns=http://www.w3.org/2000/svg><defs><linearGradient gradientTransform="rotate(63, 0.5, 0.5)"x1=50% y1=0% x2=50% y2=100%><stop stop-opacity=1 offset=0%></stop><stop stop-opacity=1 offset=100%></stop></linearGradient><filter x=-20% y=-20% width=140% height=140% filterUnits=objectBoundingBox primitiveUnits=userSpaceOnUse color-interpolation-filters=sRGB><feTurbulence type=fractalNoise numOctaves=2 seed=10 stitchTiles=stitch result=turbulence></feTurbulence><feGaussianBlur in=turbulence result=blur></feGaussianBlur><feBlend in=SourceGraphic in2=blur result=blend></feBlend></filter></defs><rect width=700 height=700></rect></svg><div class="relative z-10 h-full w-full">'), SvgBackground_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="absolute inset-0 z-5">');
7497
7497
  function parseHSL(hslString) {
7498
7498
  const match = hslString.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
7499
7499
  if (!match) return null;
@@ -7509,10 +7509,19 @@ function interpolateHue(h1, h2, t) {
7509
7509
  else h2 += 360;
7510
7510
  return (h1 + (h2 - h1) * t + 360) % 360;
7511
7511
  }
7512
+ let instanceCounter = 0;
7513
+ function generateStableId() {
7514
+ return `svg-bg-${++instanceCounter}-${Date.now()}`;
7515
+ }
7512
7516
  function SvgBackground(props) {
7513
7517
  const { colorStart = 'hsl(129, 100%, 72%)', colorEnd = 'hsl(227, 100%, 50%)', opacity = 1, blurIntensity = 36, turbulenceFrequency = 0.007, animated = false, animationSpeed = 1, class: className = '', style = {}, children, darkness = 0 } = props;
7514
7518
  const [animationTime, setAnimationTime] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(0);
7515
7519
  let animationFrame = null;
7520
+ let gradientStop1Ref;
7521
+ let gradientStop2Ref;
7522
+ let turbulenceRef;
7523
+ const gradientId = `gradient-${generateStableId()}`;
7524
+ const filterId = `filter-${generateStableId()}`;
7516
7525
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
7517
7526
  if (animated) {
7518
7527
  const animate = ()=>{
@@ -7525,15 +7534,9 @@ function SvgBackground(props) {
7525
7534
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
7526
7535
  if (animationFrame) cancelAnimationFrame(animationFrame);
7527
7536
  });
7528
- const gradientId = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>`svg-bg-gradient-${Math.random().toString(36).substr(2, 9)}`, void 0, {
7529
- equals: false
7530
- });
7531
- const filterId = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>`svg-bg-filter-${Math.random().toString(36).substr(2, 9)}`, void 0, {
7532
- equals: false
7533
- });
7534
7537
  const startHSL = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>parseHSL(colorStart));
7535
7538
  const endHSL = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>parseHSL(colorEnd));
7536
- const animatedValues = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
7539
+ const animatedColors = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
7537
7540
  if (!animated) return {
7538
7541
  color1: colorStart,
7539
7542
  color2: colorEnd,
@@ -7579,7 +7582,6 @@ function SvgBackground(props) {
7579
7582
  }
7580
7583
  const turbFreq1 = turbulenceFrequency + 0.01 * turbulenceFrequency * turbMix1;
7581
7584
  const turbFreq2 = 0.4 * turbulenceFrequency + 0.01 * turbulenceFrequency * turbMix2;
7582
- if (Math.floor(10 * time) % 50 === 0) console.log(`Time: ${time.toFixed(2)}, Mix1: ${colorMix.toFixed(3)}, Mix2: ${colorMix2.toFixed(3)}, Combined: ${combinedWave.toFixed(3)}, C1: ${color1}, C2: ${color2}`);
7583
7585
  return {
7584
7586
  color1,
7585
7587
  color2,
@@ -7587,53 +7589,52 @@ function SvgBackground(props) {
7587
7589
  turbFreq2
7588
7590
  };
7589
7591
  });
7590
- const staticSvg = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
7591
- const values = animatedValues();
7592
- const svg = `
7593
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 700" width="700" height="700">
7594
- <defs>
7595
- <linearGradient gradientTransform="rotate(63, 0.5, 0.5)" x1="50%" y1="0%" x2="50%" y2="100%" id="${gradientId()}">
7596
- <stop stop-color="${values.color1}" stop-opacity="1" offset="0%"></stop>
7597
- <stop stop-color="${values.color2}" stop-opacity="1" offset="100%"></stop>
7598
- </linearGradient>
7599
- <filter id="${filterId()}" x="-20%" y="-20%" width="140%" height="140%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
7600
- <feTurbulence type="fractalNoise" baseFrequency="${values.turbFreq1} ${values.turbFreq2}" numOctaves="2" seed="10" stitchTiles="stitch" result="turbulence"></feTurbulence>
7601
- <feGaussianBlur stdDeviation="${blurIntensity} ${blurIntensity}" in="turbulence" edgeMode="duplicate" result="blur"></feGaussianBlur>
7602
- <feBlend mode="color-dodge" in="SourceGraphic" in2="blur" result="blend"></feBlend>
7603
- </filter>
7604
- </defs>
7605
- <rect width="700" height="700" fill="url(#${gradientId()})" filter="url(#${filterId()})"></rect>
7606
- </svg>
7607
- `;
7608
- return `data:image/svg+xml;base64,${btoa(svg)}`;
7592
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
7593
+ const colors = animatedColors();
7594
+ if (gradientStop1Ref) gradientStop1Ref.setAttribute('stop-color', colors.color1);
7595
+ if (gradientStop2Ref) gradientStop2Ref.setAttribute('stop-color', colors.color2);
7596
+ if (turbulenceRef) turbulenceRef.setAttribute('baseFrequency', `${colors.turbFreq1} ${colors.turbFreq2}`);
7609
7597
  });
7610
7598
  const backgroundStyle = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>({
7611
7599
  position: 'relative',
7612
- ...style,
7613
- '--svg-bg': `url("${staticSvg()}")`
7600
+ ...style
7614
7601
  }));
7615
7602
  return (()=>{
7616
- var _el$ = SvgBackground_tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
7603
+ var _el$ = SvgBackground_tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$3.nextSibling, _el$10 = _el$2.nextSibling;
7617
7604
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, `relative ${className}`);
7618
- _el$2.style.setProperty("background-image", "var(--svg-bg)");
7619
- _el$2.style.setProperty("background-size", "cover");
7620
- _el$2.style.setProperty("background-position", "center");
7621
- _el$2.style.setProperty("background-repeat", "no-repeat");
7605
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$4, "id", gradientId);
7606
+ var _ref$ = gradientStop1Ref;
7607
+ "function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$5) : gradientStop1Ref = _el$5;
7608
+ var _ref$2 = gradientStop2Ref;
7609
+ "function" == typeof _ref$2 ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$2, _el$6) : gradientStop2Ref = _el$6;
7610
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$7, "id", filterId);
7611
+ var _ref$3 = turbulenceRef;
7612
+ "function" == typeof _ref$3 ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$3, _el$8) : turbulenceRef = _el$8;
7613
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$9, "stdDeviation", `${blurIntensity} ${blurIntensity}`);
7614
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$0, "mode", "color-dodge");
7615
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$1, "fill", `url(#${gradientId})`);
7616
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$1, "filter", `url(#${filterId})`);
7622
7617
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, darkness > 0 && (()=>{
7623
- var _el$4 = SvgBackground_tmpl$2();
7624
- _el$4.style.setProperty("background-color", `rgba(0, 0, 0, ${darkness})`);
7625
- _el$4.style.setProperty("pointer-events", "none");
7626
- return _el$4;
7627
- })(), _el$3);
7628
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, children);
7618
+ var _el$11 = SvgBackground_tmpl$2();
7619
+ _el$11.style.setProperty("background-color", `rgba(0, 0, 0, ${darkness})`);
7620
+ _el$11.style.setProperty("pointer-events", "none");
7621
+ return _el$11;
7622
+ })(), _el$10);
7623
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$10, children);
7629
7624
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
7630
- var _v$ = backgroundStyle(), _v$2 = opacity.toString();
7625
+ var _v$ = backgroundStyle(), _v$2 = opacity.toString(), _v$3 = animatedColors().color1, _v$4 = animatedColors().color2, _v$5 = `${animatedColors().turbFreq1} ${animatedColors().turbFreq2}`;
7631
7626
  _p$.e = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.style)(_el$, _v$, _p$.e);
7632
7627
  _v$2 !== _p$.t && (null != (_p$.t = _v$2) ? _el$2.style.setProperty("opacity", _v$2) : _el$2.style.removeProperty("opacity"));
7628
+ _v$3 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$5, "stop-color", _p$.a = _v$3);
7629
+ _v$4 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$6, "stop-color", _p$.o = _v$4);
7630
+ _v$5 !== _p$.i && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$8, "baseFrequency", _p$.i = _v$5);
7633
7631
  return _p$;
7634
7632
  }, {
7635
7633
  e: void 0,
7636
- t: void 0
7634
+ t: void 0,
7635
+ a: void 0,
7636
+ o: void 0,
7637
+ i: void 0
7637
7638
  });
7638
7639
  return _el$;
7639
7640
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/ui",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "author": "pathscale",
5
5
  "repository": {
6
6
  "type": "git",