shaders 2.0.655 → 2.0.657

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 (111) hide show
  1. package/dist/react/components/Ascii.d.ts +9 -3
  2. package/dist/react/components/Ascii.d.ts.map +1 -1
  3. package/dist/react/components/Checkerboard.d.ts +9 -3
  4. package/dist/react/components/Checkerboard.d.ts.map +1 -1
  5. package/dist/react/components/Circle.d.ts +9 -3
  6. package/dist/react/components/Circle.d.ts.map +1 -1
  7. package/dist/react/components/DotGrid.d.ts +9 -3
  8. package/dist/react/components/DotGrid.d.ts.map +1 -1
  9. package/dist/react/components/FilmGrain.d.ts +9 -3
  10. package/dist/react/components/FilmGrain.d.ts.map +1 -1
  11. package/dist/react/components/GlassTiles.d.ts +9 -3
  12. package/dist/react/components/GlassTiles.d.ts.map +1 -1
  13. package/dist/react/components/Grayscale.d.ts +9 -3
  14. package/dist/react/components/Grayscale.d.ts.map +1 -1
  15. package/dist/react/components/Grid.d.ts +9 -3
  16. package/dist/react/components/Grid.d.ts.map +1 -1
  17. package/dist/react/components/GridDistortion.d.ts +9 -3
  18. package/dist/react/components/GridDistortion.d.ts.map +1 -1
  19. package/dist/react/components/HueShift.d.ts +9 -3
  20. package/dist/react/components/HueShift.d.ts.map +1 -1
  21. package/dist/react/components/ImageTexture.d.ts +9 -3
  22. package/dist/react/components/ImageTexture.d.ts.map +1 -1
  23. package/dist/react/components/Invert.d.ts +9 -3
  24. package/dist/react/components/Invert.d.ts.map +1 -1
  25. package/dist/react/components/LinearGradient.d.ts +9 -3
  26. package/dist/react/components/LinearGradient.d.ts.map +1 -1
  27. package/dist/react/components/Liquify.d.ts +9 -3
  28. package/dist/react/components/Liquify.d.ts.map +1 -1
  29. package/dist/react/components/Pixelate.d.ts +9 -3
  30. package/dist/react/components/Pixelate.d.ts.map +1 -1
  31. package/dist/react/components/Posterize.d.ts +9 -3
  32. package/dist/react/components/Posterize.d.ts.map +1 -1
  33. package/dist/react/components/RadialGradient.d.ts +9 -3
  34. package/dist/react/components/RadialGradient.d.ts.map +1 -1
  35. package/dist/react/components/Ripple.d.ts +9 -3
  36. package/dist/react/components/Ripple.d.ts.map +1 -1
  37. package/dist/react/components/Saturation.d.ts +9 -3
  38. package/dist/react/components/Saturation.d.ts.map +1 -1
  39. package/dist/react/components/SolidColor.d.ts +9 -3
  40. package/dist/react/components/SolidColor.d.ts.map +1 -1
  41. package/dist/react/components/Spiral.d.ts +9 -3
  42. package/dist/react/components/Spiral.d.ts.map +1 -1
  43. package/dist/react/components/Swirl.d.ts +9 -3
  44. package/dist/react/components/Swirl.d.ts.map +1 -1
  45. package/dist/react/components/Twirl.d.ts +9 -3
  46. package/dist/react/components/Twirl.d.ts.map +1 -1
  47. package/dist/react/components/Vibrance.d.ts +9 -3
  48. package/dist/react/components/Vibrance.d.ts.map +1 -1
  49. package/dist/react/engine/component.template.d.ts +9 -3
  50. package/dist/react/engine/component.template.d.ts.map +1 -1
  51. package/dist/react/index.cjs.map +1 -1
  52. package/dist/react/index.js.map +1 -1
  53. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  54. package/dist/react/utils/generatePresetCode.template.d.ts.map +1 -1
  55. package/dist/svelte/components/Ascii.svelte +16 -12
  56. package/dist/svelte/components/Ascii.svelte.d.ts +3 -26
  57. package/dist/svelte/components/Checkerboard.svelte +16 -12
  58. package/dist/svelte/components/Checkerboard.svelte.d.ts +3 -26
  59. package/dist/svelte/components/Circle.svelte +16 -12
  60. package/dist/svelte/components/Circle.svelte.d.ts +3 -26
  61. package/dist/svelte/components/DotGrid.svelte +16 -12
  62. package/dist/svelte/components/DotGrid.svelte.d.ts +3 -26
  63. package/dist/svelte/components/FilmGrain.svelte +16 -12
  64. package/dist/svelte/components/FilmGrain.svelte.d.ts +3 -26
  65. package/dist/svelte/components/GlassTiles.svelte +16 -12
  66. package/dist/svelte/components/GlassTiles.svelte.d.ts +3 -26
  67. package/dist/svelte/components/Grayscale.svelte +16 -12
  68. package/dist/svelte/components/Grayscale.svelte.d.ts +3 -26
  69. package/dist/svelte/components/Grid.svelte +16 -12
  70. package/dist/svelte/components/Grid.svelte.d.ts +3 -26
  71. package/dist/svelte/components/GridDistortion.svelte +16 -12
  72. package/dist/svelte/components/GridDistortion.svelte.d.ts +3 -26
  73. package/dist/svelte/components/HueShift.svelte +16 -12
  74. package/dist/svelte/components/HueShift.svelte.d.ts +3 -26
  75. package/dist/svelte/components/ImageTexture.svelte +16 -12
  76. package/dist/svelte/components/ImageTexture.svelte.d.ts +3 -26
  77. package/dist/svelte/components/Invert.svelte +16 -12
  78. package/dist/svelte/components/Invert.svelte.d.ts +3 -26
  79. package/dist/svelte/components/LinearGradient.svelte +16 -12
  80. package/dist/svelte/components/LinearGradient.svelte.d.ts +3 -26
  81. package/dist/svelte/components/Liquify.svelte +16 -12
  82. package/dist/svelte/components/Liquify.svelte.d.ts +3 -26
  83. package/dist/svelte/components/Pixelate.svelte +16 -12
  84. package/dist/svelte/components/Pixelate.svelte.d.ts +3 -26
  85. package/dist/svelte/components/Posterize.svelte +16 -12
  86. package/dist/svelte/components/Posterize.svelte.d.ts +3 -26
  87. package/dist/svelte/components/RadialGradient.svelte +16 -12
  88. package/dist/svelte/components/RadialGradient.svelte.d.ts +3 -26
  89. package/dist/svelte/components/Ripple.svelte +16 -12
  90. package/dist/svelte/components/Ripple.svelte.d.ts +3 -26
  91. package/dist/svelte/components/Saturation.svelte +16 -12
  92. package/dist/svelte/components/Saturation.svelte.d.ts +3 -26
  93. package/dist/svelte/components/SolidColor.svelte +16 -12
  94. package/dist/svelte/components/SolidColor.svelte.d.ts +3 -26
  95. package/dist/svelte/components/Spiral.svelte +16 -12
  96. package/dist/svelte/components/Spiral.svelte.d.ts +3 -26
  97. package/dist/svelte/components/Swirl.svelte +16 -12
  98. package/dist/svelte/components/Swirl.svelte.d.ts +3 -26
  99. package/dist/svelte/components/Twirl.svelte +16 -12
  100. package/dist/svelte/components/Twirl.svelte.d.ts +3 -26
  101. package/dist/svelte/components/Vibrance.svelte +16 -12
  102. package/dist/svelte/components/Vibrance.svelte.d.ts +3 -26
  103. package/dist/svelte/engine/Shader.svelte +9 -8
  104. package/dist/svelte/engine/Shader.svelte.d.ts +3 -26
  105. package/dist/svelte/engine/component.template.svelte +16 -12
  106. package/dist/svelte/engine/component.template.svelte.d.ts +3 -26
  107. package/dist/svelte/utils/generatePresetCode.js +1 -0
  108. package/dist/svelte/utils/generatePresetCode.template.js +1 -0
  109. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  110. package/dist/vue/utils/generatePresetCode.template.d.ts.map +1 -1
  111. package/package.json +7 -7
