@m3ui-vue/m3ui-vue 0.5.8 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/MShader.vue.d.ts +54 -0
- package/dist/index.d.ts +2 -0
- package/dist/m3ui.js +1556 -1250
- package/dist/m3ui.js.map +1 -1
- package/package.json +2 -1
- package/src/__tests__/MShader.test.ts +50 -0
- package/src/components/MShader.vue +579 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type ShaderRenderer = 'auto' | 'webgpu' | 'webgl';
|
|
2
|
+
export type ShaderStatus = 'loading' | 'ready' | 'error' | 'fallback';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** GLSL fragment shader body (Shadertoy-style): must define `mainImage(out vec4 fragColor, in vec2 fragCoord)`.
|
|
5
|
+
* Runs on WebGL2. Always required as the compatible baseline. */
|
|
6
|
+
code: string;
|
|
7
|
+
/** Optional WGSL fragment shader module, e.g. `@fragment fn fs_main(@builtin(position) pos: vec4f) -> @location(0) vec4f`.
|
|
8
|
+
* Runs on WebGPU when available. Must declare its own bindings — see docs for the required uniform buffer layout. */
|
|
9
|
+
wgsl?: string;
|
|
10
|
+
/** Which backend to use. 'auto' picks WebGPU when `wgsl` is set and supported, else WebGL2. */
|
|
11
|
+
renderer?: ShaderRenderer;
|
|
12
|
+
/** Custom uniforms. Keys/shape are locked in at mount time; only values are reactive per frame. */
|
|
13
|
+
uniforms?: Record<string, number | number[]>;
|
|
14
|
+
paused?: boolean;
|
|
15
|
+
/** Device pixel ratio to render at. Defaults to devicePixelRatio, capped at 2 for performance. */
|
|
16
|
+
pixelRatio?: number;
|
|
17
|
+
};
|
|
18
|
+
declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_Slots = {} & {
|
|
22
|
+
loading?: (props: typeof __VLS_1) => any;
|
|
23
|
+
} & {
|
|
24
|
+
fallback?: (props: typeof __VLS_8) => any;
|
|
25
|
+
} & {
|
|
26
|
+
error?: (props: typeof __VLS_10) => any;
|
|
27
|
+
};
|
|
28
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
29
|
+
canvas: import("vue").Ref<HTMLCanvasElement | null, HTMLCanvasElement | null>;
|
|
30
|
+
/** 'webgpu' | 'webgl' | null — which backend is actually driving the canvas right now. */
|
|
31
|
+
renderer: import("vue").ShallowRef<"webgpu" | "webgl" | null, "webgpu" | "webgl" | null>;
|
|
32
|
+
status: import("vue").Ref<ShaderStatus, ShaderStatus>;
|
|
33
|
+
/** Raw WebGL2RenderingContext or GPUDevice, for consumers who want to go beyond the props API. */
|
|
34
|
+
context: () => WebGL2RenderingContext | GPUDevice | null;
|
|
35
|
+
pause: () => void;
|
|
36
|
+
play: () => void;
|
|
37
|
+
restart: () => Promise<void>;
|
|
38
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
ready: (renderer: "webgpu" | "webgl") => any;
|
|
40
|
+
error: (message: string) => any;
|
|
41
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
42
|
+
onReady?: ((renderer: "webgpu" | "webgl") => any) | undefined;
|
|
43
|
+
onError?: ((message: string) => any) | undefined;
|
|
44
|
+
}>, {
|
|
45
|
+
renderer: ShaderRenderer;
|
|
46
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
47
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
48
|
+
declare const _default: typeof __VLS_export;
|
|
49
|
+
export default _default;
|
|
50
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
51
|
+
new (): {
|
|
52
|
+
$slots: S;
|
|
53
|
+
};
|
|
54
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -99,6 +99,8 @@ export { default as MSection } from './components/MSection.vue';
|
|
|
99
99
|
export { default as MSegmentedButton } from './components/MSegmentedButton.vue';
|
|
100
100
|
export { default as MSelect } from './components/MSelect.vue';
|
|
101
101
|
export type { SelectOption } from './components/MSelect.vue';
|
|
102
|
+
export { default as MShader } from './components/MShader.vue';
|
|
103
|
+
export type { ShaderRenderer, ShaderStatus } from './components/MShader.vue';
|
|
102
104
|
export { default as MSideSheet } from './components/MSideSheet.vue';
|
|
103
105
|
export { default as MSkeleton } from './components/MSkeleton.vue';
|
|
104
106
|
export { default as MSlider } from './components/MSlider.vue';
|