shaders 2.0.0-alpha.0 → 2.0.0-alpha.10

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 (59) hide show
  1. package/LICENSE +40 -12
  2. package/dist/react/components/Circle.d.ts +1 -1
  3. package/dist/react/components/FilmGrain.d.ts +22 -0
  4. package/dist/react/components/FilmGrain.d.ts.map +1 -0
  5. package/dist/react/components/GlassTiles.d.ts +1 -1
  6. package/dist/react/components/Grayscale.d.ts +1 -1
  7. package/dist/react/components/HueShift.d.ts +1 -1
  8. package/dist/react/components/Invert.d.ts +1 -1
  9. package/dist/react/components/LinearGradient.d.ts +1 -1
  10. package/dist/react/components/Posterize.d.ts +1 -1
  11. package/dist/react/components/Saturation.d.ts +1 -1
  12. package/dist/react/components/SolidColor.d.ts +1 -1
  13. package/dist/react/components/Swirl.d.ts +22 -0
  14. package/dist/react/components/Swirl.d.ts.map +1 -0
  15. package/dist/react/components/Twirl.d.ts +1 -1
  16. package/dist/react/components/Vibrance.d.ts +1 -1
  17. package/dist/react/engine/{Ombre.d.ts → Shader.d.ts} +4 -4
  18. package/dist/react/engine/Shader.d.ts.map +1 -0
  19. package/dist/react/engine/component.template.d.ts +1 -1
  20. package/dist/react/index.cjs +23 -23
  21. package/dist/react/index.cjs.map +1 -1
  22. package/dist/react/index.d.ts +3 -1
  23. package/dist/react/index.d.ts.map +1 -1
  24. package/dist/react/index.js +5721 -5400
  25. package/dist/react/index.js.map +1 -1
  26. package/dist/svelte/components/Circle.svelte +2 -2
  27. package/dist/svelte/components/DotGrid.svelte +202 -0
  28. package/dist/svelte/components/DotGrid.svelte.d.ts +39 -0
  29. package/dist/svelte/components/FilmGrain.svelte +202 -0
  30. package/dist/svelte/components/FilmGrain.svelte.d.ts +39 -0
  31. package/dist/svelte/components/GlassTiles.svelte +2 -2
  32. package/dist/svelte/components/Grayscale.svelte +2 -2
  33. package/dist/svelte/components/HueShift.svelte +2 -2
  34. package/dist/svelte/components/Invert.svelte +2 -2
  35. package/dist/svelte/components/LinearGradient.svelte +2 -2
  36. package/dist/svelte/components/Posterize.svelte +2 -2
  37. package/dist/svelte/components/Saturation.svelte +2 -2
  38. package/dist/svelte/components/SolidColor.svelte +2 -2
  39. package/dist/svelte/components/Swirl.svelte +202 -0
  40. package/dist/svelte/components/Swirl.svelte.d.ts +39 -0
  41. package/dist/svelte/components/Twirl.svelte +2 -2
  42. package/dist/svelte/components/Vibrance.svelte +2 -2
  43. package/dist/svelte/engine/{Ombre.svelte → Shader.svelte} +2 -2
  44. package/dist/svelte/engine/{Ombre.svelte.d.ts → Shader.svelte.d.ts} +3 -3
  45. package/dist/svelte/engine/component.template.svelte +2 -2
  46. package/dist/svelte/index.d.ts +4 -1
  47. package/dist/svelte/index.js +4 -1
  48. package/dist/vue/components/FilmGrain.vue.d.ts +51 -0
  49. package/dist/vue/components/FilmGrain.vue.d.ts.map +1 -0
  50. package/dist/vue/components/Swirl.vue.d.ts +51 -0
  51. package/dist/vue/components/Swirl.vue.d.ts.map +1 -0
  52. package/dist/vue/engine/{Ombre.vue.d.ts → Shader.vue.d.ts} +1 -1
  53. package/dist/vue/engine/Shader.vue.d.ts.map +1 -0
  54. package/dist/vue/index.d.ts +3 -1
  55. package/dist/vue/index.d.ts.map +1 -1
  56. package/dist/vue/index.js +37 -37
  57. package/package.json +1 -1
  58. package/dist/react/engine/Ombre.d.ts.map +0 -1
  59. package/dist/vue/engine/Ombre.vue.d.ts.map +0 -1