@@ -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;AAgBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CA8B/D;AAGD,eAAO,MAAM,mBAAmB,UAyB/B,CAAA"}
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;AAgBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CA8B/D;AAGD,eAAO,MAAM,mBAAmB,UA0B/B,CAAA"}
@@ -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;AAgBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CA8B/D;AAGD,eAAO,MAAM,mBAAmB,OAE/B,CAAA"}
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;AAgBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CA8B/D;AAGD,eAAO,MAAM,mBAAmB,OAG/B,CAAA"}
@@ -21,6 +21,7 @@
21
21
  id?: string;
22
22
  maskSource?: string;
23
23
  maskType?: string;
24
+ children?: import('svelte').Snippet;
24
25
  }
25
26
 
26
27
  // Define the component props and their default values from the shader definition
@@ -36,8 +37,8 @@
36
37
  )
37
38
  };
38
39
 
39
- // Declare props using Svelte 5's syntax with defaults
40
- const props = $props<ExtendedComponentProps>();
40
+ // Declare props using Svelte 5's syntax
41
+ const props: ExtendedComponentProps = $props();
41
42
 
42
43
  // Apply defaults manually since Svelte 5 doesn't have withDefaults equivalent
43
44
  const blendMode = props.blendMode ?? componentDefaults.blendMode;
