shaders 2.5.114 → 2.5.116
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/{AngularBlur-BgZWbEjj.js → AngularBlur-C1oRJ8Y9.js} +1 -1
- package/dist/core/{Aurora-KcUDr49P.js → Aurora-D5Pjk4ve.js} +1 -1
- package/dist/core/{Beam-CAnoOWgt.js → Beam-mvF5Ri7_.js} +1 -1
- package/dist/core/{Blob-CuRSRXmA.js → Blob-CLHx5s6k.js} +1 -1
- package/dist/core/{Bulge-6gRUYqZS.js → Bulge-wflTcWfI.js} +1 -1
- package/dist/core/{Checkerboard-ucave4-a.js → Checkerboard-Db7Rb57F.js} +1 -1
- package/dist/core/{ChromaFlow-DxQaUqPL.js → ChromaFlow-DbiVz3hF.js} +1 -1
- package/dist/core/{ChromaticAberration-DsMj-vBw.js → ChromaticAberration-Bg_I4XF-.js} +1 -1
- package/dist/core/{Circle-QgCuVo44.js → Circle-Bfi2e0Vm.js} +1 -1
- package/dist/core/{ConcentricSpin-Fegtvhl6.js → ConcentricSpin-bAFd5_WI.js} +1 -1
- package/dist/core/{ConicGradient-CQAPYlQg.js → ConicGradient-Bcw4_25S.js} +1 -1
- package/dist/core/{ContourLines-tDBvQOvb.js → ContourLines-CcQWPKLx.js} +1 -1
- package/dist/core/{Crescent-BkRt-XWy.js → Crescent-DiioCL2k.js} +1 -1
- package/dist/core/{Cross-kkY7feuC.js → Cross-CxQTHuxC.js} +1 -1
- package/dist/core/{Crystal-COGiLVvV.js → Crystal-B3iO7o_n.js} +1 -1
- package/dist/core/{CursorRipples-BqtHgpEq.js → CursorRipples-CsYAXG2E.js} +1 -1
- package/dist/core/{CursorTrail-CgRMXbTG.js → CursorTrail-CUtEP_-P.js} +1 -1
- package/dist/core/{DiamondGradient-BC3ugP8a.js → DiamondGradient-3b93bdrv.js} +1 -1
- package/dist/core/{DiffuseBlur-B-Vki4ab.js → DiffuseBlur-61Vuq571.js} +1 -1
- package/dist/core/{Dither-CDfDotR6.js → Dither-Cv0Uci60.js} +1 -1
- package/dist/core/{DotGrid-T9YbgC3V.js → DotGrid-C88Sux6D.js} +1 -1
- package/dist/core/{DropShadow-B7FzTp4H.js → DropShadow-EZyCC_97.js} +1 -1
- package/dist/core/{Duotone-CqQ0NMxS.js → Duotone-D4ads1T9.js} +1 -1
- package/dist/core/{Ellipse-CXxGqTYI.js → Ellipse-iwH-zEvD.js} +1 -1
- package/dist/core/{Emboss-LU-6cckT.js → Emboss-B4i61QDT.js} +1 -1
- package/dist/core/{FallingLines-CArEXajJ.js → FallingLines-CQBvwLqn.js} +1 -1
- package/dist/core/{FloatingParticles-DpYA0_TE.js → FloatingParticles-BAvsQDhF.js} +1 -1
- package/dist/core/{FlowField-CTWyjeXm.js → FlowField-D2xJ0Xr4.js} +1 -1
- package/dist/core/{Flower-MAwlZEv8.js → Flower-CdHVKJKu.js} +1 -1
- package/dist/core/{FlowingGradient-C0Zoyfd6.js → FlowingGradient-DVDnNpGd.js} +1 -1
- package/dist/core/{FlutedGlass-B4FlyBOn.js → FlutedGlass-trmBFfQr.js} +1 -1
- package/dist/core/{Fog-CIdU2Wn-.js → Fog-DrsxPyih.js} +1 -1
- package/dist/core/{Form3D-CqmOXXGj.js → Form3D-D1TtCjk8.js} +1 -1
- package/dist/core/{Glass-BCOkQbvW.js → Glass-B19xsZLn.js} +1 -1
- package/dist/core/{Godrays-w3ruw4NO.js → Godrays-Mvz7ha2E.js} +1 -1
- package/dist/core/{Grid-CKbLS5tU.js → Grid-CsD21Eqg.js} +1 -1
- package/dist/core/{GridDistortion-CVpebl48.js → GridDistortion-BcDqBh9i.js} +1 -1
- package/dist/core/{Halftone-BGQeBAgG.js → Halftone-3ImN5uQi.js} +1 -1
- package/dist/core/{HexGrid-BFrnZEZT.js → HexGrid-BWwIHYEg.js} +1 -1
- package/dist/core/{Kaleidoscope-B0_OCrob.js → Kaleidoscope-D1HmcoOv.js} +1 -1
- package/dist/core/{LensFlare-B8x1fOKu.js → LensFlare-Be-Z9whi.js} +1 -1
- package/dist/core/{LinearBlur-CshzmjfO.js → LinearBlur-xrHtMmWp.js} +1 -1
- package/dist/core/{LinearGradient-Bzwquw_Q.js → LinearGradient-BiIad_hA.js} +1 -1
- package/dist/core/{Liquify-ZMAyGUIb.js → Liquify-DkTxZZFW.js} +1 -1
- package/dist/core/{Mirror-Gb0fugtF.js → Mirror-BDTE51kP.js} +1 -1
- package/dist/core/{MultiPointGradient-D0QQwizn.js → MultiPointGradient-Bd-EGOI8.js} +1 -1
- package/dist/core/{Neon-eN4HlILk.js → Neon-BeGABHrs.js} +1 -1
- package/dist/core/{Perspective-SBZzprC5.js → Perspective-CqweSeFv.js} +1 -1
- package/dist/core/{Plasma-COq8mAw2.js → Plasma-DqKLBDYd.js} +1 -1
- package/dist/core/{PolarCoordinates-Ckvb1eG0.js → PolarCoordinates-CKT4CLT7.js} +1 -1
- package/dist/core/{Polygon-BP5eKEiz.js → Polygon-_3DSqSBg.js} +1 -1
- package/dist/core/{ProgressiveBlur-CNacb2Qx.js → ProgressiveBlur-Dh8W2bZ3.js} +1 -1
- package/dist/core/{RadialGradient-SASVv2vb.js → RadialGradient-Dj3-DdO7.js} +1 -1
- package/dist/core/{RectangularCoordinates-r0fTwVuL.js → RectangularCoordinates-DxeLJ2nt.js} +1 -1
- package/dist/core/{Ring-CdJlzjRV.js → Ring-4J6h5Iof.js} +1 -1
- package/dist/core/{Ripples-BRZPZszq.js → Ripples-CXeVzwUd.js} +1 -1
- package/dist/core/{RoundedRect-lzzi_1J7.js → RoundedRect-Dj-gqOc0.js} +1 -1
- package/dist/core/{Shatter-CC3EFcP9.js → Shatter-CDza7dSw.js} +1 -1
- package/dist/core/{SimplexNoise-0-rfeziU.js → SimplexNoise-HQTocBLm.js} +1 -1
- package/dist/core/{SineWave--i6bSrad.js → SineWave-S6nK8ZHR.js} +1 -1
- package/dist/core/{Smoke-BgPHDWDR.js → Smoke-DjlArYQW.js} +1 -1
- package/dist/core/{SmokeFill-Dtctgt2S.js → SmokeFill-rM9vUIm4.js} +1 -1
- package/dist/core/{SolidColor-D9ikFFu3.js → SolidColor-a8bCIksn.js} +1 -1
- package/dist/core/{Spherize-ZBorEEOU.js → Spherize-BHmD2ajL.js} +1 -1
- package/dist/core/{Spiral-sg-i02xw.js → Spiral-Bjsi8BMH.js} +1 -1
- package/dist/core/{Star-BcqCHzHG.js → Star-CJ4mkBZg.js} +1 -1
- package/dist/core/{Strands-XLpth60o.js → Strands-C9fEwaiR.js} +1 -1
- package/dist/core/{Stretch-CJUUU-I1.js → Stretch-Cvht8B0L.js} +1 -1
- package/dist/core/{Stripes-DEOXYnmy.js → Stripes-ChVSAeCO.js} +1 -1
- package/dist/core/{StudioBackground-B5dpTR_X.js → StudioBackground-B8hilROB.js} +1 -1
- package/dist/core/{Swirl-WqPvBF7u.js → Swirl-DZTPLx-W.js} +1 -1
- package/dist/core/{TiltShift-CYb6OQoU.js → TiltShift-DSQ-CsXz.js} +1 -1
- package/dist/core/{Tint-C-bJpwd0.js → Tint-P7KwJAU5.js} +1 -1
- package/dist/core/{Trapezoid-BvTEGdW_.js → Trapezoid-P9gXhH9a.js} +1 -1
- package/dist/core/{Tritone-LX-qUAGy.js → Tritone-_9VR2bhu.js} +1 -1
- package/dist/core/{Truchet-DE4lgYRb.js → Truchet-CbL5nYMj.js} +1 -1
- package/dist/core/{Twirl-CgRyZdT1.js → Twirl-C_97m32v.js} +1 -1
- package/dist/core/{Vesica-DqJMyqmy.js → Vesica-DYov_i53.js} +1 -1
- package/dist/core/{Vignette-CA12P9VO.js → Vignette-DmYVHciL.js} +1 -1
- package/dist/core/{Voronoi-DXeJ3xOf.js → Voronoi-kngFpTNB.js} +1 -1
- package/dist/core/{WaveDistortion-iyTUI1lj.js → WaveDistortion-DM-f_XCw.js} +1 -1
- package/dist/core/{Weave-Bn2CfeE4.js → Weave-DO0m0Dsh.js} +1 -1
- package/dist/core/{ZoomBlur-DOzP_sOK.js → ZoomBlur-DLaH226M.js} +1 -1
- package/dist/core/index.js +85 -85
- package/dist/core/registry.js +85 -85
- package/dist/core/{shaderRegistry-SmtG2mTo.js → shaderRegistry-BPtUQU-N.js} +83 -83
- package/dist/core/shaders/AngularBlur/index.js +2 -2
- package/dist/core/shaders/Aurora/index.js +2 -2
- package/dist/core/shaders/Beam/index.js +2 -2
- package/dist/core/shaders/Blob/index.js +2 -2
- package/dist/core/shaders/Bulge/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.js +2 -2
- package/dist/core/shaders/ChromaFlow/index.js +2 -2
- package/dist/core/shaders/ChromaticAberration/index.js +2 -2
- package/dist/core/shaders/Circle/index.js +2 -2
- package/dist/core/shaders/ConcentricSpin/index.js +2 -2
- package/dist/core/shaders/ConicGradient/index.js +2 -2
- package/dist/core/shaders/ContourLines/index.js +2 -2
- package/dist/core/shaders/Crescent/index.js +2 -2
- package/dist/core/shaders/Cross/index.js +2 -2
- package/dist/core/shaders/Crystal/index.js +2 -2
- package/dist/core/shaders/CursorRipples/index.js +2 -2
- package/dist/core/shaders/CursorTrail/index.js +2 -2
- package/dist/core/shaders/DiamondGradient/index.js +2 -2
- package/dist/core/shaders/DiffuseBlur/index.js +2 -2
- package/dist/core/shaders/Dither/index.js +2 -2
- package/dist/core/shaders/DotGrid/index.js +2 -2
- package/dist/core/shaders/DropShadow/index.js +2 -2
- package/dist/core/shaders/Duotone/index.js +2 -2
- package/dist/core/shaders/Ellipse/index.js +2 -2
- package/dist/core/shaders/Emboss/index.js +2 -2
- package/dist/core/shaders/FallingLines/index.js +2 -2
- package/dist/core/shaders/FloatingParticles/index.js +2 -2
- package/dist/core/shaders/FlowField/index.js +2 -2
- package/dist/core/shaders/Flower/index.js +2 -2
- package/dist/core/shaders/FlowingGradient/index.js +2 -2
- package/dist/core/shaders/FlutedGlass/index.js +2 -2
- package/dist/core/shaders/Fog/index.js +2 -2
- package/dist/core/shaders/Form3D/index.js +2 -2
- package/dist/core/shaders/Glass/index.js +2 -2
- package/dist/core/shaders/Godrays/index.js +2 -2
- package/dist/core/shaders/Grid/index.js +2 -2
- package/dist/core/shaders/GridDistortion/index.js +2 -2
- package/dist/core/shaders/Halftone/index.js +2 -2
- package/dist/core/shaders/HexGrid/index.js +2 -2
- package/dist/core/shaders/Kaleidoscope/index.js +2 -2
- package/dist/core/shaders/LensFlare/index.js +2 -2
- package/dist/core/shaders/LinearBlur/index.js +2 -2
- package/dist/core/shaders/LinearGradient/index.js +2 -2
- package/dist/core/shaders/Liquify/index.js +2 -2
- package/dist/core/shaders/Mirror/index.js +2 -2
- package/dist/core/shaders/MultiPointGradient/index.js +2 -2
- package/dist/core/shaders/Neon/index.js +2 -2
- package/dist/core/shaders/Perspective/index.js +2 -2
- package/dist/core/shaders/Plasma/index.js +2 -2
- package/dist/core/shaders/PolarCoordinates/index.js +2 -2
- package/dist/core/shaders/Polygon/index.js +2 -2
- package/dist/core/shaders/ProgressiveBlur/index.js +2 -2
- package/dist/core/shaders/RadialGradient/index.js +2 -2
- package/dist/core/shaders/RectangularCoordinates/index.js +2 -2
- package/dist/core/shaders/Ring/index.js +2 -2
- package/dist/core/shaders/Ripples/index.js +2 -2
- package/dist/core/shaders/RoundedRect/index.js +2 -2
- package/dist/core/shaders/Shatter/index.js +2 -2
- package/dist/core/shaders/SimplexNoise/index.js +2 -2
- package/dist/core/shaders/SineWave/index.js +2 -2
- package/dist/core/shaders/Smoke/index.js +2 -2
- package/dist/core/shaders/SmokeFill/index.js +2 -2
- package/dist/core/shaders/SolidColor/index.js +2 -2
- package/dist/core/shaders/Spherize/index.js +2 -2
- package/dist/core/shaders/Spiral/index.js +2 -2
- package/dist/core/shaders/Star/index.js +2 -2
- package/dist/core/shaders/Strands/index.js +2 -2
- package/dist/core/shaders/Stretch/index.js +2 -2
- package/dist/core/shaders/Stripes/index.js +2 -2
- package/dist/core/shaders/StudioBackground/index.js +2 -2
- package/dist/core/shaders/Swirl/index.js +2 -2
- package/dist/core/shaders/TiltShift/index.js +2 -2
- package/dist/core/shaders/Tint/index.js +2 -2
- package/dist/core/shaders/Trapezoid/index.js +2 -2
- package/dist/core/shaders/Tritone/index.js +2 -2
- package/dist/core/shaders/Truchet/index.js +2 -2
- package/dist/core/shaders/Twirl/index.js +2 -2
- package/dist/core/shaders/Vesica/index.js +2 -2
- package/dist/core/shaders/Vignette/index.js +2 -2
- package/dist/core/shaders/Voronoi/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.js +2 -2
- package/dist/core/shaders/Weave/index.js +2 -2
- package/dist/core/shaders/ZoomBlur/index.js +2 -2
- package/dist/core/{transformations-B5lM6fYX.js → transformations-CJcUeZIC.js} +23 -8
- package/dist/core/utilities/transformations/index.js +1 -1
- package/dist/core/utilities/transformations.d.ts.map +1 -1
- package/dist/js/createPreview.d.ts +7 -3
- package/dist/js/createPreview.d.ts.map +1 -1
- package/dist/js/createPreview.js +110 -4
- package/dist/js/createShader.js +1 -1
- package/dist/js/types.d.ts +32 -0
- package/dist/js/types.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.js +1 -1
- package/dist/react/Preview.js +113 -9
- package/dist/react/Shader.js +1 -1
- package/dist/react/bundle.js +196 -196
- package/dist/react/engine/Preview.d.ts +29 -0
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +1 -1
- package/dist/react/utils/generatePresetCode.template.d.ts.map +1 -1
- package/dist/solid/engine/Preview.d.ts +18 -0
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +69 -2
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +1 -1
- package/dist/solid/utils/generatePresetCode.template.d.ts.map +1 -1
- package/dist/svelte/engine/Preview.svelte.d.ts +18 -0
- package/dist/svelte/index.js +124 -13
- package/dist/svelte/source/engine/Preview.svelte +134 -10
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +111 -8
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +1 -1
- package/dist/vue/utils/generatePresetCode.template.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1362,7 +1362,7 @@ function isPropMapValue(value) {
|
|
|
1362
1362
|
function generatePropString(props, componentType, indent = " ") {
|
|
1363
1363
|
return Object.entries(props).sort(([a], [b]) => a.localeCompare(b)).filter(([key, value]) => {
|
|
1364
1364
|
if (key === "maskType" && value === "alpha") return false;
|
|
1365
|
-
if (key === "shape" && props.shapeSdfUrl) return false;
|
|
1365
|
+
if ((key === "shape" || key === "shapeType") && props.shapeSdfUrl) return false;
|
|
1366
1366
|
if (key === "transform" && typeof value === "object") {
|
|
1367
1367
|
if (Object.keys(DEFAULT_TRANSFORM).every((k) => value[k] === DEFAULT_TRANSFORM[k])) return false;
|
|
1368
1368
|
}
|
|
@@ -157,7 +157,9 @@ var Preview_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
157
157
|
apiBaseUrl: { default: "https://shaders.com" },
|
|
158
158
|
obfuscationKey: { default: "shaders-preview-key" },
|
|
159
159
|
watermarkText: { default: "Unlock your Shaders Pro license" },
|
|
160
|
-
watermarkLink: { default: "https://shaders.com/dashboard?pricing=true" }
|
|
160
|
+
watermarkLink: { default: "https://shaders.com/dashboard?pricing=true" },
|
|
161
|
+
configuration: {},
|
|
162
|
+
version: {}
|
|
161
163
|
},
|
|
162
164
|
setup(__props) {
|
|
163
165
|
const componentMap = {
|
|
@@ -288,11 +290,100 @@ var Preview_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
288
290
|
throw new Error("Failed to decode shader definition: invalid data or incorrect key");
|
|
289
291
|
}
|
|
290
292
|
}
|
|
293
|
+
const RESERVED_IDENTIFIERS = new Set([
|
|
294
|
+
"break",
|
|
295
|
+
"case",
|
|
296
|
+
"catch",
|
|
297
|
+
"class",
|
|
298
|
+
"const",
|
|
299
|
+
"continue",
|
|
300
|
+
"default",
|
|
301
|
+
"delete",
|
|
302
|
+
"do",
|
|
303
|
+
"else",
|
|
304
|
+
"export",
|
|
305
|
+
"extends",
|
|
306
|
+
"finally",
|
|
307
|
+
"for",
|
|
308
|
+
"function",
|
|
309
|
+
"if",
|
|
310
|
+
"import",
|
|
311
|
+
"in",
|
|
312
|
+
"instanceof",
|
|
313
|
+
"new",
|
|
314
|
+
"return",
|
|
315
|
+
"super",
|
|
316
|
+
"switch",
|
|
317
|
+
"this",
|
|
318
|
+
"throw",
|
|
319
|
+
"try",
|
|
320
|
+
"typeof",
|
|
321
|
+
"var",
|
|
322
|
+
"void",
|
|
323
|
+
"while",
|
|
324
|
+
"with",
|
|
325
|
+
"yield"
|
|
326
|
+
]);
|
|
327
|
+
function slugifyIdentifier(label, fallback) {
|
|
328
|
+
const cleaned = label.replace(/[^A-Za-z0-9]+/g, " ").trim();
|
|
329
|
+
if (!cleaned) return fallback;
|
|
330
|
+
const camel = cleaned.split(/\s+/).map((part, i) => i === 0 ? part.charAt(0).toLowerCase() + part.slice(1) : part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
331
|
+
const safe = /^[A-Za-z_$]/.test(camel) ? camel : `_${camel}`;
|
|
332
|
+
return RESERVED_IDENTIFIERS.has(safe) ? `_${safe}` : safe;
|
|
333
|
+
}
|
|
334
|
+
function buildKeyPropIdentifierMap(keyProps) {
|
|
335
|
+
const used = new Set(["style"]);
|
|
336
|
+
const map = /* @__PURE__ */ new Map();
|
|
337
|
+
if (!keyProps?.length) return map;
|
|
338
|
+
keyProps.forEach((kp, i) => {
|
|
339
|
+
if (!kp.targets?.length) return;
|
|
340
|
+
const base = slugifyIdentifier(kp.label, `keyProp${i}`);
|
|
341
|
+
let ident = base;
|
|
342
|
+
let suffix = 1;
|
|
343
|
+
while (used.has(ident)) {
|
|
344
|
+
suffix++;
|
|
345
|
+
ident = `${base}${suffix}`;
|
|
346
|
+
}
|
|
347
|
+
used.add(ident);
|
|
348
|
+
map.set(ident, kp);
|
|
349
|
+
});
|
|
350
|
+
return map;
|
|
351
|
+
}
|
|
352
|
+
function findInTree(id, list) {
|
|
353
|
+
for (const c of list) {
|
|
354
|
+
if (c.id === id) return c;
|
|
355
|
+
if (c.children?.length) {
|
|
356
|
+
const hit = findInTree(id, c.children);
|
|
357
|
+
if (hit) return hit;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
function applyConfiguration(definition, configuration, keyProps) {
|
|
363
|
+
if (!configuration || !keyProps?.length) return definition;
|
|
364
|
+
const entries = Object.entries(configuration);
|
|
365
|
+
if (entries.length === 0) return definition;
|
|
366
|
+
const identMap = buildKeyPropIdentifierMap(keyProps);
|
|
367
|
+
const cloned = JSON.parse(JSON.stringify(definition.components));
|
|
368
|
+
for (const [ident, value] of entries) {
|
|
369
|
+
const kp = identMap.get(ident);
|
|
370
|
+
if (!kp) continue;
|
|
371
|
+
for (const t of kp.targets ?? []) {
|
|
372
|
+
const comp = findInTree(t.component_id, cloned);
|
|
373
|
+
if (comp?.props && t.prop in comp.props) comp.props[t.prop] = value;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return {
|
|
377
|
+
...definition,
|
|
378
|
+
components: cloned
|
|
379
|
+
};
|
|
380
|
+
}
|
|
291
381
|
const props = __props;
|
|
292
382
|
const fetchedDefinition = ref(null);
|
|
383
|
+
const fetchedKeyProps = ref(null);
|
|
293
384
|
const resolvedDefinition = computed(() => {
|
|
294
|
-
if (fetchedDefinition.value) return
|
|
295
|
-
return
|
|
385
|
+
if (!fetchedDefinition.value) return null;
|
|
386
|
+
return applyConfiguration(fetchedDefinition.value, props.configuration, fetchedKeyProps.value);
|
|
296
387
|
});
|
|
297
388
|
async function fetchAndDecode(url) {
|
|
298
389
|
try {
|
|
@@ -300,7 +391,10 @@ var Preview_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
300
391
|
if (!response.ok) throw new Error(`Failed to fetch: ${response.status}`);
|
|
301
392
|
const data = await response.json();
|
|
302
393
|
const item = data.preset || data.shader;
|
|
303
|
-
if (item?.definition && typeof item.definition === "string")
|
|
394
|
+
if (item?.definition && typeof item.definition === "string") {
|
|
395
|
+
fetchedDefinition.value = decodePreviewDefinition(item.definition, props.obfuscationKey);
|
|
396
|
+
fetchedKeyProps.value = Array.isArray(item.key_props) ? item.key_props : null;
|
|
397
|
+
}
|
|
304
398
|
} catch (e) {
|
|
305
399
|
console.error("[Shaders Preview] Failed to fetch preview:", e);
|
|
306
400
|
}
|
|
@@ -308,14 +402,23 @@ var Preview_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
308
402
|
watch(() => props.shader, (token) => {
|
|
309
403
|
if (token) {
|
|
310
404
|
fetchedDefinition.value = null;
|
|
405
|
+
fetchedKeyProps.value = null;
|
|
311
406
|
fetchAndDecode(`${props.apiBaseUrl}/api/preview/shader/${token}`);
|
|
312
|
-
} else if (!props.presetId)
|
|
407
|
+
} else if (!props.presetId) {
|
|
408
|
+
fetchedDefinition.value = null;
|
|
409
|
+
fetchedKeyProps.value = null;
|
|
410
|
+
}
|
|
313
411
|
}, { immediate: true });
|
|
314
|
-
watch(() => props.presetId, (id) => {
|
|
412
|
+
watch(() => [props.presetId, props.version], ([id, version]) => {
|
|
315
413
|
if (id) {
|
|
316
414
|
fetchedDefinition.value = null;
|
|
317
|
-
|
|
318
|
-
|
|
415
|
+
fetchedKeyProps.value = null;
|
|
416
|
+
const versionParam = version ? `?version=${encodeURIComponent(version)}` : "";
|
|
417
|
+
fetchAndDecode(`${props.apiBaseUrl}/api/preview/preset/${id}${versionParam}`);
|
|
418
|
+
} else if (!props.shader) {
|
|
419
|
+
fetchedDefinition.value = null;
|
|
420
|
+
fetchedKeyProps.value = null;
|
|
421
|
+
}
|
|
319
422
|
}, { immediate: true });
|
|
320
423
|
onMounted(() => {
|
|
321
424
|
console.warn("[Shaders] Preview component is intended for use with a Shaders license. Visit https://shaders.com for more information.");
|
|
@@ -60,7 +60,7 @@ var Shader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
60
60
|
const startTelemetryWhenReady = () => {
|
|
61
61
|
const checkRendering = () => {
|
|
62
62
|
if (rendererInstance.value.getPerformanceStats().fps > 0) {
|
|
63
|
-
telemetryCollector = startTelemetry(rendererInstance.value, "2.5.
|
|
63
|
+
telemetryCollector = startTelemetry(rendererInstance.value, "2.5.116", props.disableTelemetry, props.isPreview);
|
|
64
64
|
if (telemetryCollector) telemetryCollector.start();
|
|
65
65
|
telemetryStartTimeout = null;
|
|
66
66
|
} else telemetryStartTimeout = setTimeout(checkRendering, 500);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,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;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,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;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AAy+CD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,CA4FlG;AAGD,eAAO,MAAM,mBAAmB,UA8G/B,CAAA"}
|
|
@@ -1360,7 +1360,7 @@ function isPropMapValue(value) {
|
|
|
1360
1360
|
function generatePropString(props, componentType, indent = " ") {
|
|
1361
1361
|
return Object.entries(props).sort(([a], [b]) => a.localeCompare(b)).filter(([key, value]) => {
|
|
1362
1362
|
if (key === "maskType" && value === "alpha") return false;
|
|
1363
|
-
if (key === "shape" && props.shapeSdfUrl) return false;
|
|
1363
|
+
if ((key === "shape" || key === "shapeType") && props.shapeSdfUrl) return false;
|
|
1364
1364
|
if (key === "transform" && typeof value === "object") {
|
|
1365
1365
|
if (Object.keys(DEFAULT_TRANSFORM).every((k) => value[k] === DEFAULT_TRANSFORM[k])) return false;
|
|
1366
1366
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.template.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.template.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,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;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.template.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.template.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,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;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AA0KD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,CA4FlG;AAGD,eAAO,MAAM,mBAAmB,OAG/B,CAAA"}
|