@@ -0,0 +1,202 @@
1
+ <script lang="ts">
2
+ import { getContext, setContext, onMount, onDestroy } from 'svelte';
3
+ import {
4
+ createUniformsMap,
5
+ type UniformsMap,
6
+ type BlendMode,
7
+ type NodeMetadata,
8
+ type PropConfig,
9
+ type MaskConfig
10
+ } from 'shaders-core';
11
+
12
+ // @ts-ignore - this import is replaced at build time
13
+ import { componentDefinition, type ComponentProps } from 'shaders-core/swirl';
14
+
15
+ /**
16
+ * Define component props including blend mode, opacity, and masking
17
+ */
18
+ interface ExtendedComponentProps extends Partial<ComponentProps> {
19
+ blendMode?: BlendMode;
20
+ opacity?: number;
21
+ id?: string;
22
+ maskSource?: string;
23
+ maskType?: string;
24
+ }
25
+
26
+ // Define the component props and their default values from the shader definition
27
+ const componentDefaults = {
28
+ blendMode: 'normal' as BlendMode,
29
+ opacity: 1.0,
30
+ ...Object.entries(componentDefinition.props).reduce(
31
+ (acc, [key, config]) => {
32
+ acc[key] = (config as unknown as PropConfig<typeof config>).default;
33
+ return acc;
34
+ },
35
+ {} as Record<string, any>
36
+ )
37
+ };
38
+
39
+ // Declare props using Svelte 5's syntax with defaults
40
+ const props = $props<ExtendedComponentProps>();
41
+
42
+ // Apply defaults manually since Svelte 5 doesn't have withDefaults equivalent
43
+ const blendMode = props.blendMode ?? componentDefaults.blendMode;
44
+ const opacity = props.opacity ?? componentDefaults.opacity;
45
+ const id = props.id;
46
+ const maskSource = props.maskSource;
47
+ const maskType = props.maskType;
48
+
49
+ /**
50
+ * FIRST: Get the parent ID from context BEFORE setting our own context
51
+ */
52
+ const parentId = getContext<string>('ombreParentId');
53
+ if (parentId === undefined) {
54
+ throw new Error('Shader components must be used inside an <Shader> component or another shader component');
55
+ }
56
+
57
+ /**
58
+ * Use the provided ID or generate a unique identifier for this component instance
59
+ */
60
+ const instanceId = id || `${componentDefinition.name.toLowerCase()}_${Math.random().toString(36).substring(7)}`;
61
+
62
+ /**
63
+ * THEN: Provide our unique identifier to child components
64
+ */
65
+ setContext('ombreParentId', instanceId);
66
+
67
+ /**
68
+ * Creates a non-reactive object containing only props that differ from defaults
69
+ * This optimization prevents unnecessary GPU uniform updates for unchanged values
70
+ * Special props like blendMode and opacity are handled separately
71
+ */
72
+ const shaderReadyProps = $derived.by(() => {
73
+ let baseProps = { ...componentDefaults };
74
+
75
+ // Only include props that differ from defaults (excluding special props)
76
+ for (const key in props) {
77
+ if (key !== 'blendMode' && key !== 'opacity' && key !== 'id' && key !== 'maskSource' && key !== 'maskType') {
78
+ const propValue = (props as any)[key];
79
+ const defaultValue = (componentDefaults as any)[key];
80
+ if (propValue !== undefined && propValue !== defaultValue) {
81
+ (baseProps as any)[key] = propValue;
82
+ }
83
+ }
84
+ }
85
+ return baseProps;
86
+ });
87
+
88
+ /**
89
+ * Creates the GPU uniform values map using only the changed props
90
+ */
91
+ const uniforms: UniformsMap = createUniformsMap(componentDefinition, shaderReadyProps, instanceId);
92
+
93
+ /**
94
+ * Get the node registration function from parent context
95
+ */
96
+ const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('ombreNodeRegister');
97
+ if (parentRegister === undefined) {
98
+ throw new Error('Shader components must be used inside an <Shader> component or another shader component');
99
+ }
100
+
101
+ /**
102
+ * Get the uniform update function from parent context
103
+ */
104
+ const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('ombreUniformUpdate');
105
+ if (parentUniformUpdate === undefined) {
106
+ throw new Error('Shader components require ombreUniformUpdate from parent');
107
+ }
108
+
109
+ /**
110
+ * Get the metadata update function from parent context
111
+ */
112
+ const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('ombreMetadataUpdate');
113
+ if (parentMetadataUpdate === undefined) {
114
+ throw new Error('Shader components require ombreMetadataUpdate from parent');
115
+ }
116
+
117
+ // Flag to track when component is registered
118
+ let isRegistered = $state(false);
119
+
120
+ // Setup uniform watchers with registration guard
121
+ Object.entries(uniforms).forEach(([propName, { uniform, transform }]) => {
122
+ $effect(() => {
123
+ // Only run after component is registered
124
+ if (!isRegistered) return;
125
+
126
+ if (uniform && uniform.value !== undefined) {
127
+ const newValue = (props as any)[propName];
128
+ if (newValue !== undefined) {
129
+ const transformedValue = transform ? transform(newValue) : newValue;
130
+ parentUniformUpdate(instanceId, propName, transformedValue);
131
+ }
132
+ }
133
+ });
134
+ });
135
+
136
+ // Watch blend mode, opacity, and masking changes
137
+ $effect(() => {
138
+ // Only run after component is registered
139
+ if (!isRegistered) return;
140
+
141
+ const metadata: NodeMetadata = {
142
+ blendMode,
143
+ opacity,
144
+ id,
145
+ mask: maskSource ? {
146
+ source: maskSource,
147
+ type: maskType || 'alpha'
148
+ } : undefined,
149
+ renderOrder: 0
150
+ };
151
+ parentMetadataUpdate(instanceId, metadata);
152
+ });
153
+
154
+ // Register this component after mount to ensure parent is ready
155
+ onMount(() => {
156
+ // Debug and safety check before registration
157
+ console.log('componentDefinition:', componentDefinition);
158
+ console.log('fragmentNode type:', typeof componentDefinition?.fragmentNode);
159
+ console.log('fragmentNode:', componentDefinition?.fragmentNode);
160
+
161
+ // Register this component with safety check
162
+ if (componentDefinition && typeof componentDefinition.fragmentNode === 'function') {
163
+ console.log(`Registering ${componentDefinition.name} with ID: ${instanceId}, parent: ${parentId}`);
164
+
165
+ parentRegister(
166
+ instanceId,
167
+ componentDefinition.fragmentNode,
168
+ parentId,
169
+ {
170
+ blendMode,
171
+ opacity,
172
+ id,
173
+ mask: maskSource ? {
174
+ source: maskSource,
175
+ type: maskType || 'alpha'
176
+ } as MaskConfig : undefined,
177
+ renderOrder: 0
178
+ },
179
+ uniforms
180
+ );
181
+
182
+ console.log(`${componentDefinition.name} registered successfully`);
183
+
184
+ // Set flag to enable effects after successful registration
185
+ isRegistered = true;
186
+ } else {
187
+ console.error('componentDefinition.fragmentNode is not a function:', {
188
+ componentDefinition,
189
+ fragmentNode: componentDefinition?.fragmentNode,
190
+ type: typeof componentDefinition?.fragmentNode
191
+ });
192
+ }
193
+ });
194
+
195
+ // Clean up node from registry when component is unmounted
196
+ onDestroy(() => {
197
+ isRegistered = false;
198
+ parentRegister(instanceId, null, null, null, null);
199
+ });
200
+ </script>
201
+
202
+ <slot></slot>
@@ -0,0 +1,39 @@
1
+ import { type BlendMode } from 'shaders-core';
2
+ import { type ComponentProps } from 'shaders-core/swirl';
3
+ /**
4
+ * Define component props including blend mode, opacity, and masking
5
+ */
6
+ interface ExtendedComponentProps extends Partial<ComponentProps> {
7
+ blendMode?: BlendMode;
8
+ opacity?: number;
9
+ id?: string;
10
+ maskSource?: string;
11
+ maskType?: string;
12
+ }
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 Swirl: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<ExtendedComponentProps, {
32
+ default: {};
33
+ }>, {
34
+ [evt: string]: CustomEvent<any>;
35
+ }, {
36
+ default: {};
37
+ }, {}, "">;
38
+ type Swirl = InstanceType<typeof Swirl>;
39
+ export default Swirl;
@@ -51,7 +51,7 @@
51
51
  */