@@ -45,11 +46,12 @@
45
46
  const id = props.id;
46
47
  const maskSource = props.maskSource;
47
48
  const maskType = props.maskType;
49
+ const { children } = props;
48
50
 
49
51
  /**
50
52
  * FIRST: Get the parent ID from context BEFORE setting our own context
51
53
  */
52
- const parentId = getContext<string>('ombreParentId');
54
+ const parentId = getContext<string>('shaderParentId');
53
55
  if (parentId === undefined) {
54
56
  throw new Error('Shader components must be used inside an <Shader> component or another shader component');
55
57
  }
@@ -62,7 +64,7 @@
62
64
  /**
63
65
  * THEN: Provide our unique identifier to child components
64
66
  */
65
- setContext('ombreParentId', instanceId);
67
+ setContext('shaderParentId', instanceId);
66
68
 
67
69
  /**
68
70
  * Creates a non-reactive object containing only props that differ from defaults
@@ -87,13 +89,15 @@
87
89
 
88
90
  /**
89
91
  * Creates the GPU uniform values map using only the changed props
92
+ * Note: Intentionally captures initial value - props are immutable after initialization
90
93
  */
94
+ // svelte-ignore state_referenced_locally
91
95
  const uniforms: UniformsMap = createUniformsMap(componentDefinition, shaderReadyProps, instanceId);
92
96
 
93
97
  /**
94
98
  * Get the node registration function from parent context
95
99
  */
96
- const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('ombreNodeRegister');
100
+ const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('shaderNodeRegister');
97
101
  if (parentRegister === undefined) {
98
102
  throw new Error('Shader components must be used inside an <Shader> component or another shader component');
99
103
  }
@@ -101,17 +105,17 @@
101
105
  /**
102
106
  * Get the uniform update function from parent context
103
107
  */
104
- const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('ombreUniformUpdate');
108
+ const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('shaderUniformUpdate');
105
109
  if (parentUniformUpdate === undefined) {
106
- throw new Error('Shader components require ombreUniformUpdate from parent');
110
+ throw new Error('Shader components require shaderUniformUpdate from parent');
107
111
  }
108
112
 
109
113
  /**
110
114
  * Get the metadata update function from parent context
111
115
  */
112
- const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('ombreMetadataUpdate');
116
+ const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('shaderMetadataUpdate');
113
117
  if (parentMetadataUpdate === undefined) {
114
- throw new Error('Shader components require ombreMetadataUpdate from parent');
118
+ throw new Error('Shader components require shaderMetadataUpdate from parent');
115
119
  }
116
120
 
117
121
  // Flag to track when component is registered
@@ -144,7 +148,7 @@
144
148
  id,
145
149
  mask: maskSource ? {
146
150
  source: maskSource,
147
- type: maskType || 'alpha'
151
+ type: (maskType || 'alpha') as MaskConfig['type']
148
152
  } : undefined,
149
153
  renderOrder: 0
150
154
  };
@@ -172,7 +176,7 @@
172
176
  id,
173
177
  mask: maskSource ? {
174
178
  source: maskSource,
175
- type: maskType || 'alpha'
179
+ type: (maskType || 'alpha') as MaskConfig['type']
176
180
  } as MaskConfig : undefined,
177
181
  renderOrder: 0
178
182
  },
@@ -199,4 +203,4 @@
199
203
  });
200
204
  </script>
201
205
 
