@paper-design/shaders-react 0.0.0-canary.c899ed6 → 0.0.0-canary.d0d88e97

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.
@@ -1,18 +1,18 @@
1
1
  import { type ShaderSizeToContent } from '@paper-design/shaders';
2
- /** Props of the element that holds the children. It's what gets drawn, so it takes their layout and the visuals */
3
- export type ShaderLayoutProps = React.ComponentProps<'div'> & {
4
- [key: `data-${string}`]: unknown;
5
- };
6
2
  /**
7
3
  * Draws the children into u_image where the browser supports it, otherwise they're shown on top of the shader.
8
4
  * Either way they're held by the same content element, so they lay out the same.
9
5
  *
6
+ * The content element takes the shader's layout: its display, flex and grid styles through CSS inheritance, and its
7
+ * padding copied over, since the canvas covers the padding. So the children lay out as if the shader held them.
8
+ *
10
9
  * The content element fills the shader, except on the axes sized to content: there it takes the size of the children,
11
10
  * and the shader follows it (see `observeContentSize`).
12
11
  */
13
- export declare function useHtmlChildren(acceptsHtmlChildren: boolean, children: React.ReactNode, layoutProps: ShaderLayoutProps | undefined, sizeToContent: ShaderSizeToContent | undefined, shaderRef: React.RefObject<HTMLElement | null>): {
12
+ export declare function useHtmlChildren(acceptsHtmlChildren: boolean, children: React.ReactNode, sizeToContent: ShaderSizeToContent | undefined, shaderRef: React.RefObject<HTMLElement | null>): {
14
13
  hasHtmlChildren: boolean;
15
14
  addHtmlUniform: <T extends object>(uniforms: T) => T;
16
15
  renderedChildren: React.ReactNode;
16
+ shaderAttributes: Record<`data-${string}`, string | undefined> | undefined;
17
17
  sizeStyle: React.CSSProperties | undefined;
18
18
  };
@@ -6,38 +6,53 @@
6
6
  "use client";
7
7
  import { Children, useLayoutEffect, useRef, useSyncExternalStore } from "react";
8
8
  import { isHtmlInCanvasSupported, observeContentSize } from "@paper-design/shaders";
9
- import { useMergeRefs } from "./use-merge-refs.js";
10
9
  import { jsx } from "react/jsx-runtime";
11
10
  const subscribeToNothing = () => () => {
12
11
  };
13
12
  const isSupportedOnServer = () => true;
14
- function useHtmlChildren(acceptsHtmlChildren, children, layoutProps, sizeToContent, shaderRef) {
13
+ function useHtmlChildren(acceptsHtmlChildren, children, sizeToContent, shaderRef) {
15
14
  const contentRef = useRef(null);
16
- const mergedContentRef = useMergeRefs([contentRef, layoutProps?.ref]);
17
15
  const isSupported = useSyncExternalStore(subscribeToNothing, isHtmlInCanvasSupported, isSupportedOnServer);
18
- const isWrapped = acceptsHtmlChildren && Children.toArray(children).length > 0;
19
- const hasHtmlChildren = isWrapped && isSupported;
20
- const fitsWidth = isWrapped && (sizeToContent === "width" || sizeToContent === "both");
21
- const fitsHeight = isWrapped && (sizeToContent === "height" || sizeToContent === "both");
16
+ const hasChildren = acceptsHtmlChildren && Children.toArray(children).length > 0;
17
+ const hasHtmlChildren = hasChildren && isSupported;
18
+ const copyPadding = () => {
19
+ const shader = shaderRef.current;
20
+ const content2 = contentRef.current;
21
+ if (!shader || !content2) {
22
+ return;
23
+ }
24
+ const style = getComputedStyle(shader);
25
+ const padding = `${style.paddingTop} ${style.paddingRight} ${style.paddingBottom} ${style.paddingLeft}`;
26
+ if (content2.style.padding !== padding) {
27
+ content2.style.padding = padding;
28
+ }
29
+ };
30
+ useLayoutEffect(copyPadding);
31
+ useLayoutEffect(() => {
32
+ const shader = shaderRef.current;
33
+ const content2 = contentRef.current;
34
+ if (!shader || !content2) {
35
+ return;
36
+ }
37
+ const observer = new ResizeObserver(copyPadding);
38
+ observer.observe(shader);
39
+ observer.observe(content2, { box: "border-box" });
40
+ return () => observer.disconnect();
41
+ }, [hasChildren, hasHtmlChildren, shaderRef]);
22
42
  useLayoutEffect(() => {
23
43
  const content2 = contentRef.current;
24
44
  const shader = shaderRef.current;
25
- if (!content2 || !shader || !isWrapped || !sizeToContent) {
45
+ if (!content2 || !shader || !sizeToContent) {
26
46
  return;
27
47
  }
28
48
  return observeContentSize(shader, content2);
29
- }, [isWrapped, sizeToContent, hasHtmlChildren, shaderRef]);
49
+ }, [hasChildren, hasHtmlChildren, sizeToContent, shaderRef]);
30
50
  const addHtmlUniform = (uniforms) => hasHtmlChildren && contentRef.current ? { ...uniforms, u_image: contentRef.current } : uniforms;
31
- if (!isWrapped) {
32
- return { hasHtmlChildren, addHtmlUniform, renderedChildren: children, sizeStyle: void 0 };
33
- }
34
- const contentStyle = { ...layoutProps?.style };
35
- if (fitsWidth) {
36
- contentStyle.width = "max-content";
37
- }
38
- if (fitsHeight) {
39
- contentStyle.height = "auto";
51
+ if (!hasChildren) {
52
+ return { hasHtmlChildren, addHtmlUniform, renderedChildren: children, shaderAttributes: void 0, sizeStyle: void 0 };
40
53
  }
54
+ const fitsWidth = sizeToContent === "width" || sizeToContent === "both";
55
+ const fitsHeight = sizeToContent === "height" || sizeToContent === "both";
41
56
  let sizeStyle;
42
57
  if (fitsWidth || fitsHeight) {
43
58
  sizeStyle = {};
@@ -48,11 +63,12 @@ function useHtmlChildren(acceptsHtmlChildren, children, layoutProps, sizeToConte
48
63
  sizeStyle.height = "var(--paper-shader-content-height)";
49
64
  }
50
65
  }
51
- const content = /* @__PURE__ */ jsx("div", { ...layoutProps, ref: mergedContentRef, style: contentStyle, ...{ drawable: "" }, children });
66
+ const content = /* @__PURE__ */ jsx("div", { ref: contentRef, ...{ drawable: "" }, children });
52
67
  return {
53
68
  hasHtmlChildren,
54
69
  addHtmlUniform,
55
- renderedChildren: hasHtmlChildren ? /* @__PURE__ */ jsx("canvas", { ...{ content: "drawable", layoutsubtree: "" }, children: content }) : content,
70
+ renderedChildren: hasHtmlChildren ? /* @__PURE__ */ jsx("canvas", { ...{ content: "drawable", layoutsubtree: "" }, style: { display: "inherit" }, children: content }) : content,
71
+ shaderAttributes: { "data-paper-shader": "html", "data-size-to-content": sizeToContent },
56
72
  sizeStyle
57
73
  };
58
74
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/html-in-canvas.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport { Children, useLayoutEffect, useRef, useSyncExternalStore } from 'react';\nimport { isHtmlInCanvasSupported, observeContentSize, type ShaderSizeToContent } from '@paper-design/shaders';\nimport { useMergeRefs } from './use-merge-refs.js';\n\nconst subscribeToNothing = () => () => {};\n// Assumed on the server, so that supporting browsers don't re-render the canvas after hydration\nconst isSupportedOnServer = () => true;\n\n/** Props of the element that holds the children. It's what gets drawn, so it takes their layout and the visuals */\nexport type ShaderLayoutProps = React.ComponentProps<'div'> & { [key: `data-${string}`]: unknown };\n\n/**\n * Draws the children into u_image where the browser supports it, otherwise they're shown on top of the shader.\n * Either way they're held by the same content element, so they lay out the same.\n *\n * The content element fills the shader, except on the axes sized to content: there it takes the size of the children,\n * and the shader follows it (see `observeContentSize`).\n */\nexport function useHtmlChildren(\n acceptsHtmlChildren: boolean,\n children: React.ReactNode,\n layoutProps: ShaderLayoutProps | undefined,\n sizeToContent: ShaderSizeToContent | undefined,\n shaderRef: React.RefObject<HTMLElement | null>\n): {\n hasHtmlChildren: boolean;\n addHtmlUniform: <T extends object>(uniforms: T) => T;\n renderedChildren: React.ReactNode;\n sizeStyle: React.CSSProperties | undefined;\n} {\n const contentRef = useRef<HTMLDivElement>(null);\n const mergedContentRef = useMergeRefs([contentRef, layoutProps?.ref]);\n const isSupported = useSyncExternalStore(subscribeToNothing, isHtmlInCanvasSupported, isSupportedOnServer);\n const isWrapped = acceptsHtmlChildren && Children.toArray(children).length > 0;\n const hasHtmlChildren = isWrapped && isSupported;\n\n const fitsWidth = isWrapped && (sizeToContent === 'width' || sizeToContent === 'both');\n const fitsHeight = isWrapped && (sizeToContent === 'height' || sizeToContent === 'both');\n\n useLayoutEffect(() => {\n const content = contentRef.current;\n const shader = shaderRef.current;\n if (!content || !shader || !isWrapped || !sizeToContent) {\n return;\n }\n\n return observeContentSize(shader, content);\n }, [isWrapped, sizeToContent, hasHtmlChildren, shaderRef]);\n\n const addHtmlUniform = <T extends object>(uniforms: T): T =>\n hasHtmlChildren && contentRef.current ? { ...uniforms, u_image: contentRef.current } : uniforms;\n\n if (!isWrapped) {\n return { hasHtmlChildren, addHtmlUniform, renderedChildren: children, sizeStyle: undefined };\n }\n\n // Sized to content: the content element takes the size of the children, which can overflow the canvas\n const contentStyle: React.CSSProperties = { ...layoutProps?.style };\n if (fitsWidth) {\n contentStyle.width = 'max-content';\n }\n if (fitsHeight) {\n contentStyle.height = 'auto';\n }\n\n // The shader takes the measured content size\n let sizeStyle: React.CSSProperties | undefined;\n if (fitsWidth || fitsHeight) {\n sizeStyle = {};\n if (fitsWidth) {\n sizeStyle.width = 'var(--paper-shader-content-width)';\n }\n if (fitsHeight) {\n sizeStyle.height = 'var(--paper-shader-content-height)';\n }\n }\n\n const content = (\n <div {...layoutProps} ref={mergedContentRef} style={contentStyle} {...{ drawable: '' }}>\n {children}\n </div>\n );\n\n return {\n hasHtmlChildren,\n addHtmlUniform,\n renderedChildren: hasHtmlChildren ? (\n <canvas {...{ content: 'drawable', layoutsubtree: '' }}>{content}</canvas>\n ) : (\n content\n ),\n sizeStyle,\n };\n}\n"],
5
- "mappings": ";;;;;;AAEA,SAAS,UAAU,iBAAiB,QAAQ,4BAA4B;AACxE,SAAS,yBAAyB,0BAAoD;AACtF,SAAS,oBAAoB;AA4EzB;AA1EJ,MAAM,qBAAqB,MAAM,MAAM;AAAC;AAExC,MAAM,sBAAsB,MAAM;AAY3B,SAAS,gBACd,qBACA,UACA,aACA,eACA,WAMA;AACA,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,mBAAmB,aAAa,CAAC,YAAY,aAAa,GAAG,CAAC;AACpE,QAAM,cAAc,qBAAqB,oBAAoB,yBAAyB,mBAAmB;AACzG,QAAM,YAAY,uBAAuB,SAAS,QAAQ,QAAQ,EAAE,SAAS;AAC7E,QAAM,kBAAkB,aAAa;AAErC,QAAM,YAAY,cAAc,kBAAkB,WAAW,kBAAkB;AAC/E,QAAM,aAAa,cAAc,kBAAkB,YAAY,kBAAkB;AAEjF,kBAAgB,MAAM;AACpB,UAAMA,WAAU,WAAW;AAC3B,UAAM,SAAS,UAAU;AACzB,QAAI,CAACA,YAAW,CAAC,UAAU,CAAC,aAAa,CAAC,eAAe;AACvD;AAAA,IACF;AAEA,WAAO,mBAAmB,QAAQA,QAAO;AAAA,EAC3C,GAAG,CAAC,WAAW,eAAe,iBAAiB,SAAS,CAAC;AAEzD,QAAM,iBAAiB,CAAmB,aACxC,mBAAmB,WAAW,UAAU,EAAE,GAAG,UAAU,SAAS,WAAW,QAAQ,IAAI;AAEzF,MAAI,CAAC,WAAW;AACd,WAAO,EAAE,iBAAiB,gBAAgB,kBAAkB,UAAU,WAAW,OAAU;AAAA,EAC7F;AAGA,QAAM,eAAoC,EAAE,GAAG,aAAa,MAAM;AAClE,MAAI,WAAW;AACb,iBAAa,QAAQ;AAAA,EACvB;AACA,MAAI,YAAY;AACd,iBAAa,SAAS;AAAA,EACxB;AAGA,MAAI;AACJ,MAAI,aAAa,YAAY;AAC3B,gBAAY,CAAC;AACb,QAAI,WAAW;AACb,gBAAU,QAAQ;AAAA,IACpB;AACA,QAAI,YAAY;AACd,gBAAU,SAAS;AAAA,IACrB;AAAA,EACF;AAEA,QAAM,UACJ,oBAAC,SAAK,GAAG,aAAa,KAAK,kBAAkB,OAAO,cAAe,GAAG,EAAE,UAAU,GAAG,GAClF,UACH;AAGF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,kBAAkB,kBAChB,oBAAC,YAAQ,GAAG,EAAE,SAAS,YAAY,eAAe,GAAG,GAAI,mBAAQ,IAEjE;AAAA,IAEF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["'use client';\n\nimport { Children, useLayoutEffect, useRef, useSyncExternalStore } from 'react';\nimport { isHtmlInCanvasSupported, observeContentSize, type ShaderSizeToContent } from '@paper-design/shaders';\n\nconst subscribeToNothing = () => () => {};\n// Assumed on the server, so that supporting browsers don't re-render the canvas after hydration\nconst isSupportedOnServer = () => true;\n\n/**\n * Draws the children into u_image where the browser supports it, otherwise they're shown on top of the shader.\n * Either way they're held by the same content element, so they lay out the same.\n *\n * The content element takes the shader's layout: its display, flex and grid styles through CSS inheritance, and its\n * padding copied over, since the canvas covers the padding. So the children lay out as if the shader held them.\n *\n * The content element fills the shader, except on the axes sized to content: there it takes the size of the children,\n * and the shader follows it (see `observeContentSize`).\n */\nexport function useHtmlChildren(\n acceptsHtmlChildren: boolean,\n children: React.ReactNode,\n sizeToContent: ShaderSizeToContent | undefined,\n shaderRef: React.RefObject<HTMLElement | null>\n): {\n hasHtmlChildren: boolean;\n addHtmlUniform: <T extends object>(uniforms: T) => T;\n renderedChildren: React.ReactNode;\n shaderAttributes: Record<`data-${string}`, string | undefined> | undefined;\n sizeStyle: React.CSSProperties | undefined;\n} {\n const contentRef = useRef<HTMLDivElement>(null);\n const isSupported = useSyncExternalStore(subscribeToNothing, isHtmlInCanvasSupported, isSupportedOnServer);\n const hasChildren = acceptsHtmlChildren && Children.toArray(children).length > 0;\n const hasHtmlChildren = hasChildren && isSupported;\n\n const copyPadding = () => {\n const shader = shaderRef.current;\n const content = contentRef.current;\n if (!shader || !content) {\n return;\n }\n const style = getComputedStyle(shader);\n const padding = `${style.paddingTop} ${style.paddingRight} ${style.paddingBottom} ${style.paddingLeft}`;\n if (content.style.padding !== padding) {\n content.style.padding = padding;\n }\n };\n\n // After every render, since a style or class change can change the padding\n useLayoutEffect(copyPadding);\n\n // Padding can also change without a render, e.g. from a media query\n useLayoutEffect(() => {\n const shader = shaderRef.current;\n const content = contentRef.current;\n if (!shader || !content) {\n return;\n }\n const observer = new ResizeObserver(copyPadding);\n observer.observe(shader);\n observer.observe(content, { box: 'border-box' });\n return () => observer.disconnect();\n }, [hasChildren, hasHtmlChildren, shaderRef]);\n\n useLayoutEffect(() => {\n const content = contentRef.current;\n const shader = shaderRef.current;\n if (!content || !shader || !sizeToContent) {\n return;\n }\n\n return observeContentSize(shader, content);\n }, [hasChildren, hasHtmlChildren, sizeToContent, shaderRef]);\n\n const addHtmlUniform = <T extends object>(uniforms: T): T =>\n hasHtmlChildren && contentRef.current ? { ...uniforms, u_image: contentRef.current } : uniforms;\n\n if (!hasChildren) {\n return { hasHtmlChildren, addHtmlUniform, renderedChildren: children, shaderAttributes: undefined, sizeStyle: undefined };\n }\n\n const fitsWidth = sizeToContent === 'width' || sizeToContent === 'both';\n const fitsHeight = sizeToContent === 'height' || sizeToContent === 'both';\n\n // The shader takes the measured content size\n let sizeStyle: React.CSSProperties | undefined;\n if (fitsWidth || fitsHeight) {\n sizeStyle = {};\n if (fitsWidth) {\n sizeStyle.width = 'var(--paper-shader-content-width)';\n }\n if (fitsHeight) {\n sizeStyle.height = 'var(--paper-shader-content-height)';\n }\n }\n\n const content = (\n <div ref={contentRef} {...{ drawable: '' }}>\n {children}\n </div>\n );\n\n return {\n hasHtmlChildren,\n addHtmlUniform,\n renderedChildren: hasHtmlChildren ? (\n <canvas {...{ content: 'drawable', layoutsubtree: '' }} style={{ display: 'inherit' }}>\n {content}\n </canvas>\n ) : (\n content\n ),\n shaderAttributes: { 'data-paper-shader': 'html', 'data-size-to-content': sizeToContent },\n sizeStyle,\n };\n}\n"],
5
+ "mappings": ";;;;;;AAEA,SAAS,UAAU,iBAAiB,QAAQ,4BAA4B;AACxE,SAAS,yBAAyB,0BAAoD;AA+FlF;AA7FJ,MAAM,qBAAqB,MAAM,MAAM;AAAC;AAExC,MAAM,sBAAsB,MAAM;AAY3B,SAAS,gBACd,qBACA,UACA,eACA,WAOA;AACA,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,cAAc,qBAAqB,oBAAoB,yBAAyB,mBAAmB;AACzG,QAAM,cAAc,uBAAuB,SAAS,QAAQ,QAAQ,EAAE,SAAS;AAC/E,QAAM,kBAAkB,eAAe;AAEvC,QAAM,cAAc,MAAM;AACxB,UAAM,SAAS,UAAU;AACzB,UAAMA,WAAU,WAAW;AAC3B,QAAI,CAAC,UAAU,CAACA,UAAS;AACvB;AAAA,IACF;AACA,UAAM,QAAQ,iBAAiB,MAAM;AACrC,UAAM,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AK,YAAa,GAAG,EAAE,UAAU,GAAG,GACtC,UACH;AAGF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,kBAAkB,kBAChB,oBAAC,YAAQ,GAAG,EAAE,SAAS,YAAY,eAAe,GAAG,GAAG,OAAO,EAAE,SAAS,UAAU,GACjF,mBACH,IAEA;AAAA,IAEF,kBAAkB,EAAE,qBAAqB,QAAQ,wBAAwB,cAAc;AAAA,IACvF;AAAA,EACF;AACF;",
6
6
  "names": ["content"]
7
7
  }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export { ShaderMount } from './shader-mount.js';
2
2
  export type { ShaderMountProps, ShaderComponentProps } from './shader-mount.js';
3
- export type { ShaderLayoutProps } from './html-in-canvas.js';
4
3
  export type { ShaderSizeToContent } from '@paper-design/shaders';
5
4
  export { MeshGradient, meshGradientPresets } from './shaders/mesh-gradient.js';
6
5
  export type { MeshGradientProps } from './shaders/mesh-gradient.js';
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["'use client';\n\nexport { ShaderMount } from './shader-mount.js';\nexport type { ShaderMountProps, ShaderComponentProps } from './shader-mount.js';\nexport type { ShaderLayoutProps } from './html-in-canvas.js';\nexport type { ShaderSizeToContent } from '@paper-design/shaders';\n\nexport { MeshGradient, meshGradientPresets } from './shaders/mesh-gradient.js';\nexport type { MeshGradientProps } from './shaders/mesh-gradient.js';\nexport type { MeshGradientUniforms, MeshGradientParams } from '@paper-design/shaders';\n\nexport { SmokeRing, smokeRingPresets } from './shaders/smoke-ring.js';\nexport type { SmokeRingProps } from './shaders/smoke-ring.js';\nexport type { SmokeRingUniforms, SmokeRingParams } from '@paper-design/shaders';\n\nexport { NeuroNoise, neuroNoisePresets } from './shaders/neuro-noise.js';\nexport type { NeuroNoiseProps } from './shaders/neuro-noise.js';\nexport type { NeuroNoiseUniforms, NeuroNoiseParams } from '@paper-design/shaders';\n\nexport { DotOrbit, dotOrbitPresets } from './shaders/dot-orbit.js';\nexport type { DotOrbitProps } from './shaders/dot-orbit.js';\nexport type { DotOrbitUniforms, DotOrbitParams } from '@paper-design/shaders';\n\nexport { DotGrid, dotGridPresets } from './shaders/dot-grid.js';\nexport type { DotGridProps } from './shaders/dot-grid.js';\nexport type { DotGridUniforms, DotGridParams } from '@paper-design/shaders';\n\nexport { SimplexNoise, simplexNoisePresets } from './shaders/simplex-noise.js';\nexport type { SimplexNoiseProps } from './shaders/simplex-noise.js';\nexport type { SimplexNoiseUniforms, SimplexNoiseParams } from '@paper-design/shaders';\n\nexport { Metaballs, metaballsPresets } from './shaders/metaballs.js';\nexport type { MetaballsProps } from './shaders/metaballs.js';\nexport type { MetaballsUniforms, MetaballsParams } from '@paper-design/shaders';\n\nexport { Waves, wavesPresets } from './shaders/waves.js';\nexport type { WavesProps } from './shaders/waves.js';\nexport type { WavesUniforms, WavesParams } from '@paper-design/shaders';\n\nexport { PerlinNoise, perlinNoisePresets } from './shaders/perlin-noise.js';\nexport type { PerlinNoiseProps } from './shaders/perlin-noise.js';\nexport type { PerlinNoiseUniforms, PerlinNoiseParams } from '@paper-design/shaders';\n\nexport { Voronoi, voronoiPresets } from './shaders/voronoi.js';\nexport type { VoronoiProps } from './shaders/voronoi.js';\nexport type { VoronoiUniforms, VoronoiParams } from '@paper-design/shaders';\n\nexport { Warp, warpPresets } from './shaders/warp.js';\nexport type { WarpProps } from './shaders/warp.js';\nexport type { WarpUniforms, WarpParams, WarpPattern } from '@paper-design/shaders';\n\nexport { GodRays, godRaysPresets } from './shaders/god-rays.js';\nexport type { GodRaysProps } from './shaders/god-rays.js';\nexport type { GodRaysUniforms, GodRaysParams } from '@paper-design/shaders';\n\nexport { Spiral, spiralPresets } from './shaders/spiral.js';\nexport type { SpiralProps } from './shaders/spiral.js';\nexport type { SpiralUniforms, SpiralParams } from '@paper-design/shaders';\n\nexport { Swirl, swirlPresets } from './shaders/swirl.js';\nexport type { SwirlProps } from './shaders/swirl.js';\nexport type { SwirlUniforms, SwirlParams } from '@paper-design/shaders';\n\nexport { Dithering, ditheringPresets } from './shaders/dithering.js';\nexport type { DitheringProps } from './shaders/dithering.js';\nexport type { DitheringUniforms, DitheringParams } from '@paper-design/shaders';\n\nexport { GrainGradient, grainGradientPresets } from './shaders/grain-gradient.js';\nexport type { GrainGradientProps } from './shaders/grain-gradient.js';\nexport type { GrainGradientUniforms, GrainGradientParams } from '@paper-design/shaders';\n\nexport { PulsingBorder, pulsingBorderPresets } from './shaders/pulsing-border.js';\nexport type { PulsingBorderProps } from './shaders/pulsing-border.js';\nexport type { PulsingBorderUniforms, PulsingBorderParams } from '@paper-design/shaders';\n\nexport { ColorPanels, colorPanelsPresets } from './shaders/color-panels.js';\nexport type { ColorPanelsProps } from './shaders/color-panels.js';\nexport type { ColorPanelsUniforms, ColorPanelsParams } from '@paper-design/shaders';\n\nexport { StaticMeshGradient, staticMeshGradientPresets } from './shaders/static-mesh-gradient.js';\nexport type { StaticMeshGradientProps } from './shaders/static-mesh-gradient.js';\nexport type { StaticMeshGradientUniforms, StaticMeshGradientParams } from '@paper-design/shaders';\n\nexport { StaticRadialGradient, staticRadialGradientPresets } from './shaders/static-radial-gradient.js';\nexport type { StaticRadialGradientProps } from './shaders/static-radial-gradient.js';\nexport type { StaticRadialGradientUniforms, StaticRadialGradientParams } from '@paper-design/shaders';\n\nexport { PaperTexture, paperTexturePresets } from './shaders/paper-texture.js';\nexport type { PaperTextureProps } from './shaders/paper-texture.js';\nexport type { PaperTextureUniforms, PaperTextureParams } from '@paper-design/shaders';\n\nexport { FlutedGlass, flutedGlassPresets } from './shaders/fluted-glass.js';\nexport { type FlutedGlassProps } from './shaders/fluted-glass.js';\nexport { type FlutedGlassUniforms, type FlutedGlassParams } from '@paper-design/shaders';\n\nexport { Water, waterPresets } from './shaders/water.js';\nexport type { WaterProps } from './shaders/water.js';\nexport type { WaterUniforms, WaterParams } from '@paper-design/shaders';\n\nexport { ImageDithering, imageDitheringPresets } from './shaders/image-dithering.js';\nexport type { ImageDitheringProps } from './shaders/image-dithering.js';\nexport type { ImageDitheringUniforms, ImageDitheringParams } from '@paper-design/shaders';\n\nexport { LensDistortion, lensDistortionPresets } from './shaders/lens-distortion.js';\nexport type { LensDistortionProps } from './shaders/lens-distortion.js';\nexport type { LensDistortionUniforms, LensDistortionParams } from '@paper-design/shaders';\n\nexport { Heatmap, heatmapPresets } from './shaders/heatmap.js';\nexport type { HeatmapProps } from './shaders/heatmap.js';\nexport type { HeatmapUniforms, HeatmapParams } from '@paper-design/shaders';\n\nexport { LiquidMetal, liquidMetalPresets } from './shaders/liquid-metal.js';\nexport type { LiquidMetalProps } from './shaders/liquid-metal.js';\nexport type { LiquidMetalUniforms, LiquidMetalParams } from '@paper-design/shaders';\n\nexport { HalftoneDots, halftoneDotsPresets } from './shaders/halftone-dots.js';\nexport type { HalftoneDotsProps } from './shaders/halftone-dots.js';\nexport type { HalftoneDotsUniforms, HalftoneDotsParams } from '@paper-design/shaders';\n\nexport { HalftoneCmyk, halftoneCmykPresets } from './shaders/halftone-cmyk.js';\nexport type { HalftoneCmykProps } from './shaders/halftone-cmyk.js';\nexport type { HalftoneCmykUniforms, HalftoneCmykParams } from '@paper-design/shaders';\n\nexport { GemSmoke, gemSmokePresets } from './shaders/gem-smoke.js';\nexport type { GemSmokeProps } from './shaders/gem-smoke.js';\nexport type { GemSmokeUniforms, GemSmokeParams } from '@paper-design/shaders';\n\nexport { isPaperShaderElement, getShaderColorFromString } from '@paper-design/shaders';\nexport type { PaperShaderElement, ShaderFit, ShaderSizingParams, ShaderSizingUniforms } from '@paper-design/shaders';\n\nexport {\n colorPanelsMeta,\n dotOrbitMeta,\n godRaysMeta,\n grainGradientMeta,\n meshGradientMeta,\n metaballsMeta,\n paperTextureMeta,\n pulsingBorderMeta,\n simplexNoiseMeta,\n smokeRingMeta,\n swirlMeta,\n voronoiMeta,\n warpMeta,\n heatmapMeta,\n lensDistortionMeta,\n staticMeshGradientMeta,\n staticRadialGradientMeta,\n} from '@paper-design/shaders';\n"],
5
- "mappings": ";;;;;;AAEA,SAAS,mBAAmB;AAK5B,SAAS,cAAc,2BAA2B;AAIlD,SAAS,WAAW,wBAAwB;AAI5C,SAAS,YAAY,yBAAyB;AAI9C,SAAS,UAAU,uBAAuB;AAI1C,SAAS,SAAS,sBAAsB;AAIxC,SAAS,cAAc,2BAA2B;AAIlD,SAAS,WAAW,wBAAwB;AAI5C,SAAS,OAAO,oBAAoB;AAIpC,SAAS,aAAa,0BAA0B;AAIhD,SAAS,SAAS,sBAAsB;AAIxC,SAAS,MAAM,mBAAmB;AAIlC,SAAS,SAAS,sBAAsB;AAIxC,SAAS,QAAQ,qBAAqB;AAItC,SAAS,OAAO,oBAAoB;AAIpC,SAAS,WAAW,wBAAwB;AAI5C,SAAS,eAAe,4BAA4B;AAIpD,SAAS,eAAe,4BAA4B;AAIpD,SAAS,aAAa,0BAA0B;AAIhD,SAAS,oBAAoB,iCAAiC;AAI9D,SAAS,sBAAsB,mCAAmC;AAIlE,SAAS,cAAc,2BAA2B;AAIlD,SAAS,aAAa,0BAA0B;AAChD,eAAsC;AACtC,eAAiE;AAEjE,SAAS,OAAO,oBAAoB;AAIpC,SAAS,gBAAgB,6BAA6B;AAItD,SAAS,gBAAgB,6BAA6B;AAItD,SAAS,SAAS,sBAAsB;AAIxC,SAAS,aAAa,0BAA0B;AAIhD,SAAS,cAAc,2BAA2B;AAIlD,SAAS,cAAc,2BAA2B;AAIlD,SAAS,UAAU,uBAAuB;AAI1C,SAAS,sBAAsB,gCAAgC;AAG/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
4
+ "sourcesContent": ["'use client';\n\nexport { ShaderMount } from './shader-mount.js';\nexport type { ShaderMountProps, ShaderComponentProps } from './shader-mount.js';\nexport type { ShaderSizeToContent } from '@paper-design/shaders';\n\nexport { MeshGradient, meshGradientPresets } from './shaders/mesh-gradient.js';\nexport type { MeshGradientProps } from './shaders/mesh-gradient.js';\nexport type { MeshGradientUniforms, MeshGradientParams } from '@paper-design/shaders';\n\nexport { SmokeRing, smokeRingPresets } from './shaders/smoke-ring.js';\nexport type { SmokeRingProps } from './shaders/smoke-ring.js';\nexport type { SmokeRingUniforms, SmokeRingParams } from '@paper-design/shaders';\n\nexport { NeuroNoise, neuroNoisePresets } from './shaders/neuro-noise.js';\nexport type { NeuroNoiseProps } from './shaders/neuro-noise.js';\nexport type { NeuroNoiseUniforms, NeuroNoiseParams } from '@paper-design/shaders';\n\nexport { DotOrbit, dotOrbitPresets } from './shaders/dot-orbit.js';\nexport type { DotOrbitProps } from './shaders/dot-orbit.js';\nexport type { DotOrbitUniforms, DotOrbitParams } from '@paper-design/shaders';\n\nexport { DotGrid, dotGridPresets } from './shaders/dot-grid.js';\nexport type { DotGridProps } from './shaders/dot-grid.js';\nexport type { DotGridUniforms, DotGridParams } from '@paper-design/shaders';\n\nexport { SimplexNoise, simplexNoisePresets } from './shaders/simplex-noise.js';\nexport type { SimplexNoiseProps } from './shaders/simplex-noise.js';\nexport type { SimplexNoiseUniforms, SimplexNoiseParams } from '@paper-design/shaders';\n\nexport { Metaballs, metaballsPresets } from './shaders/metaballs.js';\nexport type { MetaballsProps } from './shaders/metaballs.js';\nexport type { MetaballsUniforms, MetaballsParams } from '@paper-design/shaders';\n\nexport { Waves, wavesPresets } from './shaders/waves.js';\nexport type { WavesProps } from './shaders/waves.js';\nexport type { WavesUniforms, WavesParams } from '@paper-design/shaders';\n\nexport { PerlinNoise, perlinNoisePresets } from './shaders/perlin-noise.js';\nexport type { PerlinNoiseProps } from './shaders/perlin-noise.js';\nexport type { PerlinNoiseUniforms, PerlinNoiseParams } from '@paper-design/shaders';\n\nexport { Voronoi, voronoiPresets } from './shaders/voronoi.js';\nexport type { VoronoiProps } from './shaders/voronoi.js';\nexport type { VoronoiUniforms, VoronoiParams } from '@paper-design/shaders';\n\nexport { Warp, warpPresets } from './shaders/warp.js';\nexport type { WarpProps } from './shaders/warp.js';\nexport type { WarpUniforms, WarpParams, WarpPattern } from '@paper-design/shaders';\n\nexport { GodRays, godRaysPresets } from './shaders/god-rays.js';\nexport type { GodRaysProps } from './shaders/god-rays.js';\nexport type { GodRaysUniforms, GodRaysParams } from '@paper-design/shaders';\n\nexport { Spiral, spiralPresets } from './shaders/spiral.js';\nexport type { SpiralProps } from './shaders/spiral.js';\nexport type { SpiralUniforms, SpiralParams } from '@paper-design/shaders';\n\nexport { Swirl, swirlPresets } from './shaders/swirl.js';\nexport type { SwirlProps } from './shaders/swirl.js';\nexport type { SwirlUniforms, SwirlParams } from '@paper-design/shaders';\n\nexport { Dithering, ditheringPresets } from './shaders/dithering.js';\nexport type { DitheringProps } from './shaders/dithering.js';\nexport type { DitheringUniforms, DitheringParams } from '@paper-design/shaders';\n\nexport { GrainGradient, grainGradientPresets } from './shaders/grain-gradient.js';\nexport type { GrainGradientProps } from './shaders/grain-gradient.js';\nexport type { GrainGradientUniforms, GrainGradientParams } from '@paper-design/shaders';\n\nexport { PulsingBorder, pulsingBorderPresets } from './shaders/pulsing-border.js';\nexport type { PulsingBorderProps } from './shaders/pulsing-border.js';\nexport type { PulsingBorderUniforms, PulsingBorderParams } from '@paper-design/shaders';\n\nexport { ColorPanels, colorPanelsPresets } from './shaders/color-panels.js';\nexport type { ColorPanelsProps } from './shaders/color-panels.js';\nexport type { ColorPanelsUniforms, ColorPanelsParams } from '@paper-design/shaders';\n\nexport { StaticMeshGradient, staticMeshGradientPresets } from './shaders/static-mesh-gradient.js';\nexport type { StaticMeshGradientProps } from './shaders/static-mesh-gradient.js';\nexport type { StaticMeshGradientUniforms, StaticMeshGradientParams } from '@paper-design/shaders';\n\nexport { StaticRadialGradient, staticRadialGradientPresets } from './shaders/static-radial-gradient.js';\nexport type { StaticRadialGradientProps } from './shaders/static-radial-gradient.js';\nexport type { StaticRadialGradientUniforms, StaticRadialGradientParams } from '@paper-design/shaders';\n\nexport { PaperTexture, paperTexturePresets } from './shaders/paper-texture.js';\nexport type { PaperTextureProps } from './shaders/paper-texture.js';\nexport type { PaperTextureUniforms, PaperTextureParams } from '@paper-design/shaders';\n\nexport { FlutedGlass, flutedGlassPresets } from './shaders/fluted-glass.js';\nexport { type FlutedGlassProps } from './shaders/fluted-glass.js';\nexport { type FlutedGlassUniforms, type FlutedGlassParams } from '@paper-design/shaders';\n\nexport { Water, waterPresets } from './shaders/water.js';\nexport type { WaterProps } from './shaders/water.js';\nexport type { WaterUniforms, WaterParams } from '@paper-design/shaders';\n\nexport { ImageDithering, imageDitheringPresets } from './shaders/image-dithering.js';\nexport type { ImageDitheringProps } from './shaders/image-dithering.js';\nexport type { ImageDitheringUniforms, ImageDitheringParams } from '@paper-design/shaders';\n\nexport { LensDistortion, lensDistortionPresets } from './shaders/lens-distortion.js';\nexport type { LensDistortionProps } from './shaders/lens-distortion.js';\nexport type { LensDistortionUniforms, LensDistortionParams } from '@paper-design/shaders';\n\nexport { Heatmap, heatmapPresets } from './shaders/heatmap.js';\nexport type { HeatmapProps } from './shaders/heatmap.js';\nexport type { HeatmapUniforms, HeatmapParams } from '@paper-design/shaders';\n\nexport { LiquidMetal, liquidMetalPresets } from './shaders/liquid-metal.js';\nexport type { LiquidMetalProps } from './shaders/liquid-metal.js';\nexport type { LiquidMetalUniforms, LiquidMetalParams } from '@paper-design/shaders';\n\nexport { HalftoneDots, halftoneDotsPresets } from './shaders/halftone-dots.js';\nexport type { HalftoneDotsProps } from './shaders/halftone-dots.js';\nexport type { HalftoneDotsUniforms, HalftoneDotsParams } from '@paper-design/shaders';\n\nexport { HalftoneCmyk, halftoneCmykPresets } from './shaders/halftone-cmyk.js';\nexport type { HalftoneCmykProps } from './shaders/halftone-cmyk.js';\nexport type { HalftoneCmykUniforms, HalftoneCmykParams } from '@paper-design/shaders';\n\nexport { GemSmoke, gemSmokePresets } from './shaders/gem-smoke.js';\nexport type { GemSmokeProps } from './shaders/gem-smoke.js';\nexport type { GemSmokeUniforms, GemSmokeParams } from '@paper-design/shaders';\n\nexport { isPaperShaderElement, getShaderColorFromString } from '@paper-design/shaders';\nexport type { PaperShaderElement, ShaderFit, ShaderSizingParams, ShaderSizingUniforms } from '@paper-design/shaders';\n\nexport {\n colorPanelsMeta,\n dotOrbitMeta,\n godRaysMeta,\n grainGradientMeta,\n meshGradientMeta,\n metaballsMeta,\n paperTextureMeta,\n pulsingBorderMeta,\n simplexNoiseMeta,\n smokeRingMeta,\n swirlMeta,\n voronoiMeta,\n warpMeta,\n heatmapMeta,\n lensDistortionMeta,\n staticMeshGradientMeta,\n staticRadialGradientMeta,\n} from '@paper-design/shaders';\n"],
5
+ "mappings": ";;;;;;AAEA,SAAS,mBAAmB;AAI5B,SAAS,cAAc,2BAA2B;AAIlD,SAAS,WAAW,wBAAwB;AAI5C,SAAS,YAAY,yBAAyB;AAI9C,SAAS,UAAU,uBAAuB;AAI1C,SAAS,SAAS,sBAAsB;AAIxC,SAAS,cAAc,2BAA2B;AAIlD,SAAS,WAAW,wBAAwB;AAI5C,SAAS,OAAO,oBAAoB;AAIpC,SAAS,aAAa,0BAA0B;AAIhD,SAAS,SAAS,sBAAsB;AAIxC,SAAS,MAAM,mBAAmB;AAIlC,SAAS,SAAS,sBAAsB;AAIxC,SAAS,QAAQ,qBAAqB;AAItC,SAAS,OAAO,oBAAoB;AAIpC,SAAS,WAAW,wBAAwB;AAI5C,SAAS,eAAe,4BAA4B;AAIpD,SAAS,eAAe,4BAA4B;AAIpD,SAAS,aAAa,0BAA0B;AAIhD,SAAS,oBAAoB,iCAAiC;AAI9D,SAAS,sBAAsB,mCAAmC;AAIlE,SAAS,cAAc,2BAA2B;AAIlD,SAAS,aAAa,0BAA0B;AAChD,eAAsC;AACtC,eAAiE;AAEjE,SAAS,OAAO,oBAAoB;AAIpC,SAAS,gBAAgB,6BAA6B;AAItD,SAAS,gBAAgB,6BAA6B;AAItD,SAAS,SAAS,sBAAsB;AAIxC,SAAS,aAAa,0BAA0B;AAIhD,SAAS,cAAc,2BAA2B;AAIlD,SAAS,cAAc,2BAA2B;AAIlD,SAAS,UAAU,uBAAuB;AAI1C,SAAS,sBAAsB,gCAAgC;AAG/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,4 @@
1
1
  import { type PaperShaderElement, type ShaderMotionParams, type ShaderSizeToContent } from '@paper-design/shaders';
2
- import { type ShaderLayoutProps } from './html-in-canvas.js';
3
2
  /**
4
3
  * React Shader Mount can also accept strings as uniform values, which will assumed to be URLs and loaded as images
5
4
  *
@@ -18,7 +17,6 @@ export interface ShaderMountProps extends Omit<React.ComponentProps<'div'>, 'col
18
17
  maxPixelCount?: number;
19
18
  webGlContextAttributes?: WebGLContextAttributes;
20
19
  acceptsHtmlChildren?: boolean;
21
- layoutProps?: ShaderLayoutProps;
22
20
  sizeToContent?: ShaderSizeToContent;
23
21
  /** Inline CSS width style */
24
22
  width?: string | number;
@@ -30,7 +28,6 @@ export interface ShaderComponentProps extends Omit<React.ComponentProps<'div'>,
30
28
  minPixelRatio?: number;
31
29
  maxPixelCount?: number;
32
30
  webGlContextAttributes?: WebGLContextAttributes;
33
- layoutProps?: ShaderLayoutProps;
34
31
  sizeToContent?: ShaderSizeToContent;
35
32
  /** Inline CSS width style */
36
33
  width?: string | number;
@@ -84,7 +84,6 @@ const ShaderMount = forwardRef(
84
84
  maxPixelCount,
85
85
  mipmaps,
86
86
  acceptsHtmlChildren = false,
87
- layoutProps,
88
87
  sizeToContent,
89
88
  children,
90
89
  style,
@@ -94,10 +93,9 @@ const ShaderMount = forwardRef(
94
93
  const divRef = useRef(null);
95
94
  const shaderMountRef = useRef(null);
96
95
  const webGlContextAttributesRef = useRef(webGlContextAttributes);
97
- const { hasHtmlChildren, addHtmlUniform, renderedChildren, sizeStyle } = useHtmlChildren(
96
+ const { hasHtmlChildren, addHtmlUniform, renderedChildren, shaderAttributes, sizeStyle } = useHtmlChildren(
98
97
  acceptsHtmlChildren,
99
98
  children,
100
- layoutProps,
101
99
  sizeToContent,
102
100
  divRef
103
101
  );
@@ -164,6 +162,7 @@ const ShaderMount = forwardRef(
164
162
  ...style,
165
163
  ...sizeStyle
166
164
  } : { ...style, ...sizeStyle },
165
+ ...shaderAttributes,
167
166
  ...divProps,
168
167
  children: renderedChildren
169
168
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/shader-mount.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport { useEffect, useRef, forwardRef, useState } from 'react';\nimport {\n ShaderMount as ShaderMountVanilla,\n emptyPixel,\n type PaperShaderElement,\n type ShaderMotionParams,\n type ShaderMountUniforms,\n type ShaderSizeToContent,\n} from '@paper-design/shaders';\nimport { useMergeRefs } from './use-merge-refs.js';\nimport { setMinImageSize } from './set-min-image-size.js';\nimport { useHtmlChildren, type ShaderLayoutProps } from './html-in-canvas.js';\n\n/**\n * React Shader Mount can also accept strings as uniform values, which will assumed to be URLs and loaded as images\n *\n * We accept undefined as a convenience for server rendering, when some things may be undefined\n * We just skip setting the uniform if it's undefined. This allows the shader mount to still take up space during server rendering\n */\ninterface ShaderMountUniformsReact {\n [key: string]: string | boolean | number | number[] | number[][] | HTMLImageElement | HTMLElement | undefined;\n}\n\nexport interface ShaderMountProps extends Omit<React.ComponentProps<'div'>, 'color' | 'ref'>, ShaderMotionParams {\n ref?: React.Ref<PaperShaderElement>;\n fragmentShader: string;\n uniforms: ShaderMountUniformsReact;\n mipmaps?: string[];\n minPixelRatio?: number;\n maxPixelCount?: number;\n webGlContextAttributes?: WebGLContextAttributes;\n acceptsHtmlChildren?: boolean;\n layoutProps?: ShaderLayoutProps;\n sizeToContent?: ShaderSizeToContent;\n\n /** Inline CSS width style */\n width?: string | number;\n /** Inline CSS height style */\n height?: string | number;\n}\n\nexport interface ShaderComponentProps extends Omit<React.ComponentProps<'div'>, 'color' | 'ref'> {\n ref?: React.Ref<PaperShaderElement>;\n minPixelRatio?: number;\n maxPixelCount?: number;\n webGlContextAttributes?: WebGLContextAttributes;\n layoutProps?: ShaderLayoutProps;\n sizeToContent?: ShaderSizeToContent;\n\n /** Inline CSS width style */\n width?: string | number;\n /** Inline CSS height style */\n height?: string | number;\n}\n\n/** Parse the provided uniforms, turning URL strings into loaded images */\nasync function processUniforms(uniformsProp: ShaderMountUniformsReact): Promise<ShaderMountUniforms> {\n const processedUniforms = {} as ShaderMountUniforms;\n const imageLoadPromises: Promise<void>[] = [];\n\n const isValidUrl = (url: string): boolean => {\n try {\n // Handle absolute paths\n if (url.startsWith('/')) return true;\n // Check if it's a valid URL\n new URL(url);\n return true;\n } catch {\n return false;\n }\n };\n\n const isExternalUrl = (url: string): boolean => {\n try {\n if (url.startsWith('/')) return false;\n const urlObject = new URL(url, window.location.origin);\n return urlObject.origin !== window.location.origin;\n } catch {\n return false;\n }\n };\n\n Object.entries(uniformsProp).forEach(([key, value]) => {\n if (typeof value === 'string') {\n // Use a transparent pixel for empty strings\n const url = value || emptyPixel;\n\n // Make sure the provided string is a valid URL or just skip trying to set this uniform entirely\n if (!isValidUrl(url)) {\n console.warn(`Uniform \"${key}\" has invalid URL \"${url}\". Skipping image loading.`);\n return;\n }\n\n const imagePromise = new Promise<void>((resolve, reject) => {\n const img = new Image();\n if (isExternalUrl(url)) {\n img.crossOrigin = 'anonymous';\n }\n img.onload = () => {\n setMinImageSize(img);\n processedUniforms[key] = img;\n resolve();\n };\n img.onerror = () => {\n console.error(`Could not set uniforms. Failed to load image at ${url}`);\n reject();\n };\n img.src = url;\n });\n\n imageLoadPromises.push(imagePromise);\n } else if (value instanceof HTMLImageElement) {\n const imagePromise = value.decode().then(() => {\n setMinImageSize(value);\n processedUniforms[key] = value;\n });\n imageLoadPromises.push(imagePromise);\n } else {\n processedUniforms[key] = value;\n }\n });\n\n await Promise.all(imageLoadPromises);\n return processedUniforms;\n}\n\n/**\n * A React component that mounts a shader and updates its uniforms as the component's props change\n * If you pass a string as a uniform value, it will be assumed to be a URL and attempted to be loaded as an image\n */\nexport const ShaderMount: React.FC<ShaderMountProps> = forwardRef<PaperShaderElement, ShaderMountProps>(\n function ShaderMountImpl(\n {\n fragmentShader,\n uniforms: uniformsProp,\n webGlContextAttributes,\n speed = 0,\n frame = 0,\n width,\n height,\n minPixelRatio,\n maxPixelCount,\n mipmaps,\n acceptsHtmlChildren = false,\n layoutProps,\n sizeToContent,\n children,\n style,\n ...divProps\n },\n forwardedRef\n ) {\n const [isInitialized, setIsInitialized] = useState(false);\n const divRef = useRef<PaperShaderElement>(null);\n const shaderMountRef: React.RefObject<ShaderMountVanilla | null> = useRef<ShaderMountVanilla>(null);\n const webGlContextAttributesRef = useRef(webGlContextAttributes);\n const { hasHtmlChildren, addHtmlUniform, renderedChildren, sizeStyle } = useHtmlChildren(\n acceptsHtmlChildren,\n children,\n layoutProps,\n sizeToContent,\n divRef\n );\n\n const getUniforms = (): ShaderMountUniformsReact => addHtmlUniform(uniformsProp);\n\n // Initialize the ShaderMountVanilla\n useEffect(() => {\n let isStale = false;\n\n const initShader = async () => {\n const uniforms = await processUniforms(getUniforms());\n\n if (!isStale && divRef.current && !shaderMountRef.current) {\n shaderMountRef.current = new ShaderMountVanilla(\n divRef.current,\n fragmentShader,\n uniforms,\n webGlContextAttributesRef.current,\n speed,\n frame,\n minPixelRatio,\n maxPixelCount,\n mipmaps\n );\n\n setIsInitialized(true);\n }\n };\n\n initShader();\n\n return () => {\n isStale = true;\n shaderMountRef.current?.dispose();\n shaderMountRef.current = null;\n };\n }, [fragmentShader, hasHtmlChildren]);\n\n // Uniforms\n useEffect(() => {\n let isStale = false;\n\n const updateUniforms = async () => {\n const uniforms = await processUniforms(getUniforms());\n\n if (!isStale) {\n // We only use the freshest uniforms otherwise we can get into race conditions\n // if some uniforms (images!) take longer to load in subsequent effect runs.\n shaderMountRef.current?.setUniforms(uniforms);\n }\n };\n\n updateUniforms();\n\n return () => {\n isStale = true;\n };\n }, [uniformsProp, isInitialized]);\n\n // Speed\n useEffect(() => {\n shaderMountRef.current?.setSpeed(speed);\n }, [speed, isInitialized]);\n\n // Max Pixel Count\n useEffect(() => {\n shaderMountRef.current?.setMaxPixelCount(maxPixelCount);\n }, [maxPixelCount, isInitialized]);\n\n // Min Pixel Ratio\n useEffect(() => {\n shaderMountRef.current?.setMinPixelRatio(minPixelRatio);\n }, [minPixelRatio, isInitialized]);\n\n // Frame\n useEffect(() => {\n shaderMountRef.current?.setFrame(frame);\n }, [frame, isInitialized]);\n\n const mergedRef = useMergeRefs([divRef, forwardedRef]) as unknown as React.RefObject<HTMLDivElement>;\n return (\n <div\n ref={mergedRef}\n style={\n width !== undefined || height !== undefined\n ? {\n width: typeof width === 'string' && isNaN(+width) === false ? +width : width,\n height: typeof height === 'string' && isNaN(+height) === false ? +height : height,\n ...style,\n ...sizeStyle,\n }\n : { ...style, ...sizeStyle }\n }\n {...divProps}\n >\n {renderedChildren}\n </div>\n );\n }\n);\n\nShaderMount.displayName = 'ShaderMount';\n"],
5
- "mappings": ";;;;;;AAEA,SAAS,WAAW,QAAQ,YAAY,gBAAgB;AACxD;AAAA,EACE,eAAe;AAAA,EACf;AAAA,OAKK;AACP,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,uBAA+C;AAuOlD;AA1LN,eAAe,gBAAgB,cAAsE;AACnG,QAAM,oBAAoB,CAAC;AAC3B,QAAM,oBAAqC,CAAC;AAE5C,QAAM,aAAa,CAAC,QAAyB;AAC3C,QAAI;AAEF,UAAI,IAAI,WAAW,GAAG,E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GZ,yBAAe,SAAS,YAAY,QAAQ;AAAA,QAC9C;AAAA,MACF;AAEA,qBAAe;AAEf,aAAO,MAAM;AACX,kBAAU;AAAA,MACZ;AAAA,IACF,GAAG,CAAC,cAAc,aAAa,CAAC;AAGhC,cAAU,MAAM;AACd,qBAAe,SAAS,SAAS,KAAK;AAAA,IACxC,GAAG,CAAC,OAAO,aAAa,CAAC;AAGzB,cAAU,MAAM;AACd,qBAAe,SAAS,iBAAiB,aAAa;AAAA,IACxD,GAAG,CAAC,eAAe,aAAa,CAAC;AAGjC,cAAU,MAAM;AACd,qBAAe,SAAS,iBAAiB,aAAa;AAAA,IACxD,GAAG,CAAC,eAAe,aAAa,CAAC;AAGjC,cAAU,MAAM;AACd,qBAAe,SAAS,SAAS,KAAK;AAAA,IACxC,GAAG,CAAC,OAAO,aAAa,CAAC;AAEzB,UAAM,YAAY,aAAa,CAAC,QAAQ,YAAY,CAAC;AACrD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,OACE,UAAU,UAAa,WAAW,SAC9B;AAAA,UACE,OAAO,OAAO,UAAU,YAAY,MAAM,CAAC,KAAK,MAAM,QAAQ,CAAC,QAAQ;AAAA,UACvE,QAAQ,OAAO,WAAW,YAAY,MAAM,CAAC,MAAM,MAAM,QAAQ,CAAC,SAAS;AAAA,UAC3E,GAAG;AAAA,UACH,GAAG;AAAA,QACL,IACA,EAAE,GAAG,OAAO,GAAG,UAAU;AAAA,QAE9B,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;",
4
+ "sourcesContent": ["'use client';\n\nimport { useEffect, useRef, forwardRef, useState } from 'react';\nimport {\n ShaderMount as ShaderMountVanilla,\n emptyPixel,\n type PaperShaderElement,\n type ShaderMotionParams,\n type ShaderMountUniforms,\n type ShaderSizeToContent,\n} from '@paper-design/shaders';\nimport { useMergeRefs } from './use-merge-refs.js';\nimport { setMinImageSize } from './set-min-image-size.js';\nimport { useHtmlChildren } from './html-in-canvas.js';\n\n/**\n * React Shader Mount can also accept strings as uniform values, which will assumed to be URLs and loaded as images\n *\n * We accept undefined as a convenience for server rendering, when some things may be undefined\n * We just skip setting the uniform if it's undefined. This allows the shader mount to still take up space during server rendering\n */\ninterface ShaderMountUniformsReact {\n [key: string]: string | boolean | number | number[] | number[][] | HTMLImageElement | HTMLElement | undefined;\n}\n\nexport interface ShaderMountProps extends Omit<React.ComponentProps<'div'>, 'color' | 'ref'>, ShaderMotionParams {\n ref?: React.Ref<PaperShaderElement>;\n fragmentShader: string;\n uniforms: ShaderMountUniformsReact;\n mipmaps?: string[];\n minPixelRatio?: number;\n maxPixelCount?: number;\n webGlContextAttributes?: WebGLContextAttributes;\n acceptsHtmlChildren?: boolean;\n sizeToContent?: ShaderSizeToContent;\n\n /** Inline CSS width style */\n width?: string | number;\n /** Inline CSS height style */\n height?: string | number;\n}\n\nexport interface ShaderComponentProps extends Omit<React.ComponentProps<'div'>, 'color' | 'ref'> {\n ref?: React.Ref<PaperShaderElement>;\n minPixelRatio?: number;\n maxPixelCount?: number;\n webGlContextAttributes?: WebGLContextAttributes;\n sizeToContent?: ShaderSizeToContent;\n\n /** Inline CSS width style */\n width?: string | number;\n /** Inline CSS height style */\n height?: string | number;\n}\n\n/** Parse the provided uniforms, turning URL strings into loaded images */\nasync function processUniforms(uniformsProp: ShaderMountUniformsReact): Promise<ShaderMountUniforms> {\n const processedUniforms = {} as ShaderMountUniforms;\n const imageLoadPromises: Promise<void>[] = [];\n\n const isValidUrl = (url: string): boolean => {\n try {\n // Handle absolute paths\n if (url.startsWith('/')) return true;\n // Check if it's a valid URL\n new URL(url);\n return true;\n } catch {\n return false;\n }\n };\n\n const isExternalUrl = (url: string): boolean => {\n try {\n if (url.startsWith('/')) return false;\n const urlObject = new URL(url, window.location.origin);\n return urlObject.origin !== window.location.origin;\n } catch {\n return false;\n }\n };\n\n Object.entries(uniformsProp).forEach(([key, value]) => {\n if (typeof value === 'string') {\n // Use a transparent pixel for empty strings\n const url = value || emptyPixel;\n\n // Make sure the provided string is a valid URL or just skip trying to set this uniform entirely\n if (!isValidUrl(url)) {\n console.warn(`Uniform \"${key}\" has invalid URL \"${url}\". Skipping image loading.`);\n return;\n }\n\n const imagePromise = new Promise<void>((resolve, reject) => {\n const img = new Image();\n if (isExternalUrl(url)) {\n img.crossOrigin = 'anonymous';\n }\n img.onload = () => {\n setMinImageSize(img);\n processedUniforms[key] = img;\n resolve();\n };\n img.onerror = () => {\n console.error(`Could not set uniforms. Failed to load image at ${url}`);\n reject();\n };\n img.src = url;\n });\n\n imageLoadPromises.push(imagePromise);\n } else if (value instanceof HTMLImageElement) {\n const imagePromise = value.decode().then(() => {\n setMinImageSize(value);\n processedUniforms[key] = value;\n });\n imageLoadPromises.push(imagePromise);\n } else {\n processedUniforms[key] = value;\n }\n });\n\n await Promise.all(imageLoadPromises);\n return processedUniforms;\n}\n\n/**\n * A React component that mounts a shader and updates its uniforms as the component's props change\n * If you pass a string as a uniform value, it will be assumed to be a URL and attempted to be loaded as an image\n */\nexport const ShaderMount: React.FC<ShaderMountProps> = forwardRef<PaperShaderElement, ShaderMountProps>(\n function ShaderMountImpl(\n {\n fragmentShader,\n uniforms: uniformsProp,\n webGlContextAttributes,\n speed = 0,\n frame = 0,\n width,\n height,\n minPixelRatio,\n maxPixelCount,\n mipmaps,\n acceptsHtmlChildren = false,\n sizeToContent,\n children,\n style,\n ...divProps\n },\n forwardedRef\n ) {\n const [isInitialized, setIsInitialized] = useState(false);\n const divRef = useRef<PaperShaderElement>(null);\n const shaderMountRef: React.RefObject<ShaderMountVanilla | null> = useRef<ShaderMountVanilla>(null);\n const webGlContextAttributesRef = useRef(webGlContextAttributes);\n const { hasHtmlChildren, addHtmlUniform, renderedChildren, shaderAttributes, sizeStyle } = useHtmlChildren(\n acceptsHtmlChildren,\n children,\n sizeToContent,\n divRef\n );\n\n const getUniforms = (): ShaderMountUniformsReact => addHtmlUniform(uniformsProp);\n\n // Initialize the ShaderMountVanilla\n useEffect(() => {\n let isStale = false;\n\n const initShader = async () => {\n const uniforms = await processUniforms(getUniforms());\n\n if (!isStale && divRef.current && !shaderMountRef.current) {\n shaderMountRef.current = new ShaderMountVanilla(\n divRef.current,\n fragmentShader,\n uniforms,\n webGlContextAttributesRef.current,\n speed,\n frame,\n minPixelRatio,\n maxPixelCount,\n mipmaps\n );\n\n setIsInitialized(true);\n }\n };\n\n initShader();\n\n return () => {\n isStale = true;\n shaderMountRef.current?.dispose();\n shaderMountRef.current = null;\n };\n }, [fragmentShader, hasHtmlChildren]);\n\n // Uniforms\n useEffect(() => {\n let isStale = false;\n\n const updateUniforms = async () => {\n const uniforms = await processUniforms(getUniforms());\n\n if (!isStale) {\n // We only use the freshest uniforms otherwise we can get into race conditions\n // if some uniforms (images!) take longer to load in subsequent effect runs.\n shaderMountRef.current?.setUniforms(uniforms);\n }\n };\n\n updateUniforms();\n\n return () => {\n isStale = true;\n };\n }, [uniformsProp, isInitialized]);\n\n // Speed\n useEffect(() => {\n shaderMountRef.current?.setSpeed(speed);\n }, [speed, isInitialized]);\n\n // Max Pixel Count\n useEffect(() => {\n shaderMountRef.current?.setMaxPixelCount(maxPixelCount);\n }, [maxPixelCount, isInitialized]);\n\n // Min Pixel Ratio\n useEffect(() => {\n shaderMountRef.current?.setMinPixelRatio(minPixelRatio);\n }, [minPixelRatio, isInitialized]);\n\n // Frame\n useEffect(() => {\n shaderMountRef.current?.setFrame(frame);\n }, [frame, isInitialized]);\n\n const mergedRef = useMergeRefs([divRef, forwardedRef]) as unknown as React.RefObject<HTMLDivElement>;\n return (\n <div\n ref={mergedRef}\n style={\n width !== undefined || height !== undefined\n ? {\n width: typeof width === 'string' && isNaN(+width) === false ? +width : width,\n height: typeof height === 'string' && isNaN(+height) === false ? +height : height,\n ...style,\n ...sizeStyle,\n }\n : { ...style, ...sizeStyle }\n }\n {...shaderAttributes}\n {...divProps}\n >\n {renderedChildren}\n </div>\n );\n }\n);\n\nShaderMount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,GAAG,UAAU;AAAA,QAE9B,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paper-design/shaders-react",
3
- "version": "0.0.0-canary.c899ed6",
3
+ "version": "0.0.0-canary.d0d88e97",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -26,7 +26,7 @@
26
26
  "type-check": "tsc --project tsconfig.json"
27
27
  },
28
28
  "dependencies": {
29
- "@paper-design/shaders": "0.0.0-canary.c899ed6"
29
+ "@paper-design/shaders": "0.0.0-canary.d0d88e97"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/react": "19.1.0"