52
52
  const parentId = getContext<string>('ombreParentId');
53
53
  if (parentId === undefined) {
54
- throw new Error('Shader components must be used inside an <Ombre> component or another shader component');
54
+ throw new Error('Shader components must be used inside an <Shader> component or another shader component');
55
55
  }
56
56
 
57
57
  /**
@@ -95,7 +95,7 @@
95
95
  */
96
96
  const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('ombreNodeRegister');
97
97
  if (parentRegister === undefined) {
98
- throw new Error('Shader components must be used inside an <Ombre> component or another shader component');
98
+ throw new Error('Shader components must be used inside an <Shader> component or another shader component');
99
99
  }
100
100
 
101
101
  /**
@@ -51,7 +51,7 @@
51
51
  */
52
52
  const parentId = getContext<string>('ombreParentId');
53
53
  if (parentId === undefined) {
54
- throw new Error('Shader components must be used inside an <Ombre> component or another shader component');
54
+ throw new Error('Shader components must be used inside an <Shader> component or another shader component');
55
55
  }
56
56
 
57
57
  /**
@@ -95,7 +95,7 @@
95
95
  */
96
96
  const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('ombreNodeRegister');
97
97
  if (parentRegister === undefined) {
98
- throw new Error('Shader components must be used inside an <Ombre> component or another shader component');
98
+ throw new Error('Shader components must be used inside an <Shader> component or another shader component');
99
99
  }