202
- <slot></slot>
206
+ {@render children?.()}
@@ -9,31 +9,8 @@ interface ExtendedComponentProps extends Partial<ComponentProps> {
9
9
  id?: string;
10
10
  maskSource?: string;
11
11
  maskType?: string;
12
+ children?: import('svelte').Snippet;
12
13
  }
13
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
14
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
15
- $$bindings?: Bindings;
16
- } & Exports;
17
- (internal: unknown, props: Props & {
18
- $$events?: Events;
19
- $$slots?: Slots;
20
- }): Exports & {
21
- $set?: any;
22
- $on?: any;
23
- };
24
- z_$$bindings?: Bindings;
25
- }
26
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
27
- default: any;
28
- } ? Props extends Record<string, never> ? any : {
29
- children?: any;
30
- } : {});
31
- declare const Ascii: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<ExtendedComponentProps, {
32
- default: {};
33
- }>, {
34
- [evt: string]: CustomEvent<any>;
35
- }, {
36
- default: {};
37
- }, {}, "">;
38
- type Ascii = InstanceType<typeof Ascii>;
14
+ declare const Ascii: import("svelte").Component<ExtendedComponentProps, {}, "">;
15
+ type Ascii = ReturnType<typeof Ascii>;
39
16
  export default Ascii;
@@ -21,6 +21,7 @@
21
21
  id?: string;
22
22
  maskSource?: string;
23
23
  maskType?: string;
24
+ children?: import('svelte').Snippet;
24
25
  }
25
26
 
26
27
  // Define the component props and their default values from the shader definition
@@ -36,8 +37,8 @@
36
37
  )
37
38
  };
38
39
 
39
- // Declare props using Svelte 5's syntax with defaults
40
- const props = $props<ExtendedComponentProps>();
40
+ // Declare props using Svelte 5's syntax
41
+ const props: ExtendedComponentProps = $props();
41
42
 
42
43
  // Apply defaults manually since Svelte 5 doesn't have withDefaults equivalent
43
44
  const blendMode = props.blendMode ?? componentDefaults.blendMode;
@@ -45,11 +46,12 @@
45
46
  const id = props.id;
46
47
  const maskSource = props.maskSource;
47
48
  const maskType = props.maskType;
49
+ const { children } = props;
48
50
 
49
51
  /**
50
52
  * FIRST: Get the parent ID from context BEFORE setting our own context
51
53
  */
52
- const parentId = getContext<string>('ombreParentId');
54
+ const parentId = getContext<string>('shaderParentId');
53
55
  if (parentId === undefined) {
54
56
  throw new Error('Shader components must be used inside an <Shader> component or another shader component');
55
57
  }
@@ -62,7 +64,7 @@
62
64
  /**
63
65
  * THEN: Provide our unique identifier to child components
64
66
  */
65
- setContext('ombreParentId', instanceId);
67
+ setContext('shaderParentId', instanceId);
66
68
 
67
69
  /**
68
70
  * Creates a non-reactive object containing only props that differ from defaults
@@ -87,13 +89,15 @@
87
89
 
88
90
  /**
89
91
  * Creates the GPU uniform values map using only the changed props
92
+ * Note: Intentionally captures initial value - props are immutable after initialization
90
93
  */
94
+ // svelte-ignore state_referenced_locally
91
95
  const uniforms: UniformsMap = createUniformsMap(componentDefinition, shaderReadyProps, instanceId);
92
96
 
93
97
  /**
94
98
  * Get the node registration function from parent context
95
99
  */
96
- const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('ombreNodeRegister');
100
+ const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('shaderNodeRegister');
97
101
  if (parentRegister === undefined) {
98
102
  throw new Error('Shader components must be used inside an <Shader> component or another shader component');
99
103
  }
@@ -101,17 +105,17 @@
101
105
  /**
102
106
  * Get the uniform update function from parent context
103
107
  */
104
- const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('ombreUniformUpdate');
108
+ const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('shaderUniformUpdate');
105
109
  if (parentUniformUpdate === undefined) {
106
- throw new Error('Shader components require ombreUniformUpdate from parent');
110
+ throw new Error('Shader components require shaderUniformUpdate from parent');
107
111
  }
108
112
 
109
113
  /**
110
114
  * Get the metadata update function from parent context
111
115
  */
112
- const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('ombreMetadataUpdate');
116
+ const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('shaderMetadataUpdate');
113
117
  if (parentMetadataUpdate === undefined) {
114
- throw new Error('Shader components require ombreMetadataUpdate from parent');
118
+ throw new Error('Shader components require shaderMetadataUpdate from parent');
115
119
  }
