shaders 2.3.64 → 2.3.66
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/core/{Kaleidoscope-BDTIWTFC.js → Kaleidoscope-B1mL-Yj3.js} +2 -2
- package/dist/core/{LensFlare-CxyJBEvr.js → LensFlare-sRuR8OkY.js} +4 -4
- package/dist/core/registry.js +2 -2
- package/dist/core/shaders/Kaleidoscope/index.js +1 -1
- package/dist/core/shaders/LensFlare/index.js +1 -1
- package/dist/react/Preview.js +12 -1
- package/dist/react/engine/Preview.d.ts +1 -1
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.d.ts +1 -1
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +13 -1
- package/dist/svelte/engine/Preview.svelte.d.ts +1 -0
- package/dist/svelte/index.js +4 -2
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
|
|
2
2
|
import { c as transformEdges, l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
3
3
|
import { t as unpremultiplyAlpha } from "./alpha-Byel9eTg.js";
|
|
4
|
-
import {
|
|
4
|
+
import { atan, convertToTexture, cos, float, length, mod, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
6
6
|
name: "Kaleidoscope",
|
|
7
7
|
category: "Distortions",
|
|
@@ -86,7 +86,7 @@ const componentDefinition = {
|
|
|
86
86
|
const centerPos = vec2(uniforms.center.uniform.x.mul(aspect), uniforms.center.uniform.y.oneMinus());
|
|
87
87
|
const delta = aspectCorrectedUV.sub(centerPos);
|
|
88
88
|
const radius = length(delta);
|
|
89
|
-
const currentAngle =
|
|
89
|
+
const currentAngle = atan(delta.y, delta.x);
|
|
90
90
|
const rotationRad = uniforms.angle.uniform.mul(Math.PI / 180);
|
|
91
91
|
const rotatedAngle = currentAngle.add(rotationRad);
|
|
92
92
|
const segmentAngle = float(Math.PI * 2).div(uniforms.segments.uniform);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as transformPosition } from "./transformations-B5lM6fYX.js";
|
|
2
2
|
import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
|
|
3
|
-
import { Fn, abs,
|
|
3
|
+
import { Fn, abs, atan, clamp, cos, dot, float, max, mix, pow, screenUV, sin, smoothstep, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
var spectralColor = Fn(([t]) => {
|
|
5
5
|
const TAU = float(6.2831853);
|
|
6
6
|
return vec3(cos(TAU.mul(t)).mul(.5).add(.5), cos(TAU.mul(t.sub(.333))).mul(.5).add(.5), cos(TAU.mul(t.sub(.666))).mul(.5).add(.5));
|
|
@@ -339,10 +339,10 @@ const componentDefinition = {
|
|
|
339
339
|
const rHalo = smoothstep(float(0), haloWidth, abs(antiLightDist.sub(uHaloRad.add(haloChromaSpread)))).oneMinus();
|
|
340
340
|
const gHalo = smoothstep(float(0), haloWidth, abs(antiLightDist.sub(uHaloRad))).oneMinus();
|
|
341
341
|
const bHalo = smoothstep(float(0), haloWidth, abs(antiLightDist.sub(uHaloRad.sub(haloChromaSpread)))).oneMinus();
|
|
342
|
-
const haloAngVar = sin(
|
|
342
|
+
const haloAngVar = sin(atan(toAntiLight.y, toAntiLight.x).mul(3).add(t.mul(.5))).mul(.12).add(.88);
|
|
343
343
|
const haloColor = vec3(rHalo, gHalo, bHalo).mul(uHaloInt).mul(haloAngVar);
|
|
344
|
-
const lightAngle =
|
|
345
|
-
const rotation =
|
|
344
|
+
const lightAngle = atan(toLightAR.y, toLightAR.x);
|
|
345
|
+
const rotation = atan(flareAxis.y, flareAxis.x.mul(aspect)).mul(.5).add(t.mul(.06));
|
|
346
346
|
const spikeAngle = lightAngle.add(rotation);
|
|
347
347
|
const primarySpikes = pow(abs(cos(spikeAngle.mul(uStarburstPts.div(2)))), float(3.5));
|
|
348
348
|
const secondarySpikes = pow(abs(cos(spikeAngle.add(.25).mul(uStarburstPts.div(2)))), float(7)).mul(.4);
|
package/dist/core/registry.js
CHANGED
|
@@ -40,8 +40,8 @@ import { n as componentDefinition$33 } from "./Halftone-YTJAc3Ie.js";
|
|
|
40
40
|
import { n as componentDefinition$34 } from "./HueShift-Bf2V6FVR.js";
|
|
41
41
|
import { n as componentDefinition$35 } from "./ImageTexture-6e1Gz4IG.js";
|
|
42
42
|
import { n as componentDefinition$36 } from "./Invert-c6RNEzsq.js";
|
|
43
|
-
import { n as componentDefinition$37 } from "./Kaleidoscope-
|
|
44
|
-
import { n as componentDefinition$38 } from "./LensFlare-
|
|
43
|
+
import { n as componentDefinition$37 } from "./Kaleidoscope-B1mL-Yj3.js";
|
|
44
|
+
import { n as componentDefinition$38 } from "./LensFlare-sRuR8OkY.js";
|
|
45
45
|
import { n as componentDefinition$39 } from "./LinearBlur-BtsleV0J.js";
|
|
46
46
|
import { n as componentDefinition$40 } from "./LinearGradient-BP91wtXm.js";
|
|
47
47
|
import { n as componentDefinition$41 } from "./Liquify-2u2lkBhB.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
2
|
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-Byel9eTg.js";
|
|
4
|
-
import { n as componentDefinition, t as Kaleidoscope_default } from "../../Kaleidoscope-
|
|
4
|
+
import { n as componentDefinition, t as Kaleidoscope_default } from "../../Kaleidoscope-B1mL-Yj3.js";
|
|
5
5
|
export { componentDefinition, Kaleidoscope_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import { n as componentDefinition, t as LensFlare_default } from "../../LensFlare-
|
|
3
|
+
import { n as componentDefinition, t as LensFlare_default } from "../../LensFlare-sRuR8OkY.js";
|
|
4
4
|
export { componentDefinition, LensFlare_default as default };
|
package/dist/react/Preview.js
CHANGED
|
@@ -96,6 +96,17 @@ var componentMap = {
|
|
|
96
96
|
ZoomBlur: lazy(() => import("./ZoomBlur.js"))
|
|
97
97
|
};
|
|
98
98
|
var DEFAULT_KEY = "shaders-preview-key";
|
|
99
|
+
function parseStyleString(style) {
|
|
100
|
+
return style.split(";").reduce((acc, declaration) => {
|
|
101
|
+
const [prop, ...rest] = declaration.split(":");
|
|
102
|
+
if (!prop?.trim()) return acc;
|
|
103
|
+
const value = rest.join(":").trim();
|
|
104
|
+
const trimmed = prop.trim();
|
|
105
|
+
const finalProp = trimmed.startsWith("--") ? trimmed : trimmed.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
106
|
+
acc[finalProp] = value;
|
|
107
|
+
return acc;
|
|
108
|
+
}, {});
|
|
109
|
+
}
|
|
99
110
|
function RenderComponent({ component }) {
|
|
100
111
|
const Component = componentMap[component.type];
|
|
101
112
|
if (!Component) {
|
|
@@ -160,7 +171,7 @@ const Preview = ({ shader, presetId, apiBaseUrl = "https://shaders.com", obfusca
|
|
|
160
171
|
return /* @__PURE__ */ jsxs("div", {
|
|
161
172
|
style: {
|
|
162
173
|
position: "relative",
|
|
163
|
-
...style
|
|
174
|
+
...typeof style === "string" ? parseStyleString(style) : style
|
|
164
175
|
},
|
|
165
176
|
className,
|
|
166
177
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../src/engine/Preview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4E,KAAK,aAAa,EAAE,KAAK,EAAE,EAA4B,MAAM,OAAO,CAAA;AAKvJ,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;IAC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C,EAAE,aAAa,GAAG,MAAM,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB;AA6BD,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CA+HpC,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../src/engine/Preview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,GAAG,EAAoC,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"Preview.d.ts","sourceRoot":"","sources":["../../src/engine/Preview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,GAAG,EAAoC,MAAM,UAAU,CAAA;AAkQlH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,GAAG,CAAC,aAAa,GAAG,MAAM,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAID,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,YAAY,eAmHlD"}
|
|
@@ -210,6 +210,18 @@ function RenderComponent(props) {
|
|
|
210
210
|
}
|
|
211
211
|
}));
|
|
212
212
|
}
|
|
213
|
+
function parseStyleString(style2) {
|
|
214
|
+
const map = style2.split(";").reduce((acc, declaration) => {
|
|
215
|
+
const [prop, ...rest] = declaration.split(":");
|
|
216
|
+
if (!(prop == null ? void 0 : prop.trim())) return acc;
|
|
217
|
+
const value = rest.join(":").trim();
|
|
218
|
+
const trimmed = prop.trim();
|
|
219
|
+
const finalProp = trimmed.startsWith("--") ? trimmed : trimmed.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
220
|
+
acc[finalProp] = value;
|
|
221
|
+
return acc;
|
|
222
|
+
}, {});
|
|
223
|
+
return map;
|
|
224
|
+
}
|
|
213
225
|
let hasWarnedLicense = false;
|
|
214
226
|
function Preview(props) {
|
|
215
227
|
if (!hasWarnedLicense) {
|
|
@@ -297,7 +309,7 @@ function Preview(props) {
|
|
|
297
309
|
insert(_el$2, watermarkText);
|
|
298
310
|
effect((_p$) => {
|
|
299
311
|
var _v$ = props.class, _v$2 = {
|
|
300
|
-
...props.style
|
|
312
|
+
...typeof props.style === "string" ? parseStyleString(props.style) : props.style
|
|
301
313
|
}, _v$3 = watermarkLink();
|
|
302
314
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
303
315
|
_p$.t = style(_el$, _v$2, _p$.t);
|
|
@@ -19,6 +19,7 @@ declare const Preview: $$__sveltets_2_IsomorphicComponent<{
|
|
|
19
19
|
obfuscationKey?: string | undefined;
|
|
20
20
|
watermarkText?: string | undefined;
|
|
21
21
|
watermarkLink?: string | undefined;
|
|
22
|
+
style?: string | undefined | undefined;
|
|
22
23
|
}, {
|
|
23
24
|
[evt: string]: CustomEvent<any>;
|
|
24
25
|
}, {}, {}, string>;
|
package/dist/svelte/index.js
CHANGED
|
@@ -10018,7 +10018,8 @@ function Preview($$anchor, $$props) {
|
|
|
10018
10018
|
"apiBaseUrl",
|
|
10019
10019
|
"obfuscationKey",
|
|
10020
10020
|
"watermarkText",
|
|
10021
|
-
"watermarkLink"
|
|
10021
|
+
"watermarkLink",
|
|
10022
|
+
"style"
|
|
10022
10023
|
]);
|
|
10023
10024
|
$.push($$props, false);
|
|
10024
10025
|
const componentMap = {
|
|
@@ -10134,6 +10135,7 @@ function Preview($$anchor, $$props) {
|
|
|
10134
10135
|
let obfuscationKey = $.prop($$props, "obfuscationKey", 8, "shaders-preview-key");
|
|
10135
10136
|
let watermarkText = $.prop($$props, "watermarkText", 8, "Unlock your Shaders Pro license");
|
|
10136
10137
|
let watermarkLink = $.prop($$props, "watermarkLink", 8, "https://shaders.com/dashboard?pricing=true");
|
|
10138
|
+
let style = $.prop($$props, "style", 8, void 0);
|
|
10137
10139
|
let resolvedDefinition = $.mutable_source(null);
|
|
10138
10140
|
let fetchedDefinition = $.mutable_source(null);
|
|
10139
10141
|
let watermarkHovered = $.mutable_source(false);
|
|
@@ -10167,7 +10169,7 @@ function Preview($$anchor, $$props) {
|
|
|
10167
10169
|
var div = root_1();
|
|
10168
10170
|
$.attribute_effect(div, () => ({
|
|
10169
10171
|
class: "shaders-preview",
|
|
10170
|
-
style:
|
|
10172
|
+
style: `position: relative; width: 100%; height: 100%;${style() ? " " + style() : ""}`,
|
|
10171
10173
|
...$$restProps
|
|
10172
10174
|
}));
|
|
10173
10175
|
var node_1 = $.child(div);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shaders",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.66",
|
|
4
4
|
"description": "Shader magic for modern frontends",
|
|
5
5
|
"author": "Shader Effects Inc.",
|
|
6
6
|
"homepage": "https://shaders.com/",
|
|
@@ -705,7 +705,7 @@
|
|
|
705
705
|
"typecheck": "tsc --noEmit"
|
|
706
706
|
},
|
|
707
707
|
"dependencies": {
|
|
708
|
-
"three": "^0.
|
|
708
|
+
"three": "^0.183.0"
|
|
709
709
|
},
|
|
710
710
|
"devDependencies": {
|
|
711
711
|
"@types/fs-extra": "^11.0.4",
|