100
100
 
101
101
  /**
@@ -40,7 +40,7 @@
40
40
 
41
41
  // Initialize renderer
42
42
  onMount(async () => {
43
- console.log('Ombre onMount - canvasRef:', canvasRef);
43
+ console.log('Shader onMount - canvasRef:', canvasRef);
44
44
  if (canvasRef) {
45
45
  console.log('Registering root node with ID:', rootId);
46
46
 
@@ -67,7 +67,7 @@
67
67
  rendererInstance.showLicenseWarning();
68
68
  }
69
69
  } else {
70
- console.error('Canvas ref is null in Ombre onMount');
70
+ console.error('Canvas ref is null in Shader onMount');
71
71
  }
72
72
  });
73
73
 
@@ -20,12 +20,12 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
20
20
  } ? Props extends Record<string, never> ? any : {
21
21
  children?: any;
22
22
  } : {});
23
- declare const Ombre: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<Props, {
23
+ declare const Shader: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<Props, {
24
24
  default: {};
25
25
  }>, {
26
26
  [evt: string]: CustomEvent<any>;
27
27
  }, {
28
28
  default: {};
29
29
  }, {}, "">;
30
- type Ombre = InstanceType<typeof Ombre>;
31
- export default Ombre;
30
+ type Shader = InstanceType<typeof Shader>;
31
+ export default Shader;
@@ -51,7 +51,7 @@
51
51
  */
52
52
  const parentId = getContext<string>('ombreParentId');
53
53
  if (parentId === undefined) {
54
- throw new Error('Shader components must be used inside an <Ombre> component or another shader component');
54
+ throw new Error('Shader components must be used inside an <Shader> component or another shader component');
55
55
  }
56
56
 
57
57
  /**
@@ -95,7 +95,7 @@
95
95
  */
96
96
  const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: UniformsMap | null) => void>('ombreNodeRegister');
97
97
  if (parentRegister === undefined) {
98
- throw new Error('Shader components must be used inside an <Ombre> component or another shader component');
98
+ throw new Error('Shader components must be used inside an <Shader> component or another shader component');
99
99
  }