116
120
 
117
121
  // Flag to track when component is registered
@@ -144,7 +148,7 @@
144
148
  id,
145
149
  mask: maskSource ? {
146
150
  source: maskSource,
147
- type: maskType || 'alpha'
151
+ type: (maskType || 'alpha') as MaskConfig['type']
148
152
  } : undefined,
149
153
  renderOrder: 0
150
154
  };
@@ -172,7 +176,7 @@
172
176
  id,
173
177
  mask: maskSource ? {
174
178
  source: maskSource,
175
- type: maskType || 'alpha'
179
+ type: (maskType || 'alpha') as MaskConfig['type']
176
180
  } as MaskConfig : undefined,
177
181
  renderOrder: 0
178
182
  },
@@ -199,4 +203,4 @@
199
203
  });
200
204
  </script>
201
205
 
202
- <slot></slot>
206
+ {@render children?.()}
@@ -9,31 +9,8 @@ interface ExtendedComponentProps extends Partial<ComponentProps> {
9
9
  id?: string;
10
10
  maskSource?: string;
11
11
  maskType?: string;
12
+ children?: import('svelte').Snippet;
12
13
  }
13
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
14
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
15
- $$bindings?: Bindings;
16
- } & Exports;
17
- (internal: unknown, props: Props & {
18
- $$events?: Events;
19
- $$slots?: Slots;
20
- }): Exports & {
21
- $set?: any;
22
- $on?: any;
23
- };
24
- z_$$bindings?: Bindings;
25
- }
26
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
27
- default: any;
28
- } ? Props extends Record<string, never> ? any : {
29
- children?: any;
30
- } : {});
31
- declare const Checkerboard: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<ExtendedComponentProps, {
32
- default: {};
33
- }>, {
34
- [evt: string]: CustomEvent<any>;
35
- }, {
36
- default: {};
37
- }, {}, "">;
38
- type Checkerboard = InstanceType<typeof Checkerboard>;
14
+ declare const Checkerboard: import("svelte").Component<ExtendedComponentProps, {}, "">;
15
+ type Checkerboard = ReturnType<typeof Checkerboard>;
39
16
  export default Checkerboard;
@@ -21,6 +21,7 @@
21
21
  id?: string;
22
22
  maskSource?: string;
23
23
  maskType?: string;
24
+ children?: import('svelte').Snippet;
24
25
  }
25
26
 
26
27
  // Define the component props and their default values from the shader definition
@@ -36,8 +37,8 @@
36
37
  )
37
38
  };
38
39
 
39
- // Declare props using Svelte 5's syntax with defaults
40
- const props = $props<ExtendedComponentProps>();
40
+ // Declare props using Svelte 5's syntax
41
+ const props: ExtendedComponentProps = $props();
41
42
 
42
43
  // Apply defaults manually since Svelte 5 doesn't have withDefaults equivalent
43
44
  const blendMode = props.blendMode ?? componentDefaults.blendMode;
@@ -45,11 +46,12 @@
45
46
  const id = props.id;
46
47
  const maskSource = props.maskSource;
47
48
  const maskType = props.maskType;
49
+ const { children } = props;
48
50
 
49
51
  /**
50
52
  * FIRST: Get the parent ID from context BEFORE setting our own context
51
53
  */
52
- const parentId = getContext<string>('ombreParentId');
54
+ const parentId = getContext<string>('shaderParentId');
53
55
  if (parentId === undefined) {
54
56
  throw new Error('Shader components must be used inside an <Shader> component or another shader component');
55
57
  }
@@ -62,7 +64,7 @@
62
64
  /**
63
65
  * THEN: Provide our unique identifier to child components
64
66
  */
65
- setContext('ombreParentId', instanceId);
67
+ setContext('shaderParentId', instanceId);
66
68
 
67
69
  /**
68
70
  * Creates a non-reactive object containing only props that differ from defaults
@@ -87,13 +89,15 @@
87
89
 
88
90
  /**
89
91
  * Creates the GPU uniform values map using only the changed props
92
+ * Note: Intentionally captures initial value - props are immutable after initialization
90
93
  */
94
+ // svelte-ignore state_referenced_locally
91
95
  const uniforms: UniformsMap = createUniformsMap(componentDefinition, shaderReadyProps, instanceId);
