更新打包配置,完善组件入参模式,新增事件总线

This commit is contained in:
2025-05-08 11:34:35 +08:00
parent cfbfda520d
commit 4a648c2f97
14 changed files with 1091 additions and 26609 deletions

View File

@@ -0,0 +1,38 @@
import type { DeepReadonly } from "vue"
import type { MaterialRequest } from "../components/MaterialAdjuster.vue"
let _libOutputConfig = {
textureSrc: "",
submitCallback: undefined,
cancelCallback: undefined,
envTextureSrc: ['./right.webp', './left.webp', './top.webp', './bottom.webp', './front.webp', './back.webp'],
grayEnvTextureSrc: ['./right-gray.webp', './left-gray.webp', './top-gray.webp', './bottom-gray.webp', './front-gray.webp', './back-gray.webp'],
} as LibOutputConfig
export function ConfigureLibOutput(config: Partial<LibOutputConfig>) {
Object.assign(_libOutputConfig, {
...config
});
// _libOutputConfig = config;
}
export type LibOutputConfig = {
/** 材质贴图链接 */
textureSrc: string,
/** 环境贴图链接(立方体贴图,按照顺序输入[右左上下前后] */
envTextureSrc: string[],
/** 灰度环境贴图链接,输入格式与环境贴图一致 */
grayEnvTextureSrc: string[],
/** 提交材质时的回调 */
submitCallback?: (data: MaterialRequest) => void,
/**
* 取消材质编辑时的回调
* @deprecated 不需要使用
*/
cancelCallback?: () => void
}
export function GetConfig(): DeepReadonly<typeof _libOutputConfig>
{
return _libOutputConfig;
}