100
100
 
101
101
  /**
@@ -1,4 +1,6 @@
1
1
  export { default as Circle } from './components/Circle.svelte';
2
+ export { default as DotGrid } from './components/DotGrid.svelte';
3
+ export { default as FilmGrain } from './components/FilmGrain.svelte';
2
4
  export { default as GlassTiles } from './components/GlassTiles.svelte';
3
5
  export { default as Grayscale } from './components/Grayscale.svelte';
4
6
  export { default as HueShift } from './components/HueShift.svelte';
@@ -7,6 +9,7 @@ export { default as LinearGradient } from './components/LinearGradient.svelte';
7
9
  export { default as Posterize } from './components/Posterize.svelte';
8
10
  export { default as Saturation } from './components/Saturation.svelte';
9
11
  export { default as SolidColor } from './components/SolidColor.svelte';
12
+ export { default as Swirl } from './components/Swirl.svelte';
10
13
  export { default as Twirl } from './components/Twirl.svelte';
11
14
  export { default as Vibrance } from './components/Vibrance.svelte';
12
- export { default as Ombre } from './engine/Ombre.svelte';
15
+ export { default as Shader } from './engine/Shader.svelte';
@@ -1,4 +1,6 @@
1
1
  export { default as Circle } from './components/Circle.svelte';
2
+ export { default as DotGrid } from './components/DotGrid.svelte';
3
+ export { default as FilmGrain } from './components/FilmGrain.svelte';
2
4
  export { default as GlassTiles } from './components/GlassTiles.svelte';
3
5
  export { default as Grayscale } from './components/Grayscale.svelte';
4
6
  export { default as HueShift } from './components/HueShift.svelte';
@@ -7,6 +9,7 @@ export { default as LinearGradient } from './components/LinearGradient.svelte';
7
9
  export { default as Posterize } from './components/Posterize.svelte';
8
10
  export { default as Saturation } from './components/Saturation.svelte';
9
11
  export { default as SolidColor } from './components/SolidColor.svelte';
12
+ export { default as Swirl } from './components/Swirl.svelte';
10
13
  export { default as Twirl } from './components/Twirl.svelte';
11
14
  export { default as Vibrance } from './components/Vibrance.svelte';
12
- export { default as Ombre } from './engine/Ombre.svelte';
15
+ export { default as Shader } from './engine/Shader.svelte';
@@ -0,0 +1,51 @@
1
+ import { BlendMode } from 'shaders-core';
2
+ import { ComponentProps } from 'shaders-core/filmGrain';
3
+
4
+ /**
5
+ * Define component props including blend mode, opacity, and masking
6
+ */
7
+ interface ExtendedComponentProps extends Partial<ComponentProps> {
8
+ blendMode?: BlendMode;
9
+ opacity?: number;
10
+ id?: string;
11
+ maskSource?: string;
12
+ maskType?: string;
13
+ }
14
+ declare function __VLS_template(): {
15
+ default?(_: {}): any;
16
+ };
17
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ExtendedComponentProps>, {
18
+ blendMode: string;
19
+ opacity: number;
20
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ExtendedComponentProps>, {
21
+ blendMode: string;
22
+ opacity: number;
23
+ }>>> & Readonly<{}>, {
24
+ blendMode: BlendMode;
25
+ opacity: number;
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
27
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
28
+ export default _default;
29
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
30
+ type __VLS_TypePropsToRuntimeProps<T> = {
31
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
32
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
33
+ } : {
34
+ type: import('vue').PropType<T[K]>;
35
+ required: true;
36
+ };
37
+ };
38
+ type __VLS_WithDefaults<P, D> = {
39
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
40
+ default: D[K];
41
+ }> : P[K];
42
+ };
43
+ type __VLS_Prettify<T> = {
44
+ [K in keyof T]: T[K];
45
+ } & {};
46
+ type __VLS_WithTemplateSlots<T, S> = T & {
47
+ new (): {
48
+ $slots: S;
49
+ };
50
+ };
51
+ //# sourceMappingURL=FilmGrain.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilmGrain.vue.d.ts","sourceRoot":"","sources":["../../src/components/FilmGrain.vue"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,wBAAwB,CAAA;AAI/E;;GAEG;AACH,UAAU,sBAAuB,SAAQ,OAAO,CAAC,cAAc,CAAC;IAC9D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAyKD,iBAAS,cAAc;qBA0BM,GAAG;EAG/B;AAQD,QAAA,MAAM,eAAe;;;;;;;eAnNP,SAAS;aACX,MAAM;4EAwNhB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AACxD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { BlendMode } from 'shaders-core';
2
+ import { ComponentProps } from 'shaders-core/swirl';
3
+
4
+ /**
5
+ * Define component props including blend mode, opacity, and masking
6
+ */
7
+ interface ExtendedComponentProps extends Partial<ComponentProps> {
8
+ blendMode?: BlendMode;
9
+ opacity?: number;
10
+ id?: string;
11
+ maskSource?: string;
12
+ maskType?: string;
13
+ }
14
+ declare function __VLS_template(): {
15
+ default?(_: {}): any;
16
+ };
17
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ExtendedComponentProps>, {
18
+ blendMode: string;
19
+ opacity: number;
20
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ExtendedComponentProps>, {
21
+ blendMode: string;
22
+ opacity: number;
23
+ }>>> & Readonly<{}>, {
24
+ blendMode: BlendMode;
25
+ opacity: number;
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
27
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
28
+ export default _default;
29
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
30
+ type __VLS_TypePropsToRuntimeProps<T> = {
31
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
32
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
33
+ } : {
34
+ type: import('vue').PropType<T[K]>;
35
+ required: true;
36
+ };
37
+ };
38
+ type __VLS_WithDefaults<P, D> = {
39
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
40
+ default: D[K];
41
+ }> : P[K];
42
+ };
43
+ type __VLS_Prettify<T> = {
44
+ [K in keyof T]: T[K];
45
+ } & {};
46
+ type __VLS_WithTemplateSlots<T, S> = T & {
47
+ new (): {
48
+ $slots: S;
49
+ };
50
+ };
51
+ //# sourceMappingURL=Swirl.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Swirl.vue.d.ts","sourceRoot":"","sources":["../../src/components/Swirl.vue"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,oBAAoB,CAAA;AAI3E;;GAEG;AACH,UAAU,sBAAuB,SAAQ,OAAO,CAAC,cAAc,CAAC;IAC9D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MA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C,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
@@ -35,4 +35,4 @@ type __VLS_WithTemplateSlots<T, S> = T & {
35
35
  $slots: S;
36
36
  };