92
96
 
93
97
  /**
94
98
  * Get the node registration function from parent context
95
99
  */
96
- const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('ombreNodeRegister');
100
+ const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('shaderNodeRegister');
97
101
  if (parentRegister === undefined) {
98
102
  throw new Error('Shader components must be used inside an <Shader> component or another shader component');
99
103
  }
@@ -101,17 +105,17 @@
101
105
  /**
102
106
  * Get the uniform update function from parent context
103
107
  */
104
- const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('ombreUniformUpdate');
108
+ const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('shaderUniformUpdate');
105
109
  if (parentUniformUpdate === undefined) {
106
- throw new Error('Shader components require ombreUniformUpdate from parent');
110
+ throw new Error('Shader components require shaderUniformUpdate from parent');
107
111
  }
108
112
 
109
113
  /**
110
114
  * Get the metadata update function from parent context
111
115
  */
112
- const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('ombreMetadataUpdate');
116
+ const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('shaderMetadataUpdate');
113
117
  if (parentMetadataUpdate === undefined) {
114
- throw new Error('Shader components require ombreMetadataUpdate from parent');
118
+ throw new Error('Shader components require shaderMetadataUpdate from parent');
115
119
  }
116
120
 
117
121
  // Flag to track when component is registered
@@ -144,7 +148,7 @@
144
148
  id,
145
149
  mask: maskSource ? {
146
150
  source: maskSource,
147
- type: maskType || 'alpha'
151
+ type: (maskType || 'alpha') as MaskConfig['type']
148
152
  } : undefined,
149
153
  renderOrder: 0
150
154
  };
@@ -172,7 +176,7 @@
172
176
  id,
173
177
  mask: maskSource ? {
174
178
  source: maskSource,
175
- type: maskType || 'alpha'
179
+ type: (maskType || 'alpha') as MaskConfig['type']
176
180
  } as MaskConfig : undefined,
177
181
  renderOrder: 0
178
182
  },
@@ -199,4 +203,4 @@
199
203
  });
200
204
  </script>
201
205
 
202
- <slot></slot>
206
+ {@render children?.()}
@@ -9,31 +9,8 @@ interface ExtendedComponentProps extends Partial<ComponentProps> {
9
9
  id?: string;
10
10
  maskSource?: string;
11
11
  maskType?: string;
12
+ children?: import('svelte').Snippet;
12
13
  }
13
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
14
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
15
- $$bindings?: Bindings;
16
- } & Exports;
17
- (internal: unknown, props: Props & {
18
- $$events?: Events;
19
- $$slots?: Slots;
20
- }): Exports & {
21
- $set?: any;
22
- $on?: any;
23
- };
24
- z_$$bindings?: Bindings;
25
- }
26
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
27
- default: any;
28
- } ? Props extends Record<string, never> ? any : {
29
- children?: any;
30
- } : {});
31
- declare const Circle: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<ExtendedComponentProps, {
32
- default: {};
33
- }>, {
34
- [evt: string]: CustomEvent<any>;
35
- }, {
36
- default: {};
37
- }, {}, "">;
38
- type Circle = InstanceType<typeof Circle>;
14
+ declare const Circle: import("svelte").Component<ExtendedComponentProps, {}, "">;
15
+ type Circle = ReturnType<typeof Circle>;
39
16
  export default Circle;
@@ -21,6 +21,7 @@
21
21
  id?: string;
22
22
  maskSource?: string;
23
23
  maskType?: string;
24
+ children?: import('svelte').Snippet;
24
25
  }
25
26
 
26
27
  // Define the component props and their default values from the shader definition
@@ -36,8 +37,8 @@
36
37
  )
37
38
  };
38
39
 
39
- // Declare props using Svelte 5's syntax with defaults
40
- const props = $props<ExtendedComponentProps>();
40
+ // Declare props using Svelte 5's syntax
41
+ const props: ExtendedComponentProps = $props();
41
42
 
42
43
  // Apply defaults manually since Svelte 5 doesn't have withDefaults equivalent
43
44
  const blendMode = props.blendMode ?? componentDefaults.blendMode;
@@ -45,11 +46,12 @@
45
46
  const id = props.id;
46
47
  const maskSource = props.maskSource;
47
48
  const maskType = props.maskType;
49
+ const { children } = props;
48
50
 
49
51
  /**
50
52
  * FIRST: Get the parent ID from context BEFORE setting our own context
51
53
  */
52
- const parentId = getContext<string>('ombreParentId');
54
+ const parentId = getContext<string>('shaderParentId');
53
55
  if (parentId === undefined) {
54
56
  throw new Error('Shader components must be used inside an <Shader> component or another shader component');
55
57
  }
@@ -62,7 +64,7 @@
62
64
  /**
63
65
  * THEN: Provide our unique identifier to child components
64
66
  */
65
- setContext('ombreParentId', instanceId);
67
+ setContext('shaderParentId', instanceId);
66
68
 
67
69
  /**
68
70
  * Creates a non-reactive object containing only props that differ from defaults
@@ -87,13 +89,15 @@
87
89
 
88
90
  /**
89
91
  * Creates the GPU uniform values map using only the changed props
92
+ * Note: Intentionally captures initial value - props are immutable after initialization
90
93
  */
94
+ // svelte-ignore state_referenced_locally
91
95
  const uniforms: UniformsMap = createUniformsMap(componentDefinition, shaderReadyProps, instanceId);
92
96
 
93
97
  /**
94
98
  * Get the node registration function from parent context
95
99
  */
96
- const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('ombreNodeRegister');
100
+ const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('shaderNodeRegister');
97
101
  if (parentRegister === undefined) {
98
102
  throw new Error('Shader components must be used inside an <Shader> component or another shader component');
99
103
  }
@@ -101,17 +105,17 @@
101
105
  /**
102
106
  * Get the uniform update function from parent context
103
107
  */
104
- const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('ombreUniformUpdate');
108
+ const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('shaderUniformUpdate');
105
109
  if (parentUniformUpdate === undefined) {
106
- throw new Error('Shader components require ombreUniformUpdate from parent');
110
+ throw new Error('Shader components require shaderUniformUpdate from parent');
107
111
  }
108
112
 
109
113
  /**
110
114
  * Get the metadata update function from parent context
111
115
  */
112
- const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('ombreMetadataUpdate');
116
+ const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('shaderMetadataUpdate');
113
117
  if (parentMetadataUpdate === undefined) {
114
- throw new Error('Shader components require ombreMetadataUpdate from parent');
118
+ throw new Error('Shader components require shaderMetadataUpdate from parent');
115
119
  }
116
120
 
117
121
  // Flag to track when component is registered
@@ -144,7 +148,7 @@
144
148
  id,
145
149
  mask: maskSource ? {
146
150
  source: maskSource,
147
- type: maskType || 'alpha'
151
+ type: (maskType || 'alpha') as MaskConfig['type']
148
152
  } : undefined,
149
153
  renderOrder: 0
150
154
  };
@@ -172,7 +176,7 @@
172
176
  id,
173
177
  mask: maskSource ? {
174
178
  source: maskSource,
175
- type: maskType || 'alpha'
179
+ type: (maskType || 'alpha') as MaskConfig['type']
176
180
  } as MaskConfig : undefined,
177
181
  renderOrder: 0
178
182
  },
@@ -199,4 +203,4 @@
199
203
  });
200
204
  </script>
201
205
 
202
- <slot></slot>
206
+ {@render children?.()}
@@ -9,31 +9,8 @@ interface ExtendedComponentProps extends Partial<ComponentProps> {
9
9
  id?: string;
10
10
  maskSource?: string;
11
11
  maskType?: string;
12
+ children?: import('svelte').Snippet;
12
13
  }
13
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
14
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
15
- $$bindings?: Bindings;
16
- } & Exports;
17
- (internal: unknown, props: Props & {
18
- $$events?: Events;
19
- $$slots?: Slots;
20
- }): Exports & {
21
- $set?: any;
22
- $on?: any;
23
- };
24
- z_$$bindings?: Bindings;
25
- }
26
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
27
- default: any;
28
- } ? Props extends Record<string, never> ? any : {
29
- children?: any;
30
- } : {});
31
- declare const DotGrid: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<ExtendedComponentProps, {
32
- default: {};
33
- }>, {
34
- [evt: string]: CustomEvent<any>;
35
- }, {
36
- default: {};
37
- }, {}, "">;
38
- type DotGrid = InstanceType<typeof DotGrid>;
14
+ declare const DotGrid: import("svelte").Component<ExtendedComponentProps, {}, "">;
15
+ type DotGrid = ReturnType<typeof DotGrid>;
39
16
  export default DotGrid;