37
37
  };
38
- //# sourceMappingURL=Ombre.vue.d.ts.map
38
+ //# sourceMappingURL=Shader.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shader.vue.d.ts","sourceRoot":"","sources":["../../src/engine/Shader.vue"],"names":[],"mappings":"AAQA,UAAU,KAAK;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAoED,iBAAS,cAAc;qBAsDO,GAAG;EAKhC;AASD,QAAA,MAAM,eAAe;;;;;gBAzIN,OAAO;4EA+IpB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AACxD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export { default as Circle } from './components/Circle.vue';
2
+ export { default as FilmGrain } from './components/FilmGrain.vue';
2
3
  export { default as GlassTiles } from './components/GlassTiles.vue';
3
4
  export { default as Grayscale } from './components/Grayscale.vue';
4
5
  export { default as HueShift } from './components/HueShift.vue';
@@ -7,7 +8,8 @@ export { default as LinearGradient } from './components/LinearGradient.vue';
7
8
  export { default as Posterize } from './components/Posterize.vue';
8
9
  export { default as Saturation } from './components/Saturation.vue';
9
10
  export { default as SolidColor } from './components/SolidColor.vue';
11
+ export { default as Swirl } from './components/Swirl.vue';
10
12
  export { default as Twirl } from './components/Twirl.vue';
11
13
  export { default as Vibrance } from './components/Vibrance.vue';
12
- export { default as Ombre } from './engine/Ombre.vue';
14
+ export { default as Shader } from './engine/Shader.vue';
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,2BAA2B,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