@@ -21,6 +21,7 @@
21
21
  id?: string;
22
22
  maskSource?: string;
23
23
  maskType?: string;
24
+ children?: import('svelte').Snippet;
24
25
  }
25
26
 
26
27
  // Define the component props and their default values from the shader definition
@@ -36,8 +37,8 @@
36
37
  )
37
38
  };
38
39
 
39
- // Declare props using Svelte 5's syntax with defaults
40
- const props = $props<ExtendedComponentProps>();
40
+ // Declare props using Svelte 5's syntax
41
+ const props: ExtendedComponentProps = $props();
41
42
 
42
43
  // Apply defaults manually since Svelte 5 doesn't have withDefaults equivalent
43
44
  const blendMode = props.blendMode ?? componentDefaults.blendMode;
@@ -45,11 +46,12 @@
45
46
  const id = props.id;
46
47
  const maskSource = props.maskSource;
47
48
  const maskType = props.maskType;
49
+ const { children } = props;
48
50
 
49
51
  /**
50
52
  * FIRST: Get the parent ID from context BEFORE setting our own context
51
53
  */
52
- const parentId = getContext<string>('ombreParentId');
54
+ const parentId = getContext<string>('shaderParentId');
53
55
  if (parentId === undefined) {
54
56
  throw new Error('Shader components must be used inside an <Shader> component or another shader component');
55
57
  }
@@ -62,7 +64,7 @@
62
64
  /**
63
65
  * THEN: Provide our unique identifier to child components
64
66
  */
65
- setContext('ombreParentId', instanceId);
67
+ setContext('shaderParentId', instanceId);
66
68
 
67
69
  /**
68
70
  * Creates a non-reactive object containing only props that differ from defaults
@@ -87,13 +89,15 @@
87
89
 
88
90
  /**
89
91
  * Creates the GPU uniform values map using only the changed props
92
+ * Note: Intentionally captures initial value - props are immutable after initialization
90
93
  */
94
+ // svelte-ignore state_referenced_locally
91
95
  const uniforms: UniformsMap = createUniformsMap(componentDefinition, shaderReadyProps, instanceId);
92
96
 
93
97
  /**
94
98
  * Get the node registration function from parent context
95
99
  */
96
- const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('ombreNodeRegister');
100
+ const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('shaderNodeRegister');
97
101
  if (parentRegister === undefined) {
98
102
  throw new Error('Shader components must be used inside an <Shader> component or another shader component');
99
103
  }
@@ -101,17 +105,17 @@
101
105
  /**
102
106
  * Get the uniform update function from parent context
103
107
  */
104
- const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('ombreUniformUpdate');
108
+ const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('shaderUniformUpdate');
105
109
  if (parentUniformUpdate === undefined) {
106
- throw new Error('Shader components require ombreUniformUpdate from parent');
110
+ throw new Error('Shader components require shaderUniformUpdate from parent');
107
111
  }
108
112
 
109
113
  /**
110
114
  * Get the metadata update function from parent context
111
115
  */
112
- const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('ombreMetadataUpdate');
116
+ const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('shaderMetadataUpdate');
113
117
  if (parentMetadataUpdate === undefined) {
114
- throw new Error('Shader components require ombreMetadataUpdate from parent');
118
+ throw new Error('Shader components require shaderMetadataUpdate from parent');
115
119
  }
116
120
 
117
121
  // Flag to track when component is registered
@@ -144,7 +148,7 @@
144
148
  id,
145
149
  mask: maskSource ? {
146
150
  source: maskSource,
147
- type: maskType || 'alpha'
151
+ type: (maskType || 'alpha') as MaskConfig['type']
148
152
  } : undefined,
149
153
  renderOrder: 0
150
154
  };
@@ -172,7 +176,7 @@
172
176
  id,
173
177
  mask: maskSource ? {
174
178
  source: maskSource,
175
- type: maskType || 'alpha'
179
+ type: (maskType || 'alpha') as MaskConfig['type']
176
180
  } as MaskConfig : undefined,
177
181
  renderOrder: 0
178
182
  },
@@ -199,4 +203,4 @@
199
203
  });
200
204
  </script>
201
205
 
202
- <slot></slot>
206
+ {@render children?.()}