From 70c7974f5865c7a17dca2466b7587a5b069764eb Mon Sep 17 00:00:00 2001 From: yyc-git <395976266@qq.com> Date: Thu, 16 Nov 2023 16:33:02 +0800 Subject: [PATCH] feat(platform): add Input Contribute pass run test; --- .../meta3d-input-runstopbutton/.gitignore | 19 + .../meta3d-input-runstopbutton/gulpfile.js | 25 + .../meta3d-input-runstopbutton/package.json | 33 + .../meta3d-input-runstopbutton/src/Main.ts | 23 + .../meta3d-input-runstopbutton/tsconfig.json | 24 + .../webpack.config.js | 64 + .../meta3d-input-runstopbutton2/.gitignore | 19 + .../meta3d-input-runstopbutton2/gulpfile.js | 25 + .../meta3d-input-runstopbutton2/package.json | 33 + .../meta3d-input-runstopbutton2/src/Main.ts | 15 + .../meta3d-input-runstopbutton2/tsconfig.json | 24 + .../webpack.config.js | 64 + .../meta3d-ui-control-button/package.json | 2 +- .../meta3d-ui-control-button/src/Main.ts | 6 +- .../meta3d-ui-control-game-view/package.json | 2 +- .../meta3d-ui-control-game-view/src/Main.ts | 5 +- .../package.json | 4 +- .../src/Main.ts | 39 +- .../meta3d-ui-control-scene-view/package.json | 2 +- .../meta3d-ui-control-scene-view/src/Main.ts | 5 +- .../meta3d-ui-control-window/package.json | 2 +- .../meta3d-ui-control-window/src/Main.ts | 5 +- defaults/meta3d-type/src/Index.res | 4 +- .../src/contribute/ContributeType.res | 1 + .../src/contribute/ContributeType.ts | 4 +- .../lib/es6_global/src/ExtensionManager.bs.js | 44 +- .../src/app_and_package/AppManager.bs.js | 4 +- .../src/app_and_package/ManagerUtils.bs.js | 4 +- .../meta3d/lib/js/src/ExtensionManager.bs.js | 44 +- .../js/src/app_and_package/AppManager.bs.js | 4 +- .../js/src/app_and_package/ManagerUtils.bs.js | 4 +- defaults/meta3d/src/ExtensionManager.res | 35 +- .../src/app_and_package/ManagerUtils.res | 4 +- .../meta3d/test/features/contribute.feature | 10 +- .../step-definitions/contribute.steps.res | 30 +- .../meta3d/test/tool/ExtensionManagerTool.res | 2 +- doc/0.21.0.org | 107 +- ...46\236\204\350\256\276\350\256\241.drawio" | 2 +- .../src/contribute/ActionContributeType.bs.js | 0 .../es6_global/src/service/BrowserType.bs.js | 0 .../es6_global/src/service/EventType.bs.js | 0 .../es6_global/src/service/ServiceType.bs.js | 0 .../lib/es6_global/src/state/StateType.bs.js | 0 .../src/contribute/ActionContributeType.bs.js | 0 .../lib/js/src/service/BrowserType.bs.js | 0 .../lib/js/src/service/EventType.bs.js | 0 .../lib/js/src/service/ServiceType.bs.js | 0 .../lib/js/src/state/StateType.bs.js | 0 .../src/service/BrowserType.gen.tsx | 0 .../src/service/EventType.gen.tsx | 0 .../package.json | 2 +- .../src/Main.ts | 24 +- .../lib/bs/.compiler.log | 4 +- .../lib/bs/.ninja_log | 14 +- .../ServiceType-Meta3dEditorWholeProtocol.cmi | Bin 1739 -> 1797 bytes .../ServiceType-Meta3dEditorWholeProtocol.cmt | Bin 5854 -> 5970 bytes .../meta3d-editor-whole-protocol/package.json | 2 +- .../src/service/ServiceType.ts | 6 +- .../meta3d-ui/dist/static/js/main.js | 4 +- .../meta3d-ui/lib/es6_global/src/Main.bs.js | 7 + .../lib/es6_global/src/UIManager.bs.js | 36 + .../step-definitions/begin_window.steps.bs.js | 0 .../test/step-definitions/button.steps.bs.js | 0 .../test/step-definitions/clear.steps.bs.js | 0 .../test/step-definitions/context.steps.bs.js | 0 .../custom_control.steps.bs.js | 0 .../step-definitions/fbo_texture.steps.bs.js | 0 .../step-definitions/redo_undo.steps.bs.js | 0 .../test/step-definitions/render.steps.bs.js | 0 .../test/step-definitions/skin.steps.bs.js | 0 .../update_element_state.steps.bs.js | 0 .../test/tool/ImguiRendererServiceTool.bs.js | 0 .../lib/es6_global/test/tool/MainTool.bs.js | 0 .../lib/es6_global/test/tool/SinonTool.bs.js | 0 .../step-definitions/begin_window.steps.bs.js | 0 .../test/step-definitions/button.steps.bs.js | 0 .../test/step-definitions/clear.steps.bs.js | 0 .../test/step-definitions/context.steps.bs.js | 0 .../custom_control.steps.bs.js | 0 .../step-definitions/fbo_texture.steps.bs.js | 0 .../step-definitions/redo_undo.steps.bs.js | 0 .../test/step-definitions/render.steps.bs.js | 0 .../js/test/step-definitions/skin.steps.bs.js | 0 .../update_element_state.steps.bs.js | 0 .../test/tool/ImguiRendererServiceTool.bs.js | 0 .../meta3d-ui/lib/js/test/tool/MainTool.bs.js | 0 .../lib/js/test/tool/SinonTool.bs.js | 0 .../ui/extensions/meta3d-ui/package.json | 2 +- .../ui/extensions/meta3d-ui/src/Main.res | 17 + .../ui/extensions/meta3d-ui/src/UIManager.res | 24 +- .../meta3d-ui/test/tool/MainTool.res | 3 +- .../src/contribute/InputContributeType.bs.js | 1 + .../src/contribute/InputContributeType.bs.js | 1 + .../meta3d-ui-protocol/package.json | 2 +- .../src/contribute/InputContributeType.res | 8 + .../src/contribute/InputContributeType.ts | 10 + .../contribute/UIControlContributeType.res | 20 +- .../src/contribute/UIControlContributeType.ts | 14 +- .../src/service/ServiceType.res | 33 +- .../src/service/ServiceType.ts | 21 +- .../src/state/StateType.res | 12 +- .../components/ElementVisual.res | 10 +- .../element_visual/utils/ElementMRUtils.res | 34 +- .../components/PublishElement.res | 27 +- .../store/ElementAssembleStore.res | 11 +- .../components/UIControlInspector.res | 58 +- .../utils/ContributeTypeUtils.res | 11 +- .../SelectedContributesForElementUtils.res | 2 + .../components/utils/DependencyGraphUtils.res | 3 + .../test/features/uiControlInspector.feature | 10 + .../uiControlInspector.steps.bs.js.snap | 1087 ++++++++++++++++- .../test/step-definitions/elementMR.steps.res | 15 +- .../step-definitions/publishElement.steps.res | 12 +- .../uiControlInspector.steps.res | 116 ++ .../test/tool/ImportElementTool.res | 4 +- .../test/tool/UIControlInspectorTool.res | 34 +- .../src/ContributeTypeUtils.res | 3 + .../ElementAssembleStoreType.res | 6 + .../BackendCloudbaseType.res | 41 + .../app/user_center/store/UserCenterStore.res | 16 +- .../.gitignore | 19 + .../gulpfile.js | 23 + .../icon.png | Bin 0 -> 3766 bytes .../package.json | 18 + .../src/Index.ts | 7 + .../tsconfig.json | 24 + .../package.json | 2 +- .../src/Index.ts | 4 +- .../package.json | 2 +- .../src/Index.ts | 4 +- .../package.json | 2 +- .../src/Index.ts | 6 +- .../package.json | 2 +- .../src/Index.ts | 4 +- .../package.json | 2 +- .../src/Index.ts | 4 +- .../meta3d-ui-utils/src/ElementStateUtils.ts | 2 +- 137 files changed, 2354 insertions(+), 281 deletions(-) create mode 100755 contributes/meta3d-input-runstopbutton/.gitignore create mode 100755 contributes/meta3d-input-runstopbutton/gulpfile.js create mode 100755 contributes/meta3d-input-runstopbutton/package.json create mode 100755 contributes/meta3d-input-runstopbutton/src/Main.ts create mode 100755 contributes/meta3d-input-runstopbutton/tsconfig.json create mode 100755 contributes/meta3d-input-runstopbutton/webpack.config.js create mode 100755 contributes/meta3d-input-runstopbutton2/.gitignore create mode 100755 contributes/meta3d-input-runstopbutton2/gulpfile.js create mode 100755 contributes/meta3d-input-runstopbutton2/package.json create mode 100755 contributes/meta3d-input-runstopbutton2/src/Main.ts create mode 100755 contributes/meta3d-input-runstopbutton2/tsconfig.json create mode 100755 contributes/meta3d-input-runstopbutton2/webpack.config.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/contribute/ActionContributeType.bs.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/service/BrowserType.bs.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/service/EventType.bs.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/service/ServiceType.bs.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/state/StateType.bs.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/contribute/ActionContributeType.bs.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/service/BrowserType.bs.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/service/EventType.bs.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/service/ServiceType.bs.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/state/StateType.bs.js mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/src/service/BrowserType.gen.tsx mode change 100755 => 100644 packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/src/service/EventType.gen.tsx mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/dist/static/js/main.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/src/Main.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/src/UIManager.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/begin_window.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/button.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/clear.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/context.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/custom_control.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/fbo_texture.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/redo_undo.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/render.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/skin.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/update_element_state.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/tool/ImguiRendererServiceTool.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/tool/MainTool.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/tool/SinonTool.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/begin_window.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/button.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/clear.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/context.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/custom_control.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/fbo_texture.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/redo_undo.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/render.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/skin.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/update_element_state.steps.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/tool/ImguiRendererServiceTool.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/tool/MainTool.bs.js mode change 100755 => 100644 packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/tool/SinonTool.bs.js create mode 100644 packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/lib/es6_global/src/contribute/InputContributeType.bs.js create mode 100644 packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/lib/js/src/contribute/InputContributeType.bs.js create mode 100644 packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/InputContributeType.res create mode 100755 packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/InputContributeType.ts create mode 100644 platform/frontend-utils/src/ContributeTypeUtils.res create mode 100755 protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/.gitignore create mode 100755 protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/gulpfile.js create mode 100755 protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/icon.png create mode 100755 protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/package.json create mode 100755 protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/src/Index.ts create mode 100755 protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/tsconfig.json diff --git a/contributes/meta3d-input-runstopbutton/.gitignore b/contributes/meta3d-input-runstopbutton/.gitignore new file mode 100755 index 000000000..27f6619fb --- /dev/null +++ b/contributes/meta3d-input-runstopbutton/.gitignore @@ -0,0 +1,19 @@ +.DS_Store +.merlin +.idea/ +.vscode/ +jest_0/ +reference/ +node_modules/ +mine/ + +coverage + +dist/ + +npm-debug + +.bsb.lock + +yarn.lock + diff --git a/contributes/meta3d-input-runstopbutton/gulpfile.js b/contributes/meta3d-input-runstopbutton/gulpfile.js new file mode 100755 index 000000000..a4c8812fc --- /dev/null +++ b/contributes/meta3d-input-runstopbutton/gulpfile.js @@ -0,0 +1,25 @@ +var gulp = require("gulp"); +var path = require("path"); +var publish = require("meta3d-tool-publish") + +gulp.task("publish_local_env", function (done) { + publish.publishContribute( + "local", + path.join(__dirname, "package.json"), + path.join(__dirname, "dist/static/js", "main.js") + ).then(() => { + done() + }) +}); + +gulp.task("publish_production_env", function (done) { + publish.publishContribute( + "production", + path.join(__dirname, "package.json"), + path.join(__dirname, "dist/static/js", "main.js") + ).then(() => { + done() + }) +}); + + diff --git a/contributes/meta3d-input-runstopbutton/package.json b/contributes/meta3d-input-runstopbutton/package.json new file mode 100755 index 000000000..56911e4bf --- /dev/null +++ b/contributes/meta3d-input-runstopbutton/package.json @@ -0,0 +1,33 @@ +{ + "name": "meta3d-input-runstopbutton", + "version": "0.20.0", + "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", + "description": "", + "protocol": { + "name": "meta3d-input-runstopbutton-protocol" + }, + "license": "MIT", + "scripts": { + "watch": "tsc -w -noEmit", + "webpack": "webpack --config webpack.config.js", + "meta3d:publish_dev": "cross-env NODE_ENV=development npm run webpack && gulp publish_local_env", + "meta3d:publish_pro": "cross-env NODE_ENV=production npm run webpack && gulp publish_production_env" + }, + "keywords": [], + "dependencies": { + "meta3d-type": "^0.20.0", + "meta3d-input-runstopbutton-protocol": "^0.20.0" + }, + "devDependencies": { + "clean-webpack-plugin": "^4.0.0", + "cross-env": "^7.0.3", + "cz-customizable": "^6.3.0", + "gulp": "^4.0.2", + "meta3d-tool-publish": "^0.20.0", + "source-map-loader": "^3.0.0", + "ts-loader": "^9.2.6", + "typescript": "^4.2.3", + "webpack": "^5.62.1", + "webpack-cli": "^4.9.1" + } +} diff --git a/contributes/meta3d-input-runstopbutton/src/Main.ts b/contributes/meta3d-input-runstopbutton/src/Main.ts new file mode 100755 index 000000000..1ddb61cb7 --- /dev/null +++ b/contributes/meta3d-input-runstopbutton/src/Main.ts @@ -0,0 +1,23 @@ +import { getContribute as getContributeMeta3D } from "meta3d-type" +import { data } from "meta3d-input-runstopbutton-protocol" +import { inputContribute } from "meta3d-editor-whole-protocol/src/service/ServiceType" +import { getExn, isNullable } from "meta3d-commonlib-ts/src/NullableUtils" +import { actionName as runActionName, state as runState } from "meta3d-action-run-protocol" +import { getActionStateInInput } from "meta3d-ui-utils/src/ElementStateUtils" + +export let getContribute: getContributeMeta3D> = (api) => { + return { + inputName: "RunStopButtonInput", + func: (meta3dState) => { + let runState = getActionStateInInput(meta3dState, api, runActionName) + + if (isNullable(runState)) { + return Promise.resolve(false) + } + + runState = getExn(runState) + + return Promise.resolve(runState.isRun) + } + } +} diff --git a/contributes/meta3d-input-runstopbutton/tsconfig.json b/contributes/meta3d-input-runstopbutton/tsconfig.json new file mode 100755 index 000000000..a8418c65b --- /dev/null +++ b/contributes/meta3d-input-runstopbutton/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "ES6", + "moduleResolution": "node", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "jsx": "react", + // "noEmit": true, + // "noUnusedLocals": true, + // "noUnusedParameters": true, + "noImplicitReturns": true, + "lib": [ + "DOM", + "ESNext", + ], + "types": [], + "strict": true + }, + "include": [ + "./src" + ] +} \ No newline at end of file diff --git a/contributes/meta3d-input-runstopbutton/webpack.config.js b/contributes/meta3d-input-runstopbutton/webpack.config.js new file mode 100755 index 000000000..1de4da2d5 --- /dev/null +++ b/contributes/meta3d-input-runstopbutton/webpack.config.js @@ -0,0 +1,64 @@ +const path = require('path'); +const { CleanWebpackPlugin } = require('clean-webpack-plugin'); + +module.exports = { + entry: "./src/Main.ts", + mode: process.env.NODE_ENV.trim() == 'production' ? 'production' : 'development', + output: { + path: path.resolve(__dirname, 'dist'), + filename: 'static/js/[name].js', + library: { + name: 'Contribute', + type: 'window', + }, + }, + + // Enable sourcemaps for debugging webpack's output. + // devtool: "source-map", + + resolve: { + extensions: ['.ts', '.tsx', '.js', '.jsx', '.scss'], + modules: ['node_modules'] + }, + + module: { + rules: [ + // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. + { + test: /\.tsx?$/, + exclude: /node_modules/, + use: "ts-loader" + }, + // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. + { + enforce: 'pre', + test: /\.js$/, + loader: "source-map-loader" + }, + ] + }, + plugins: [ + /** + * All files inside webpack's output.path directory will be removed once, but the + * directory itself will not be. If using webpack 4+'s default configuration, + * everything under /dist/ will be removed. + * Use cleanOnceBeforeBuildPatterns to override this behavior. + * + * During rebuilds, all webpack assets that are not used anymore + * will be removed automatically. + * + * See `Options and Defaults` for information + */ + new CleanWebpackPlugin(), + // new HtmlWebpackPlugin({ + // template: './user.html', + // filename: 'user.html', + // }), + ], + // When importing a module whose path matches one of the following, just + // assume a corresponding global variable exists and use that instead. + // This is important because it allows us to avoid bundling all of our + // dependencies, which allows browsers to cache those libraries between builds. + externals: { + } +}; \ No newline at end of file diff --git a/contributes/meta3d-input-runstopbutton2/.gitignore b/contributes/meta3d-input-runstopbutton2/.gitignore new file mode 100755 index 000000000..27f6619fb --- /dev/null +++ b/contributes/meta3d-input-runstopbutton2/.gitignore @@ -0,0 +1,19 @@ +.DS_Store +.merlin +.idea/ +.vscode/ +jest_0/ +reference/ +node_modules/ +mine/ + +coverage + +dist/ + +npm-debug + +.bsb.lock + +yarn.lock + diff --git a/contributes/meta3d-input-runstopbutton2/gulpfile.js b/contributes/meta3d-input-runstopbutton2/gulpfile.js new file mode 100755 index 000000000..a4c8812fc --- /dev/null +++ b/contributes/meta3d-input-runstopbutton2/gulpfile.js @@ -0,0 +1,25 @@ +var gulp = require("gulp"); +var path = require("path"); +var publish = require("meta3d-tool-publish") + +gulp.task("publish_local_env", function (done) { + publish.publishContribute( + "local", + path.join(__dirname, "package.json"), + path.join(__dirname, "dist/static/js", "main.js") + ).then(() => { + done() + }) +}); + +gulp.task("publish_production_env", function (done) { + publish.publishContribute( + "production", + path.join(__dirname, "package.json"), + path.join(__dirname, "dist/static/js", "main.js") + ).then(() => { + done() + }) +}); + + diff --git a/contributes/meta3d-input-runstopbutton2/package.json b/contributes/meta3d-input-runstopbutton2/package.json new file mode 100755 index 000000000..d419af6f4 --- /dev/null +++ b/contributes/meta3d-input-runstopbutton2/package.json @@ -0,0 +1,33 @@ +{ + "name": "meta3d-input-runstopbutton2", + "version": "0.20.0", + "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", + "description": "", + "protocol": { + "name": "meta3d-input-runstopbutton-protocol" + }, + "license": "MIT", + "scripts": { + "watch": "tsc -w -noEmit", + "webpack": "webpack --config webpack.config.js", + "meta3d:publish_dev": "cross-env NODE_ENV=development npm run webpack && gulp publish_local_env", + "meta3d:publish_pro": "cross-env NODE_ENV=production npm run webpack && gulp publish_production_env" + }, + "keywords": [], + "dependencies": { + "meta3d-type": "^0.20.0", + "meta3d-input-runstopbutton-protocol": "^0.20.0" + }, + "devDependencies": { + "clean-webpack-plugin": "^4.0.0", + "cross-env": "^7.0.3", + "cz-customizable": "^6.3.0", + "gulp": "^4.0.2", + "meta3d-tool-publish": "^0.20.0", + "source-map-loader": "^3.0.0", + "ts-loader": "^9.2.6", + "typescript": "^4.2.3", + "webpack": "^5.62.1", + "webpack-cli": "^4.9.1" + } +} diff --git a/contributes/meta3d-input-runstopbutton2/src/Main.ts b/contributes/meta3d-input-runstopbutton2/src/Main.ts new file mode 100755 index 000000000..1b6ca807f --- /dev/null +++ b/contributes/meta3d-input-runstopbutton2/src/Main.ts @@ -0,0 +1,15 @@ +import { getContribute as getContributeMeta3D } from "meta3d-type" +import { data } from "meta3d-input-runstopbutton-protocol" +import { inputContribute } from "meta3d-editor-whole-protocol/src/service/ServiceType" +import { getExn, isNullable } from "meta3d-commonlib-ts/src/NullableUtils" +import { actionName as runActionName, state as runState } from "meta3d-action-run-protocol" +import { getActionStateInInput } from "meta3d-ui-utils/src/ElementStateUtils" + +export let getContribute: getContributeMeta3D> = (api) => { + return { + inputName: "RunStopButtonInput2", + func: (meta3dState) => { + return Promise.resolve(false) + } + } +} diff --git a/contributes/meta3d-input-runstopbutton2/tsconfig.json b/contributes/meta3d-input-runstopbutton2/tsconfig.json new file mode 100755 index 000000000..a8418c65b --- /dev/null +++ b/contributes/meta3d-input-runstopbutton2/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "ES6", + "moduleResolution": "node", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "jsx": "react", + // "noEmit": true, + // "noUnusedLocals": true, + // "noUnusedParameters": true, + "noImplicitReturns": true, + "lib": [ + "DOM", + "ESNext", + ], + "types": [], + "strict": true + }, + "include": [ + "./src" + ] +} \ No newline at end of file diff --git a/contributes/meta3d-input-runstopbutton2/webpack.config.js b/contributes/meta3d-input-runstopbutton2/webpack.config.js new file mode 100755 index 000000000..1de4da2d5 --- /dev/null +++ b/contributes/meta3d-input-runstopbutton2/webpack.config.js @@ -0,0 +1,64 @@ +const path = require('path'); +const { CleanWebpackPlugin } = require('clean-webpack-plugin'); + +module.exports = { + entry: "./src/Main.ts", + mode: process.env.NODE_ENV.trim() == 'production' ? 'production' : 'development', + output: { + path: path.resolve(__dirname, 'dist'), + filename: 'static/js/[name].js', + library: { + name: 'Contribute', + type: 'window', + }, + }, + + // Enable sourcemaps for debugging webpack's output. + // devtool: "source-map", + + resolve: { + extensions: ['.ts', '.tsx', '.js', '.jsx', '.scss'], + modules: ['node_modules'] + }, + + module: { + rules: [ + // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. + { + test: /\.tsx?$/, + exclude: /node_modules/, + use: "ts-loader" + }, + // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. + { + enforce: 'pre', + test: /\.js$/, + loader: "source-map-loader" + }, + ] + }, + plugins: [ + /** + * All files inside webpack's output.path directory will be removed once, but the + * directory itself will not be. If using webpack 4+'s default configuration, + * everything under /dist/ will be removed. + * Use cleanOnceBeforeBuildPatterns to override this behavior. + * + * During rebuilds, all webpack assets that are not used anymore + * will be removed automatically. + * + * See `Options and Defaults` for information + */ + new CleanWebpackPlugin(), + // new HtmlWebpackPlugin({ + // template: './user.html', + // filename: 'user.html', + // }), + ], + // When importing a module whose path matches one of the following, just + // assume a corresponding global variable exists and use that instead. + // This is important because it allows us to avoid bundling all of our + // dependencies, which allows browsers to cache those libraries between builds. + externals: { + } +}; \ No newline at end of file diff --git a/contributes/meta3d-ui-control-button/package.json b/contributes/meta3d-ui-control-button/package.json index 21ff3331c..463f217a5 100755 --- a/contributes/meta3d-ui-control-button/package.json +++ b/contributes/meta3d-ui-control-button/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-control-button", - "version": "0.20.0", + "version": "0.20.1", "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", "displayName": "button", "repoLink": "https://github.com/Meta3D-Technology/Meta3D/tree/master/contributes/meta3d-ui-control-button", diff --git a/contributes/meta3d-ui-control-button/src/Main.ts b/contributes/meta3d-ui-control-button/src/Main.ts index 14e27fc86..e64c1d810 100755 --- a/contributes/meta3d-ui-control-button/src/Main.ts +++ b/contributes/meta3d-ui-control-button/src/Main.ts @@ -1,12 +1,14 @@ import { getContribute as getContributeMeta3D } from "meta3d-type" -import { inputData, outputData, uiControlName } from "meta3d-ui-control-button-protocol" +import { inputFunc, specificData, outputData, uiControlName } from "meta3d-ui-control-button-protocol" import { service as editorWholeService, uiControlContribute } from "meta3d-editor-whole-protocol/src/service/ServiceType" import { getExn } from "meta3d-commonlib-ts/src/NullableUtils" +import { initFunc } from "meta3d-editor-whole-protocol/src/state/StateType" -export let getContribute: getContributeMeta3D> = (api) => { +export let getContribute: getContributeMeta3D> = (api) => { return { uiControlName: uiControlName, func: (meta3dState, + _, { rect, label diff --git a/contributes/meta3d-ui-control-game-view/package.json b/contributes/meta3d-ui-control-game-view/package.json index 3881fc4af..255a3fae6 100755 --- a/contributes/meta3d-ui-control-game-view/package.json +++ b/contributes/meta3d-ui-control-game-view/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-control-game-view", - "version": "0.20.0", + "version": "0.20.1", "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", "displayName": "game view", "repoLink": "https://github.com/Meta3D-Technology/Meta3D/tree/master/contributes/meta3d-ui-control-game-view", diff --git a/contributes/meta3d-ui-control-game-view/src/Main.ts b/contributes/meta3d-ui-control-game-view/src/Main.ts index 644ae1721..21776a0c7 100755 --- a/contributes/meta3d-ui-control-game-view/src/Main.ts +++ b/contributes/meta3d-ui-control-game-view/src/Main.ts @@ -1,14 +1,15 @@ import { getContribute as getContributeMeta3D } from "meta3d-type" -import { uiControlName, textureID, state as uiControlState, inputData, outputData } from "meta3d-ui-control-game-view-protocol" +import { uiControlName, textureID, state as uiControlState, inputFunc, specificData, outputData } from "meta3d-ui-control-game-view-protocol" import { changeToStrictlyNull, getFBORect } from "meta3d-ui-control-view-utils/src/Main" import { uiControlContribute, service as editorWholeService } from "meta3d-editor-whole-protocol/src/service/ServiceType" import { service as renderService } from "meta3d-editor-gameview-render-protocol/src/service/ServiceType" import { getExn, getWithDefault, isNullable, map } from "meta3d-commonlib-ts/src/NullableUtils" -export let getContribute: getContributeMeta3D> = (api) => { +export let getContribute: getContributeMeta3D> = (api) => { return { uiControlName: uiControlName, func: (meta3dState, + _, { rect, label, diff --git a/contributes/meta3d-ui-control-runstopbutton/package.json b/contributes/meta3d-ui-control-runstopbutton/package.json index 4b4d324ed..7677c83a0 100755 --- a/contributes/meta3d-ui-control-runstopbutton/package.json +++ b/contributes/meta3d-ui-control-runstopbutton/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-control-runstopbutton", - "version": "0.20.0", + "version": "0.20.3", "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", "description": "", "protocol": { @@ -15,8 +15,6 @@ }, "keywords": [], "dependencies": { - "meta3d-action-run-protocol": "^0.20.0", - "meta3d-action-stop-protocol": "^0.20.0", "meta3d-editor-whole-protocol": "^0.20.0", "meta3d-type": "^0.20.0", "meta3d-ui-control-runstopbutton-protocol": "^0.20.0", diff --git a/contributes/meta3d-ui-control-runstopbutton/src/Main.ts b/contributes/meta3d-ui-control-runstopbutton/src/Main.ts index 69fb6afab..88a7f017c 100755 --- a/contributes/meta3d-ui-control-runstopbutton/src/Main.ts +++ b/contributes/meta3d-ui-control-runstopbutton/src/Main.ts @@ -1,43 +1,42 @@ import { getContribute as getContributeMeta3D } from "meta3d-type" -import { inputData, outputData, uiControlName, state } from "meta3d-ui-control-runstopbutton-protocol" +import { inputFunc, specificData, outputData, uiControlName, state } from "meta3d-ui-control-runstopbutton-protocol" import { service, uiControlContribute } from "meta3d-editor-whole-protocol/src/service/ServiceType" import runImageSrc from "url-loader!./image/run.png" import stopImageSrc from "url-loader!./image/stop.png" import { getExn, isNullable } from "meta3d-commonlib-ts/src/NullableUtils" -import { actionName as runActionName, state as runState } from "meta3d-action-run-protocol" -import { getActionStateInUIControl } from "meta3d-ui-utils/src/ElementStateUtils" +// import { actionName as runActionName, state as runState } from "meta3d-action-run-protocol" +// import { getActionStateInInput } from "meta3d-ui-utils/src/ElementStateUtils" -export let getContribute: getContributeMeta3D> = (api) => { +export let getContribute: getContributeMeta3D> = (api) => { return { uiControlName: uiControlName, func: (meta3dState, + getInputFunc, { rect, label } ) => { - let runState = getActionStateInUIControl(meta3dState, api, runActionName) - - if (isNullable(runState)) { + if (isNullable(getInputFunc)) { return Promise.resolve([meta3dState, [false, false]]) } - runState = getExn(runState) - - let { runStopButton, getUIControlState, setCursorPos } = getExn(api.getPackageService(meta3dState, "meta3d-editor-whole-protocol")).ui(meta3dState) + return getExn(getInputFunc)(meta3dState).then(isRun => { + let { runStopButton, getUIControlState, setCursorPos } = getExn(api.getPackageService(meta3dState, "meta3d-editor-whole-protocol")).ui(meta3dState) - meta3dState = setCursorPos(meta3dState, [rect.x, rect.y]) + meta3dState = setCursorPos(meta3dState, [rect.x, rect.y]) - let { runTexture, - stopTexture, - } = getExn(getUIControlState(meta3dState, uiControlName)) - - return Promise.resolve(runStopButton(meta3dState, - runState.isRun, - { - runTexture, + let { runTexture, stopTexture, - }, [rect.width, rect.height])) + } = getExn(getUIControlState(meta3dState, uiControlName)) + + return runStopButton(meta3dState, + isRun, + { + runTexture, + stopTexture, + }, [rect.width, rect.height]) + }) }, init: (meta3dState) => { let { setUIControlState, loadImage } = getExn(api.getPackageService(meta3dState, "meta3d-editor-whole-protocol")).ui(meta3dState) diff --git a/contributes/meta3d-ui-control-scene-view/package.json b/contributes/meta3d-ui-control-scene-view/package.json index eec5798c2..d1045e6b1 100755 --- a/contributes/meta3d-ui-control-scene-view/package.json +++ b/contributes/meta3d-ui-control-scene-view/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-control-scene-view", - "version": "0.20.0", + "version": "0.20.1", "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", "displayName": "scene view", "description": "", diff --git a/contributes/meta3d-ui-control-scene-view/src/Main.ts b/contributes/meta3d-ui-control-scene-view/src/Main.ts index e62642ad6..11e8544f5 100755 --- a/contributes/meta3d-ui-control-scene-view/src/Main.ts +++ b/contributes/meta3d-ui-control-scene-view/src/Main.ts @@ -1,5 +1,5 @@ import { getContribute as getContributeMeta3D } from "meta3d-type" -import { uiControlName, textureID, state as uiControlState, inputData, outputData, dragDropType, dragDropData } from "meta3d-ui-control-scene-view-protocol" +import { uiControlName, textureID, state as uiControlState, inputFunc, specificData, outputData, dragDropType, dragDropData } from "meta3d-ui-control-scene-view-protocol" import { changeToStrictlyNull, getFBORect } from "meta3d-ui-control-view-utils/src/Main" import { uiControlContribute, service as editorWholeService } from "meta3d-editor-whole-protocol/src/service/ServiceType" import { service as renderService } from "meta3d-editor-sceneview-render-protocol/src/service/ServiceType" @@ -7,10 +7,11 @@ import { service as renderService } from "meta3d-editor-sceneview-render-protoco import { getExn, getWithDefault, isNullable, map } from "meta3d-commonlib-ts/src/NullableUtils" // import { service as eventService } from "meta3d-event-protocol/src/service/ServiceType" -export let getContribute: getContributeMeta3D> = (api) => { +export let getContribute: getContributeMeta3D> = (api) => { return { uiControlName: uiControlName, func: (meta3dState, + _, { rect, label, diff --git a/contributes/meta3d-ui-control-window/package.json b/contributes/meta3d-ui-control-window/package.json index 632fb0f37..a3ca30e00 100755 --- a/contributes/meta3d-ui-control-window/package.json +++ b/contributes/meta3d-ui-control-window/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-control-window", - "version": "0.20.0", + "version": "0.20.1", "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", "displayName": "window", "repoLink": "https://github.com/Meta3D-Technology/Meta3D/tree/master/contributes/meta3d-ui-control-window", diff --git a/contributes/meta3d-ui-control-window/src/Main.ts b/contributes/meta3d-ui-control-window/src/Main.ts index b5b46a5dc..a261cbb8b 100755 --- a/contributes/meta3d-ui-control-window/src/Main.ts +++ b/contributes/meta3d-ui-control-window/src/Main.ts @@ -1,12 +1,13 @@ import { getContribute as getContributeMeta3D } from "meta3d-type" -import { inputData, outputData, uiControlName } from "meta3d-ui-control-window-protocol" +import { uiControlName, state as uiControlState, inputFunc, specificData, outputData } from "meta3d-ui-control-window-protocol" import { service, uiControlContribute } from "meta3d-editor-whole-protocol/src/service/ServiceType" import { getExn } from "meta3d-commonlib-ts/src/NullableUtils" -export let getContribute: getContributeMeta3D> = (api) => { +export let getContribute: getContributeMeta3D> = (api) => { return { uiControlName: uiControlName, func: (meta3dState, + _, { rect, label, diff --git a/defaults/meta3d-type/src/Index.res b/defaults/meta3d-type/src/Index.res index ca8c328a8..7bc7f2d51 100755 --- a/defaults/meta3d-type/src/Index.res +++ b/defaults/meta3d-type/src/Index.res @@ -58,11 +58,11 @@ and state = { extensionProtocolName, extensionLife, >, - contributeExceptActionMap: Meta3dCommonlibType.ImmutableHashMapType.t< + contributeExceptInputMap: Meta3dCommonlibType.ImmutableHashMapType.t< contributeProtocolName, (ContributeType.contributeType, contribute), >, - actionMap: Meta3dCommonlibType.ImmutableHashMapType.t>, + inputMap: Meta3dCommonlibType.ImmutableHashMapType.t>, packageStoreInAppMap: Meta3dCommonlibType.ImmutableHashMapType.t< packageProtocolName, Js.Typed_array.ArrayBuffer.t, diff --git a/defaults/meta3d-type/src/contribute/ContributeType.res b/defaults/meta3d-type/src/contribute/ContributeType.res index 1df594c6d..8b07ed40f 100755 --- a/defaults/meta3d-type/src/contribute/ContributeType.res +++ b/defaults/meta3d-type/src/contribute/ContributeType.res @@ -6,4 +6,5 @@ type contributeType = | Component | GameObject | Pipeline + | Input | Unknown diff --git a/defaults/meta3d-type/src/contribute/ContributeType.ts b/defaults/meta3d-type/src/contribute/ContributeType.ts index 880f197f5..589ecf9ef 100755 --- a/defaults/meta3d-type/src/contribute/ContributeType.ts +++ b/defaults/meta3d-type/src/contribute/ContributeType.ts @@ -5,5 +5,7 @@ export enum contributeType { Action, Component, GameObject, - Pipeline + Pipeline, + Input, + Unknown } diff --git a/defaults/meta3d/lib/es6_global/src/ExtensionManager.bs.js b/defaults/meta3d/lib/es6_global/src/ExtensionManager.bs.js index 13a3d21da..febe0cd7a 100644 --- a/defaults/meta3d/lib/es6_global/src/ExtensionManager.bs.js +++ b/defaults/meta3d/lib/es6_global/src/ExtensionManager.bs.js @@ -20,8 +20,8 @@ function setExtensionState(state, protocolName, extensionState) { extensionServiceMap: state.extensionServiceMap, extensionStateMap: ImmutableHashMap$Meta3dCommonlib.set(state.extensionStateMap, protocolName, extensionState), extensionLifeMap: state.extensionLifeMap, - contributeExceptActionMap: state.contributeExceptActionMap, - actionMap: state.actionMap, + contributeExceptInputMap: state.contributeExceptInputMap, + inputMap: state.inputMap, packageStoreInAppMap: state.packageStoreInAppMap }; } @@ -30,8 +30,8 @@ function getExtensionStateExn(state, protocolName) { return ImmutableHashMap$Meta3dCommonlib.getExn(state.extensionStateMap, protocolName); } -function _isAction(protocolName) { - if (Js_string.includes("-action-", protocolName)) { +function _isInput(protocolName) { + if (Js_string.includes("-input-", protocolName)) { return true; } else { return false; @@ -39,20 +39,20 @@ function _isAction(protocolName) { } function getContributeExn(state, protocolName) { - if (_isAction(protocolName)) { - return Exception$Meta3dCommonlib.throwErr(Exception$Meta3dCommonlib.buildErr(Log$Meta3dCommonlib.buildErrorMessage("shouldn't get action whose protocol is: " + protocolName + "!", "", "", "", ""))); + if (_isInput(protocolName)) { + return Exception$Meta3dCommonlib.throwErr(Exception$Meta3dCommonlib.buildErr(Log$Meta3dCommonlib.buildErrorMessage("shouldn't get input whose protocol is: " + protocolName + "!", "", "", "", ""))); } else { - return Tuple2$Meta3dCommonlib.getLast(ImmutableHashMap$Meta3dCommonlib.getExn(state.contributeExceptActionMap, protocolName)); + return Tuple2$Meta3dCommonlib.getLast(ImmutableHashMap$Meta3dCommonlib.getExn(state.contributeExceptInputMap, protocolName)); } } function getAllContributesByType(state, contributeType) { - if (contributeType !== 3) { - return ArraySt$Meta3dCommonlib.map(ArraySt$Meta3dCommonlib.filter(ImmutableHashMap$Meta3dCommonlib.getValidValues(state.contributeExceptActionMap), (function (param) { + if (contributeType !== 7) { + return ArraySt$Meta3dCommonlib.map(ArraySt$Meta3dCommonlib.filter(ImmutableHashMap$Meta3dCommonlib.getValidValues(state.contributeExceptInputMap), (function (param) { return param[0] === contributeType; })), Tuple2$Meta3dCommonlib.getLast); } else { - return ArraySt$Meta3dCommonlib.reduceOneParam(ImmutableHashMap$Meta3dCommonlib.getValidValues(state.actionMap), (function (result, arr) { + return ArraySt$Meta3dCommonlib.reduceOneParam(ImmutableHashMap$Meta3dCommonlib.getValidValues(state.inputMap), (function (result, arr) { return Js_array.concat(arr, result); }), []); } @@ -108,12 +108,14 @@ function _decideContributeType(contribute) { return /* GameObject */5; } else if (!(contribute.uiControlName == null) && !(contribute.func == null)) { return /* UIControl */0; + } else if (!(contribute.inputName == null) && !(contribute.func == null)) { + return /* Input */7; } else if (!(contribute.skinName == null) && !(contribute.skin == null)) { return /* Skin */1; } else if (!(contribute.pipelineName == null) && !(contribute.allPipelineData == null)) { return /* Pipeline */6; } else { - return /* Unknown */7; + return /* Unknown */8; } } @@ -146,8 +148,8 @@ function registerExtension(state, protocolName, getServiceFunc, getLifeFunc, ext extensionServiceMap: ImmutableHashMap$Meta3dCommonlib.set(state.extensionServiceMap, protocolName, Curry._1(getServiceFunc, buildAPI(undefined))), extensionStateMap: state.extensionStateMap, extensionLifeMap: ImmutableHashMap$Meta3dCommonlib.set(state.extensionLifeMap, protocolName, Curry._2(getLifeFunc, buildAPI(undefined), protocolName)), - contributeExceptActionMap: state.contributeExceptActionMap, - actionMap: state.actionMap, + contributeExceptInputMap: state.contributeExceptInputMap, + inputMap: state.inputMap, packageStoreInAppMap: state.packageStoreInAppMap }, protocolName, extensionState); return _invokeSyncLifeOtherHander(state$1, protocolName, ImmutableHashMap$Meta3dCommonlib.getExn(state$1.extensionLifeMap, protocolName).onRegister); @@ -156,27 +158,27 @@ function registerExtension(state, protocolName, getServiceFunc, getLifeFunc, ext function registerContribute(state, protocolName, getContributeFunc) { var contribute = Curry._1(getContributeFunc, buildAPI(undefined)); var contributeType = _decideContributeType(contribute); - if (contributeType !== 3) { - _checkIsRegister(protocolName, ImmutableHashMap$Meta3dCommonlib.has(state.contributeExceptActionMap, protocolName)); + if (contributeType !== 7) { + _checkIsRegister(protocolName, ImmutableHashMap$Meta3dCommonlib.has(state.contributeExceptInputMap, protocolName)); return { extensionServiceMap: state.extensionServiceMap, extensionStateMap: state.extensionStateMap, extensionLifeMap: state.extensionLifeMap, - contributeExceptActionMap: ImmutableHashMap$Meta3dCommonlib.set(state.contributeExceptActionMap, protocolName, [ + contributeExceptInputMap: ImmutableHashMap$Meta3dCommonlib.set(state.contributeExceptInputMap, protocolName, [ contributeType, contribute ]), - actionMap: state.actionMap, + inputMap: state.inputMap, packageStoreInAppMap: state.packageStoreInAppMap }; } - var actions = ImmutableHashMap$Meta3dCommonlib.get(state.actionMap, protocolName); + var inputs = ImmutableHashMap$Meta3dCommonlib.get(state.inputMap, protocolName); return { extensionServiceMap: state.extensionServiceMap, extensionStateMap: state.extensionStateMap, extensionLifeMap: state.extensionLifeMap, - contributeExceptActionMap: state.contributeExceptActionMap, - actionMap: actions !== undefined ? ImmutableHashMap$Meta3dCommonlib.set(state.actionMap, protocolName, ArraySt$Meta3dCommonlib.push(actions, contribute)) : ImmutableHashMap$Meta3dCommonlib.set(state.actionMap, protocolName, [contribute]), + contributeExceptInputMap: state.contributeExceptInputMap, + inputMap: inputs !== undefined ? ImmutableHashMap$Meta3dCommonlib.set(state.inputMap, protocolName, ArraySt$Meta3dCommonlib.push(inputs, contribute)) : ImmutableHashMap$Meta3dCommonlib.set(state.inputMap, protocolName, [contribute]), packageStoreInAppMap: state.packageStoreInAppMap }; } @@ -207,7 +209,7 @@ export { getExtensionServiceExn , setExtensionState , getExtensionStateExn , - _isAction , + _isInput , getContributeExn , getAllContributesByType , _getExtensionLifeExn , diff --git a/defaults/meta3d/lib/es6_global/src/app_and_package/AppManager.bs.js b/defaults/meta3d/lib/es6_global/src/app_and_package/AppManager.bs.js index 6a28ab7d6..c71f96fd0 100644 --- a/defaults/meta3d/lib/es6_global/src/app_and_package/AppManager.bs.js +++ b/defaults/meta3d/lib/es6_global/src/app_and_package/AppManager.bs.js @@ -99,8 +99,8 @@ function _loadAllPackageUint8StoredInApp(state, allPackageUint8StoredInApp) { extensionServiceMap: state.extensionServiceMap, extensionStateMap: state.extensionStateMap, extensionLifeMap: state.extensionLifeMap, - contributeExceptActionMap: state.contributeExceptActionMap, - actionMap: state.actionMap, + contributeExceptInputMap: state.contributeExceptInputMap, + inputMap: state.inputMap, packageStoreInAppMap: ImmutableHashMap$Meta3dCommonlib.set(state.packageStoreInAppMap, param[0][0].name, param[1]) }; }), state); diff --git a/defaults/meta3d/lib/es6_global/src/app_and_package/ManagerUtils.bs.js b/defaults/meta3d/lib/es6_global/src/app_and_package/ManagerUtils.bs.js index 23dd4336b..1411b36d9 100644 --- a/defaults/meta3d/lib/es6_global/src/app_and_package/ManagerUtils.bs.js +++ b/defaults/meta3d/lib/es6_global/src/app_and_package/ManagerUtils.bs.js @@ -310,8 +310,8 @@ function _prepare(param) { extensionServiceMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), extensionStateMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), extensionLifeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), - contributeExceptActionMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), - actionMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), + contributeExceptInputMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), + inputMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), packageStoreInAppMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined) }; } diff --git a/defaults/meta3d/lib/js/src/ExtensionManager.bs.js b/defaults/meta3d/lib/js/src/ExtensionManager.bs.js index f2cf67bfa..2bad18476 100644 --- a/defaults/meta3d/lib/js/src/ExtensionManager.bs.js +++ b/defaults/meta3d/lib/js/src/ExtensionManager.bs.js @@ -20,8 +20,8 @@ function setExtensionState(state, protocolName, extensionState) { extensionServiceMap: state.extensionServiceMap, extensionStateMap: ImmutableHashMap$Meta3dCommonlib.set(state.extensionStateMap, protocolName, extensionState), extensionLifeMap: state.extensionLifeMap, - contributeExceptActionMap: state.contributeExceptActionMap, - actionMap: state.actionMap, + contributeExceptInputMap: state.contributeExceptInputMap, + inputMap: state.inputMap, packageStoreInAppMap: state.packageStoreInAppMap }; } @@ -30,8 +30,8 @@ function getExtensionStateExn(state, protocolName) { return ImmutableHashMap$Meta3dCommonlib.getExn(state.extensionStateMap, protocolName); } -function _isAction(protocolName) { - if (Js_string.includes("-action-", protocolName)) { +function _isInput(protocolName) { + if (Js_string.includes("-input-", protocolName)) { return true; } else { return false; @@ -39,20 +39,20 @@ function _isAction(protocolName) { } function getContributeExn(state, protocolName) { - if (_isAction(protocolName)) { - return Exception$Meta3dCommonlib.throwErr(Exception$Meta3dCommonlib.buildErr(Log$Meta3dCommonlib.buildErrorMessage("shouldn't get action whose protocol is: " + protocolName + "!", "", "", "", ""))); + if (_isInput(protocolName)) { + return Exception$Meta3dCommonlib.throwErr(Exception$Meta3dCommonlib.buildErr(Log$Meta3dCommonlib.buildErrorMessage("shouldn't get input whose protocol is: " + protocolName + "!", "", "", "", ""))); } else { - return Tuple2$Meta3dCommonlib.getLast(ImmutableHashMap$Meta3dCommonlib.getExn(state.contributeExceptActionMap, protocolName)); + return Tuple2$Meta3dCommonlib.getLast(ImmutableHashMap$Meta3dCommonlib.getExn(state.contributeExceptInputMap, protocolName)); } } function getAllContributesByType(state, contributeType) { - if (contributeType !== 3) { - return ArraySt$Meta3dCommonlib.map(ArraySt$Meta3dCommonlib.filter(ImmutableHashMap$Meta3dCommonlib.getValidValues(state.contributeExceptActionMap), (function (param) { + if (contributeType !== 7) { + return ArraySt$Meta3dCommonlib.map(ArraySt$Meta3dCommonlib.filter(ImmutableHashMap$Meta3dCommonlib.getValidValues(state.contributeExceptInputMap), (function (param) { return param[0] === contributeType; })), Tuple2$Meta3dCommonlib.getLast); } else { - return ArraySt$Meta3dCommonlib.reduceOneParam(ImmutableHashMap$Meta3dCommonlib.getValidValues(state.actionMap), (function (result, arr) { + return ArraySt$Meta3dCommonlib.reduceOneParam(ImmutableHashMap$Meta3dCommonlib.getValidValues(state.inputMap), (function (result, arr) { return Js_array.concat(arr, result); }), []); } @@ -108,12 +108,14 @@ function _decideContributeType(contribute) { return /* GameObject */5; } else if (!(contribute.uiControlName == null) && !(contribute.func == null)) { return /* UIControl */0; + } else if (!(contribute.inputName == null) && !(contribute.func == null)) { + return /* Input */7; } else if (!(contribute.skinName == null) && !(contribute.skin == null)) { return /* Skin */1; } else if (!(contribute.pipelineName == null) && !(contribute.allPipelineData == null)) { return /* Pipeline */6; } else { - return /* Unknown */7; + return /* Unknown */8; } } @@ -146,8 +148,8 @@ function registerExtension(state, protocolName, getServiceFunc, getLifeFunc, ext extensionServiceMap: ImmutableHashMap$Meta3dCommonlib.set(state.extensionServiceMap, protocolName, Curry._1(getServiceFunc, buildAPI(undefined))), extensionStateMap: state.extensionStateMap, extensionLifeMap: ImmutableHashMap$Meta3dCommonlib.set(state.extensionLifeMap, protocolName, Curry._2(getLifeFunc, buildAPI(undefined), protocolName)), - contributeExceptActionMap: state.contributeExceptActionMap, - actionMap: state.actionMap, + contributeExceptInputMap: state.contributeExceptInputMap, + inputMap: state.inputMap, packageStoreInAppMap: state.packageStoreInAppMap }, protocolName, extensionState); return _invokeSyncLifeOtherHander(state$1, protocolName, ImmutableHashMap$Meta3dCommonlib.getExn(state$1.extensionLifeMap, protocolName).onRegister); @@ -156,27 +158,27 @@ function registerExtension(state, protocolName, getServiceFunc, getLifeFunc, ext function registerContribute(state, protocolName, getContributeFunc) { var contribute = Curry._1(getContributeFunc, buildAPI(undefined)); var contributeType = _decideContributeType(contribute); - if (contributeType !== 3) { - _checkIsRegister(protocolName, ImmutableHashMap$Meta3dCommonlib.has(state.contributeExceptActionMap, protocolName)); + if (contributeType !== 7) { + _checkIsRegister(protocolName, ImmutableHashMap$Meta3dCommonlib.has(state.contributeExceptInputMap, protocolName)); return { extensionServiceMap: state.extensionServiceMap, extensionStateMap: state.extensionStateMap, extensionLifeMap: state.extensionLifeMap, - contributeExceptActionMap: ImmutableHashMap$Meta3dCommonlib.set(state.contributeExceptActionMap, protocolName, [ + contributeExceptInputMap: ImmutableHashMap$Meta3dCommonlib.set(state.contributeExceptInputMap, protocolName, [ contributeType, contribute ]), - actionMap: state.actionMap, + inputMap: state.inputMap, packageStoreInAppMap: state.packageStoreInAppMap }; } - var actions = ImmutableHashMap$Meta3dCommonlib.get(state.actionMap, protocolName); + var inputs = ImmutableHashMap$Meta3dCommonlib.get(state.inputMap, protocolName); return { extensionServiceMap: state.extensionServiceMap, extensionStateMap: state.extensionStateMap, extensionLifeMap: state.extensionLifeMap, - contributeExceptActionMap: state.contributeExceptActionMap, - actionMap: actions !== undefined ? ImmutableHashMap$Meta3dCommonlib.set(state.actionMap, protocolName, ArraySt$Meta3dCommonlib.push(actions, contribute)) : ImmutableHashMap$Meta3dCommonlib.set(state.actionMap, protocolName, [contribute]), + contributeExceptInputMap: state.contributeExceptInputMap, + inputMap: inputs !== undefined ? ImmutableHashMap$Meta3dCommonlib.set(state.inputMap, protocolName, ArraySt$Meta3dCommonlib.push(inputs, contribute)) : ImmutableHashMap$Meta3dCommonlib.set(state.inputMap, protocolName, [contribute]), packageStoreInAppMap: state.packageStoreInAppMap }; } @@ -206,7 +208,7 @@ function buildAPI(param) { exports.getExtensionServiceExn = getExtensionServiceExn; exports.setExtensionState = setExtensionState; exports.getExtensionStateExn = getExtensionStateExn; -exports._isAction = _isAction; +exports._isInput = _isInput; exports.getContributeExn = getContributeExn; exports.getAllContributesByType = getAllContributesByType; exports._getExtensionLifeExn = _getExtensionLifeExn; diff --git a/defaults/meta3d/lib/js/src/app_and_package/AppManager.bs.js b/defaults/meta3d/lib/js/src/app_and_package/AppManager.bs.js index 910f3d970..b80fe2f6f 100644 --- a/defaults/meta3d/lib/js/src/app_and_package/AppManager.bs.js +++ b/defaults/meta3d/lib/js/src/app_and_package/AppManager.bs.js @@ -99,8 +99,8 @@ function _loadAllPackageUint8StoredInApp(state, allPackageUint8StoredInApp) { extensionServiceMap: state.extensionServiceMap, extensionStateMap: state.extensionStateMap, extensionLifeMap: state.extensionLifeMap, - contributeExceptActionMap: state.contributeExceptActionMap, - actionMap: state.actionMap, + contributeExceptInputMap: state.contributeExceptInputMap, + inputMap: state.inputMap, packageStoreInAppMap: ImmutableHashMap$Meta3dCommonlib.set(state.packageStoreInAppMap, param[0][0].name, param[1]) }; }), state); diff --git a/defaults/meta3d/lib/js/src/app_and_package/ManagerUtils.bs.js b/defaults/meta3d/lib/js/src/app_and_package/ManagerUtils.bs.js index 8fe8a9ca1..abea6f36e 100644 --- a/defaults/meta3d/lib/js/src/app_and_package/ManagerUtils.bs.js +++ b/defaults/meta3d/lib/js/src/app_and_package/ManagerUtils.bs.js @@ -310,8 +310,8 @@ function _prepare(param) { extensionServiceMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), extensionStateMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), extensionLifeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), - contributeExceptActionMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), - actionMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), + contributeExceptInputMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), + inputMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), packageStoreInAppMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined) }; } diff --git a/defaults/meta3d/src/ExtensionManager.res b/defaults/meta3d/src/ExtensionManager.res index 3f4c27416..5458c2ef1 100755 --- a/defaults/meta3d/src/ExtensionManager.res +++ b/defaults/meta3d/src/ExtensionManager.res @@ -22,19 +22,19 @@ let getExtensionStateExn = (state, protocolName: extensionProtocolName) => { state.extensionStateMap->Meta3dCommonlib.ImmutableHashMap.getExn(protocolName) } -let _isAction = (protocolName: string) => { +let _isInput = (protocolName: string) => { switch protocolName { - | name if name->Js.String.includes("-action-", _) => true + | name if name->Js.String.includes("-input-", _) => true | _ => false } } let getContributeExn = (state, protocolName: contributeProtocolName) => { - _isAction(protocolName) + _isInput(protocolName) ? Meta3dCommonlib.Exception.throwErr( Meta3dCommonlib.Exception.buildErr( Meta3dCommonlib.Log.buildErrorMessage( - ~title={j`shouldn't get action whose protocol is: ${protocolName}!`}, + ~title={j`shouldn't get input whose protocol is: ${protocolName}!`}, ~description={ j`` }, @@ -44,7 +44,7 @@ let getContributeExn = (state, protocolName: contributeProtocolName) => { ), ), ) - : state.contributeExceptActionMap + : state.contributeExceptInputMap ->Meta3dCommonlib.ImmutableHashMap.getExn(protocolName) ->Meta3dCommonlib.Tuple2.getLast } @@ -53,14 +53,14 @@ let getAllContributesByType = (state, contributeType) => { open Meta3dType.ContributeType switch contributeType { - | Action => - state.actionMap + | Input => + state.inputMap ->Meta3dCommonlib.ImmutableHashMap.getValidValues ->Meta3dCommonlib.ArraySt.reduceOneParam((. result, arr) => { Js.Array.concat(arr, result) }, []) | _ => - state.contributeExceptActionMap + state.contributeExceptInputMap ->Meta3dCommonlib.ImmutableHashMap.getValidValues ->Meta3dCommonlib.ArraySt.filter(((type_, _)) => { type_ == contributeType @@ -152,6 +152,9 @@ let _decideContributeType = (contribute: contribute) => { : !(contribute["uiControlName"]->Js.Nullable.isNullable) && !(contribute["func"]->Js.Nullable.isNullable) ? UIControl + : !(contribute["inputName"]->Js.Nullable.isNullable) && + !(contribute["func"]->Js.Nullable.isNullable) + ? Input : !(contribute["skinName"]->Js.Nullable.isNullable) && !(contribute["skin"]->Js.Nullable.isNullable) ? Skin @@ -248,26 +251,26 @@ and registerContribute = ( let contributeType = _decideContributeType(contribute) switch contributeType { - | Action => { + | Input => { ...state, - actionMap: switch state.actionMap->Meta3dCommonlib.ImmutableHashMap.get(protocolName) { - | Some(actions) => - state.actionMap->Meta3dCommonlib.ImmutableHashMap.set( + inputMap: switch state.inputMap->Meta3dCommonlib.ImmutableHashMap.get(protocolName) { + | Some(inputs) => + state.inputMap->Meta3dCommonlib.ImmutableHashMap.set( protocolName, - actions->Meta3dCommonlib.ArraySt.push(contribute), + inputs->Meta3dCommonlib.ArraySt.push(contribute), ) - | None => state.actionMap->Meta3dCommonlib.ImmutableHashMap.set(protocolName, [contribute]) + | None => state.inputMap->Meta3dCommonlib.ImmutableHashMap.set(protocolName, [contribute]) }, } | _ => _checkIsRegister( protocolName, - state.contributeExceptActionMap->Meta3dCommonlib.ImmutableHashMap.has(protocolName), + state.contributeExceptInputMap->Meta3dCommonlib.ImmutableHashMap.has(protocolName), ) { ...state, - contributeExceptActionMap: state.contributeExceptActionMap->Meta3dCommonlib.ImmutableHashMap.set( + contributeExceptInputMap: state.contributeExceptInputMap->Meta3dCommonlib.ImmutableHashMap.set( protocolName, (contributeType, contribute), ), diff --git a/defaults/meta3d/src/app_and_package/ManagerUtils.res b/defaults/meta3d/src/app_and_package/ManagerUtils.res index fc9d86742..bb8429df5 100755 --- a/defaults/meta3d/src/app_and_package/ManagerUtils.res +++ b/defaults/meta3d/src/app_and_package/ManagerUtils.res @@ -218,8 +218,8 @@ let _prepare = (): Meta3dType.Index.state => { extensionServiceMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), extensionStateMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), extensionLifeMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), - contributeExceptActionMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), - actionMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), + contributeExceptInputMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), + inputMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), packageStoreInAppMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), } } diff --git a/defaults/meta3d/test/features/contribute.feature b/defaults/meta3d/test/features/contribute.feature index 132c1491e..b8dd35331 100755 --- a/defaults/meta3d/test/features/contribute.feature +++ b/defaults/meta3d/test/features/contribute.feature @@ -10,19 +10,19 @@ Feature: Contribute Scenario: register contribute with unknown type When register unknown type contribute - And get all contributes by action type by api + And get all contributes by input type by api Then get empty Rule: error case - Scenario: register contribute which is not action and already registered before + Scenario: register contribute which is not input and already registered before Given register contribute of protocol name p1 When register contribute of protocol name p1 Then error - Scenario: register contribute which is action and already registered before - Given register action a1 of protocol name p1 - When register action a2 of protocol name p1 + Scenario: register contribute which is input and already registered before + Given register input a1 of protocol name p1 + When register input a2 of protocol name p1 Then not error diff --git a/defaults/meta3d/test/step-definitions/contribute.steps.res b/defaults/meta3d/test/step-definitions/contribute.steps.res index 61014cb9f..96cdc3f93 100755 --- a/defaults/meta3d/test/step-definitions/contribute.steps.res +++ b/defaults/meta3d/test/step-definitions/contribute.steps.res @@ -26,12 +26,6 @@ defineFeature(feature, test => { "a1-protocol", ContributeTool.buildGetContributeFunc(_buildAction("a1"))->Obj.magic, ) - state := - Main.registerContribute( - state.contents, - "a1-protocol", - ContributeTool.buildGetContributeFunc(_buildAction("a2"))->Obj.magic, - ) state := Main.registerContribute( state.contents, @@ -144,7 +138,7 @@ defineFeature(feature, test => { ->Js.Json.stringify, )->expect == ( - "[{\"actionName\":\"a1\",\"handler\":1},{\"actionName\":\"a2\",\"handler\":1}]", + "[{\"actionName\":\"a1\",\"handler\":1}]", "[{\"componentName\":\"c1\",\"createComponentFunc\":1}]", "[{\"elementName\":\"e1\",\"execOrder\":0}]", "[{\"createGameObjectFunc\":1,\"getAllGameObjectsFunc\":1}]", @@ -176,7 +170,7 @@ defineFeature(feature, test => { ) \"and"( - "get all contributes by action type by api", + "get all contributes by input type by api", () => { () }, @@ -187,7 +181,7 @@ defineFeature(feature, test => { () => { APITool.buildAPI().getAllContributesByType(. state.contents, - Meta3dType.ContributeType.Action, + Meta3dType.ContributeType.Input, ) ->Obj.magic ->Js.Json.stringify @@ -196,7 +190,7 @@ defineFeature(feature, test => { ) }) - test(."register contribute which is not action and already registered before", ({ + test(."register contribute which is not input and already registered before", ({ given, \"when", \"and", @@ -245,7 +239,7 @@ defineFeature(feature, test => { ) }) - test(."register contribute which is action and already registered before", ({ + test(."register contribute which is input and already registered before", ({ given, \"when", \"and", @@ -254,8 +248,14 @@ defineFeature(feature, test => { let state = ref(Obj.magic(1)) let protocolName = "p1" + let _buildInput = inputName => + { + "inputName": inputName, + "func": Obj.magic(1), + } + given( - "register action a1 of protocol name p1", + "register input a1 of protocol name p1", () => { state := StateTool.create() @@ -263,13 +263,13 @@ defineFeature(feature, test => { Main.registerContribute( state.contents, protocolName, - ContributeTool.buildGetContributeFunc(_buildAction("a1"))->Obj.magic, + ContributeTool.buildGetContributeFunc(_buildInput("a1"))->Obj.magic, ) }, ) \"when"( - "register action a2 of protocol name p1", + "register input a2 of protocol name p1", () => { () }, @@ -284,7 +284,7 @@ defineFeature(feature, test => { Main.registerContribute( state.contents, protocolName, - ContributeTool.buildGetContributeFunc(_buildAction("a2"))->Obj.magic, + ContributeTool.buildGetContributeFunc(_buildInput("a2"))->Obj.magic, ) }, )->toNotThrow diff --git a/defaults/meta3d/test/tool/ExtensionManagerTool.res b/defaults/meta3d/test/tool/ExtensionManagerTool.res index 238bb7dd6..ef4fbf1ca 100755 --- a/defaults/meta3d/test/tool/ExtensionManagerTool.res +++ b/defaults/meta3d/test/tool/ExtensionManagerTool.res @@ -3,5 +3,5 @@ let hasExtension = (state: Meta3dType.Index.state, protocolName) => { } let hasContribute = (state: Meta3dType.Index.state, protocolName) => { - state.contributeExceptActionMap->Meta3dCommonlib.ImmutableHashMap.has(protocolName) + state.contributeExceptInputMap->Meta3dCommonlib.ImmutableHashMap.has(protocolName) } diff --git a/doc/0.21.0.org b/doc/0.21.0.org index cb7463df1..5be75ca14 100755 --- a/doc/0.21.0.org +++ b/doc/0.21.0.org @@ -98,6 +98,8 @@ stored in editor file protocol is ui control's input data type protocol +map to ui control: one to one + name defined in implement uiControlInput: (meta3dState, api) => Promise @@ -463,19 +465,83 @@ TODO run test *** TODO ui control UI Control Inspector: -Rect, Config(old: Specific), Input, Event +# Rect, Config(old: Specific), Input, Event +Rect, Specific, Input, Event -TODO remove IsDraw -TODO Event is read from ui control output data: - TODO remove Config.ts->getUIControlSupportedEventNames, generateHandleUIControlEventStr +# TODO rename Specific to Config +# TODO Event is read from ui control output data: +# TODO remove Config.ts->getUIControlSupportedEventNames, generateHandleUIControlEventStr +**** DONE add Input +map to ui control: one to one -TODO only get editor whole service +name defined in implement + +uiControlInput: (meta3dState, api) => Promise + + +TODO ui +TODO editor whole->register +TODO element mr + + +TODO contribute third: support get multiple implement of one protocol + + +TODO element assemble space->UIControlInspector +TODO select only has matched inputs + + + +TODO finish input, pro + +TODO update ui control, action +**** DONE bdd test + +uiControlInspector + +elementmr + + +**** DONE run test + +TODO publish: +meta3d-ui-control-runstopbutton +meta3d-ui + + + +**** TODO Specific get image base64 + + + + + +**** TODO only get editor whole service +TODO update ui control and input api: +api = { + editorWholePackage service(actually engine-whole-protocol), +} + +api = { + editorWholePackage service, + + get/setActionState(for all actions' states), +} + + +**** TODO update Action + update api + +TODO move uiData to action protocol + + +**** TODO refactor: remove meta3d-input-runstopbutton2 *** TODO action @@ -483,6 +549,10 @@ TODO only get editor whole service TODO only get editor whole service + + + + *** TODO ui control input @@ -490,9 +560,12 @@ TODO only get editor whole service -*** TODO run test: Controller+Scene View UI Control +*** TODO run test: Controller+Scene View+Game View UI Control + +*** TODO abstract Controller +TODO move two textures to UI Control Inspector->Config # *** TODO feat: support published element contribute as a new UI Control(higher level) @@ -527,7 +600,20 @@ TODO because element contribute dependent on uiControlInput and Action, dependen *** TODO feat: action, uiControlInput add input textarea so that can get content by select or input -*** TODO run test: + GameView + Publish UI Control +*** TODO run test: Publish UI Control + +TODO run test:publish->engine render + + + + +*** TODO refactor: remove ui control->init + +# *** TODO refactor: rename inputData to specificData +*** TODO refactor: move rect out of specficData + + +*** TODO refactor: remove IsDraw @@ -624,6 +710,13 @@ abstract to Switch Button with configable two textures +* TODO refactor: continue "ap assemble space: remove Extensions, Selected Extensions" + +TODO remove Store->StartExtension +TODO remove extension-> isStart + + + diff --git "a/doc/\346\226\260\346\236\266\346\236\204\350\256\276\350\256\241.drawio" "b/doc/\346\226\260\346\236\266\346\236\204\350\256\276\350\256\241.drawio" index 0c7150f5c..417e9525a 100755 --- "a/doc/\346\226\260\346\236\266\346\236\204\350\256\276\350\256\241.drawio" +++ "b/doc/\346\226\260\346\236\266\346\236\204\350\256\276\350\256\241.drawio" @@ -1 +1 @@ -7Vxbd6M2EP41PDoHBOLyaCckzTnbs2mz7W770kOMgtli5MpybO+vrwBxEcI2G5vLus2L0QgJMZdvRjMiin673D0Qb7X4GfsoUoDq7xT9TgEAQBWyn4Sy5xTN0jJKQEI/o1UIz+E3xIkqp25CH62FGynGEQ1XInGO4xjNqUDzCMFb8bZXHIlPXXkBkgjPcy+SqZ9Dny4yqg2skv4TCoNF/mTNdLKepZffzN9kvfB8vK2QdFfRbwnGNLta7m5RlHAv50s27v5Ab7EwgmLaZsDqQXtwP4LH7dfoT/z7x91fj99+mZh8mjcv2vA3VoAZsQlnr5jNy5ZN95wX5j8bnHdM1qmkpuwGHax2ZSe7CpLfzwvMhvGp2KKy2bI+zo9iYsBYs0ouN8vonnhLdjnbLkKKnlfePKFvmXIx2oIuI9bSkm4ui0RPWEcuAUPl6+OKpIPicW+IULQ7yDutkAjTZYSXiJI9u4UP0FUuxH3ezprbUiUMh6vEoqIORq7GHlfDoJi6lBS74ML6DsF1Jbcnb/53YhLXIrkJsCxBdBNHlh0DpQbhaSrsSnrQkjiJfIY7vIkJXeAAx17kltQZwZvYR8m0Ca/Kez5gvOLM/Yoo3XMOehuKRdavqUdy/momI6DYrzazNSULOc5stm68IXN07AVNjtUeCRA9diNsFh9BkUfDN3Ell5eD2WBGF1NxUcM12JWG6yI4TbQGDTdzN1TV8IJ4ecbCK2Bsja+m3cDXgvlVvgKjK77aQ+AG4xfZf+Hj08Yf1cbdLhVJ2U74pRl58wmRkL08IsUYAXQkUGqPQqfB5Uxs4UOfcJi61EPBQN3JZ+jIR5UCnxLi7Su3rZIb1oefU2hR7Tml/mQzltpUvOP7FczQf3wN69HPgZaaaIBB3dz/Qu1CqFAdUqhA8rCuH1JM8tD9hdT2Ygfcb7IlTricuVDen4aLzA+HcfApE3ciA+q95Jtgg7eLzW8qOUZ4wuuQhjhmpAi9UlElOvDSUBNRUmuMfhqctKZ25aQNSTK3mFytAIxamGQ1bI57FoAcfLpxEMZINo3nOYqvVjJaLYAwrMElo2kSs/vwRLuQFo6IXad+6AaYeV/qivLO1A/lje6C15NeyOwkeLVrwStTCnGKzOtJweul4sumDfdF8lbRJgi8lyvKOdpWzbEZgycd8xWMK23VKs40xThThzfwUKR5QRu22kaSndi6IW1UzV5t3ZJs/Qtr/srEx3h9pT7XMWs+Fwzuc/VBks1trHKMe7+2ietBN/S6c7YbBY1uVHFNxZkpMyO9MJWZml5AfmHfKVO3rYdN5PHBe0GRqBheFAaJObLIO5XwLLG3cO5FU96xDH0/00HElpv69EwNeMKMTQ5nCrw7ZrC8HMwHK0URtqoSR4zlcE5YvTGhpQsmzjXmTLCe1Ebg19c16gSWgRyDTecpRtYl2C1UTmANKyea5dw4lb+8dCeU6prqGJ1BpzEsdJZByinw7Bkm8z3+aZg8dxtznvyaylCXwUlbmbmKoysuVGxLmU0TytRSpmZKuVcc7bpx0jiJkwAAMfy8DE6K4AtgX7BpDFJ7G6NN6wdwvR+bNrqLfWzFdpWZlVhwYtyWaOVQmcKrtulMww/atHqjmppT89gXjX3yTAfoy6bhaOvponeH1gi2Rq3x4exi57vK5RO9fg4GOLUTkadG6KpV07IOKuz5Myv49dvjLQMTgiNJG/uOwHVNjMC5fQwXgI+2cg3k+HtwA217LmbY3IXdo//+b+Uu9OPWzmJyx4Bi+HxR/929w85VvBk869Xdx3i1oYNjqtF44rgpBdxZ4QYOnMf4oeIcA7SE0WHP/+TLFExBEvOVlFUmmtOcGizSAIOXWaAc17lvKJbx51pEYhyViDGCY0BypuDTgqCrPe9jAdHzjOAklimD1BCe6J1HCMr0+7GM+zT5zJAR/NBb4tj/tAjjvOs+TNh17FTB6WNA+kFPdtJBmQeStOeGe/UIx6l/KNX1ISJd0qriu7V+gz1dq7PCHtcG2mzxhdMIDPB8Q3rXETujrSEN+pVavsxqZLGjKF4PUbMdu77LFb90exi+bGjf6KA5Y2fWcJ+htrP1Hnd95oHkydmpEUkJnHbO8rvz30UttPwOFJ5IgEuLqw/pJgVuNqUAr9EpndY6pzWonF03l0KVOq50HbXJ27HpatW7A5OC195AmTXLf/eRcbX8rym6+y8= \ No newline at end of file +7Vxbc5s4FP41vOyMM+Ym4NF2nGxmutvspt22+7JDjGLTYuTFcmz311eABAjJNo25xU1ego5AwPnO5dORsKJPlrvbyF0t/kAeDBRt6O0U/VrRNM20APkXS/apRLUtJ5XMI9+jslzw4H+HVDik0o3vwTV3IkYowP6KF85QGMIZ5mRuFKEtf9oTCvi7rtw5FAQPMzcQpZ98Dy9Sqa1Zufx36M8X7M4qoO+3dNnJ9E3WC9dD24JInyr6JEIIp0fL3QQGsfaYXtLrbg70Zg8WwRBXuWB1q95O32t326/Bv+if97v/7r7/NQB0mGc32NA3VjQQkAHHT4iMSx4b76kuwP8bxDoG6wSpETlB11a7vJMczeP/nxaIXEaHIg+Vjpb2UX1kA2tENav4cLMMbiJ3SQ7H24WP4cPKncXyLTEuIlvgZUBaatxNsYjthHQwBIwhfT5qSLqW3a6oKPbSMMJwVxBRxd1CtIQ42pNTaK8+pCDuWTttbnOTMBxqEouCORjMjF1qhvNs6BwpckDB+gngmsLt3p19i13iUpAbaJbFQTdwROxUS5WApw7NptAzLUGT0CNxhzZRhBdojkI3mObScYQ2oQfjYWNd5ee8Q2hFlfsVYrynGnQ3GPGqX2M3YvpVARHA0Cs2D6p7jTbRDB57HxrmyQ3mEB870UxPjN/2KHwRDFzsP/NRuH4cgMSNajNx3sJVsykL1/ngNFAlFg5YGipaeCasX7HmBSi2pFdgS/SaKb+oV81oSq92F3GDqDDaf6bXJ40vxcb1LoEkb8f6Ug3WvIeRT14eRtk1XNARgtJB5E4Hl7pjC730HvlJSj1EBspJPg2X9Koc8FEUufvCaav4hPXh+2RWVLpPbj/piLk1Ze/4cgMz9NdvYc3lOa2iJRpav9LcG6g1gMrYYE9A1YQMO/V8jCJG3R+j0lzsQPqNp8SxltMUSvsTukjysB/OP6Rwxxhg95FNgg3azia/CXJEcI/WPvZRSEQBfMK8STSQpU2Vj5KqlP1IkrQ6bCpJGwIyExRdLABGiSZZkslxywCI5HMazv0Qiq7xMIPhxSKjlgiEYXWOjKoKym4jE+18nCUicpzkoSsNsL4kFbHOJA+xRm3k9WQWAu2QV7tEXolR8EOkaVAgr3XxS9mEu5a6VbCZz93HC6o52lYpsRmdFx3ZE/SrbFWJZwKeZ+rmlXmIab7ch62qTLIdXzeEiSpo1dctwdc/k+bfBD6i6wvNuQ4o5Vyt85yrd1JsruKVPZj7VS1c92tCrztnp1FNmkaVKVCcsTI2kgOgjIfJgUkP7GtlNK2aYWNdvXMfYcAbhhv489gdCfNOEB7HzuXP3GBEO5a+56U2CMnjJjk9NQNaMCODm2PFvJYCf9QDBDfO1o3pXZTi0qy0Jjy8Aqalcy5OTejMYD0oXYGentawkbCsiRxsNEtiZBnBZkPlwCzFyoFqO1dO4Y8t3XFLdbJ1jMZCp9Ft6MxJyqng2WyYZFP602Gy9mnMefjJlqHqiZO2Mp4qjq5MTcW2lPEolowsZQQSyY3iqK8wTrLKVS1xUtM0nn7WEyf54KuZbYVNo5O1tx74tK72yqeN5riPrdhTZWzFHhw7t8V7uamMzNfn08xsz/fp4dUQqE4pY9fKfVilQ2vLp83erqfz2d202p8aVY4P9S92vmi5fADK+2B0o7Qj8tQV+tAqWVkDK+zsnoX49fFuQoJJhALBGttm4DrgGTj1j+4IeG9XrjWRf7ftoFX3xfSsdsESUhv5+wJqF3pd+Tvm5I5h8vS51vzdfMJmNi8PnuXV3btwtcGdx1Qg25Egi6JqYws3Zsd1jD7zHEZfXtv+H/bcnCsIMF/IsspAdeSlwawM0PkyiynyuukzDMX4cymQGEcRMXqwDUisFHxYRPBi9/tYGp95erATC4hBqotM9MItBHn5/VjFfRR/ZkgEnu8uUeh9WPgh67rxY3WduasA6BUTFDDqTlCH5s0lhuOUP5RqehORLlhV9t1au2RPV8uqsPs1gQYVvnDqgQO240hGVUfq11dq7LmLzGKHYbjuYs227/Yurvgl00P/cYPbjg6q03dldfcZajVfb27Wx1JI47lSNAKnWrL86fp3thaafwdqniiACw9XvqSZEjiQlQB/1aTktGSIIlUpx5WmWZs4HRutVq0nMIG8dheUg/DTfPvxy7M2/aZO9E30pzv73NgvO1Tej0I0icuOEqFvcIICFJfjQhTG7vdErL8kql4el2215/35ALAS+I9UKKzh1bDwVyp+D7IN0sUt9bLvuZvCWjY7fsO6Gawlv/vRKtbinLUerH/7BbEGx7HWu/ZrccL2hnVDWGcgdoW100fqKuWUJwmqnI9IthnIT9TOJK7n0aaXrAwP7yOE0ewlG2/Os2qn9HHfQO8bCxWpSf0L7TXrEMjWOxpbaJerraks/wsyOtvmI3+Z0HUd+NW3LN8W1qZkC01NWJNm/hucaakj/ylTffoD \ No newline at end of file diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/contribute/ActionContributeType.bs.js b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/contribute/ActionContributeType.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/service/BrowserType.bs.js b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/service/BrowserType.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/service/EventType.bs.js b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/service/EventType.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/service/ServiceType.bs.js b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/service/ServiceType.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/state/StateType.bs.js b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/es6_global/src/state/StateType.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/contribute/ActionContributeType.bs.js b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/contribute/ActionContributeType.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/service/BrowserType.bs.js b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/service/BrowserType.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/service/EventType.bs.js b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/service/EventType.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/service/ServiceType.bs.js b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/service/ServiceType.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/state/StateType.bs.js b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/lib/js/src/state/StateType.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/src/service/BrowserType.gen.tsx b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/src/service/BrowserType.gen.tsx old mode 100755 new mode 100644 diff --git a/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/src/service/EventType.gen.tsx b/packages/editor-whole/event/protocols/extension_protocols/meta3d-event-protocol/src/service/EventType.gen.tsx old mode 100755 new mode 100644 diff --git a/packages/editor-whole/extensions/meta3d-editor-webgl1-three-whole/package.json b/packages/editor-whole/extensions/meta3d-editor-webgl1-three-whole/package.json index 598604f1a..ec7cd5b0d 100755 --- a/packages/editor-whole/extensions/meta3d-editor-webgl1-three-whole/package.json +++ b/packages/editor-whole/extensions/meta3d-editor-webgl1-three-whole/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-editor-webgl1-three-whole", - "version": "0.20.7", + "version": "0.20.8", "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", "protocol": { "name": "meta3d-editor-whole-protocol" diff --git a/packages/editor-whole/extensions/meta3d-editor-webgl1-three-whole/src/Main.ts b/packages/editor-whole/extensions/meta3d-editor-webgl1-three-whole/src/Main.ts index cfbe22b33..7af308041 100755 --- a/packages/editor-whole/extensions/meta3d-editor-webgl1-three-whole/src/Main.ts +++ b/packages/editor-whole/extensions/meta3d-editor-webgl1-three-whole/src/Main.ts @@ -21,6 +21,7 @@ import { init, update, render } from "meta3d-whole-utils/src/DirectorAPI" import { skin } from "meta3d-skin-protocol" import { sync } from "./SyncUtils" import { service as exportSceneService } from "meta3d-export-scene-protocol/src/service/ServiceType" +import { inputContribute } from "meta3d-ui-protocol/src/contribute/InputContributeType" let _registerEditorPipelines = ( @@ -125,13 +126,26 @@ let _prepareUIControls = (meta3dState: meta3dState, api: api): Promise(meta3dState, "meta3d-ui-protocol")) - let uiControlContributes = api.getAllContributesByType>(meta3dState, contributeType.UIControl) + let uiControlContributes = api.getAllContributesByType>(meta3dState, contributeType.UIControl) meta3dState = uiControlContributes.reduce((meta3dState, contribute) => { return registerUIControl(meta3dState, contribute) }, meta3dState) - return reducePromise>(uiControlContributes, (meta3dState, { init },) => init(meta3dState), meta3dState) + return reducePromise>(uiControlContributes, (meta3dState, { init },) => init(meta3dState), meta3dState) +} + +let _prepareInputs = (meta3dState: meta3dState, api: api): meta3dState => { + let { registerInput } = getExn(api.getPackageService(meta3dState, "meta3d-ui-protocol")) + + + let inputContributes = api.getAllContributesByType>(meta3dState, contributeType.Input) + + meta3dState = inputContributes.reduce((meta3dState, contribute) => { + return registerInput(meta3dState, contribute) + }, meta3dState) + + return meta3dState } let _initForVisual = (meta3dState: meta3dState, api: api, { isDebug, canvas }) => { @@ -145,6 +159,8 @@ let _initForVisual = (meta3dState: meta3dState, api: api, { isDebug, canvas }) = isDebug ) }).then(meta3dState => { + meta3dState = _prepareInputs(meta3dState, api) + return _prepareUIControls(meta3dState, api) }) }) @@ -187,6 +203,8 @@ let _initForVisualRun = (meta3dState: meta3dState, api: api, { isDebug, canvas } isDebug ) }).then(meta3dState => { + meta3dState = _prepareInputs(meta3dState, api) + return _prepareUIControls(meta3dState, api) }) }) @@ -312,6 +330,8 @@ let _initForRun = (meta3dState: meta3dState, api: api, [_, { isDebug }]: configD isDebug ) }).then(meta3dState => { + meta3dState = _prepareInputs(meta3dState, api) + return _prepareUIControls(meta3dState, api) }) }) diff --git a/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.compiler.log b/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.compiler.log index 3eea53bc5..ef14d4b15 100644 --- a/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.compiler.log +++ b/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.compiler.log @@ -1,2 +1,2 @@ -#Start(1700035469879) -#Done(1700035469923) +#Start(1700123344820) +#Done(1700123344876) diff --git a/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.ninja_log b/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.ninja_log index a62dc2978..1423257b8 100644 --- a/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.ninja_log +++ b/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/.ninja_log @@ -1,8 +1,8 @@ # ninja log v6 -0 17 1700035469894941281 src/service/ServiceType.ast 785165cefc5839bb -1 17 1700035469894890883 Meta3dEditorWholeProtocol.cmi 27dde7c45547adb8 -17 25 1700035469903849372 src/service/ServiceType.d 702d225c4edca7ca -25 43 1700035469921886115 src/service/ServiceType-Meta3dEditorWholeProtocol.cmj 57052a31ecc0b6f6 -25 43 1700035469921886115 src/service/ServiceType-Meta3dEditorWholeProtocol.cmi 57052a31ecc0b6f6 -25 43 1700035469921886115 ../es6_global/src/service/ServiceType.bs.js 57052a31ecc0b6f6 -25 43 1700035469921886115 ../js/src/service/ServiceType.bs.js 57052a31ecc0b6f6 +0 20 1700123344838742309 src/service/ServiceType.ast 785165cefc5839bb +1 22 1700123344839455735 Meta3dEditorWholeProtocol.cmi 27dde7c45547adb8 +20 35 1700123344854707048 src/service/ServiceType.d 702d225c4edca7ca +35 56 1700123344875054105 src/service/ServiceType-Meta3dEditorWholeProtocol.cmj 95f5e0cf6a228846 +35 56 1700123344875054105 src/service/ServiceType-Meta3dEditorWholeProtocol.cmi 95f5e0cf6a228846 +35 56 1700123344875054105 ../es6_global/src/service/ServiceType.bs.js 95f5e0cf6a228846 +35 56 1700123344875054105 ../js/src/service/ServiceType.bs.js 95f5e0cf6a228846 diff --git a/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/src/service/ServiceType-Meta3dEditorWholeProtocol.cmi b/packages/editor-whole/protocols/extension_protocols/meta3d-editor-whole-protocol/lib/bs/src/service/ServiceType-Meta3dEditorWholeProtocol.cmi index 964bcaa17482685cb66fb1b26361b22f497689e7..da1396fb82ed2511844c211fb7c428eb8fed6dc1 100644 GIT binary patch delta 204 zcmV;-05ku~4TTP{lmQJ-0001>0007<00069lc51=7Bti;CQng1+m>EsOcQ#!E1;k{ zQ*>dI@c|hSfCZB5MW#69KO9o&s>TX;lSu;08uQN?+}>0cx`19JWAxMeMxdYxCsSo| zc4=diQ34~AQ3Gud7gzn>@(SczoO(45?LR?#v(5u_0R{;qNp5g;li>v-5c-C^I-sfX zWewoSWs;t=bCW;?6%aI+4scggKEssGAL=`#UnG-d1>_K!Z=>*FE&S!*a^^-Rp?Ud} GSq5@sbX3g% delta 191 zcmV;w06_nR4$BR&lmQJD0001+0007m0005?lc51=7A-69d8A3ZxgT?$c9bQGw4k6m zQ*>dI@c|hSOEji6`+jT6S$6oLl?mSZlSu;08lKN~+_qTsu#{K$uHW7!xS*g3CsSo| zc4=diQ34~AQ3GudIetOJ>ra+>6Ryx33VqI4v(5u_0V6O;Ze(S6Elp)~VKZb@d2nTr tFxUJNh6k}CR>AN<_I$VPT9cmzZu1_p)&3=B+jfS7&qLdHx1lPj8P{()Avr^TiE2v_aYo*XMCFVMg` z>5c0$izoInK`&Pw<0_x*$#h!k^LfcT_d>*WHN>eTf4ThIZNUOg_2AT^vdrYkflSJi zi$sMcCo@M2h=>2Z_lfIC^qeYFzPI*{)tk>TmoTz%s(9uVlumxgswD8MZI9K0l^;`i zADl>?G;ee9WCvDJ0h8%`1>qrfho_vAe`UQSUS%@3u*2k~tV;xD<}dz`p!?_P{i0`X zY6~lWPL5=25f;z|x?hEXfwPN&fy0G^fx(1fqN4g{adtgMt``nWtY058FtWbh?9Y+U z%J^pUe%>Wa1{MY>M#+Xo#>Q#JCKkGe=9VCVq$IN>1H(iEBbY#PqGgInsztJy^<)`A ziOs78PB3D+pjqg)1iE{Hfq~nHoAZRj8MV$$Fj&vM+pMzppuxhkMmt)b$2?xJfR*vY z1OxOSo7}*xEy=QNg29TawT;ONdn#VNZK*w>?#={K|7WtXXn_EFWK7=6WHI@*=tRt@ hyThobf*#2Z6AUE9euvokFFiCd`Rk%z=QG|r0syPG+@Jse delta 468 zcmcblcTac26h>ZA1_p-N3=B-o3=E84Cog2o6wuXvU%A9{_fGlZd1X^nyS7ZeC?+r9 zZL-YtcU|_W$g&>`r*hu=HQAHtw7|UcWp}nkeAzH1{KvZc_tbVw-YIH7Ihi?Hz_QNq z$ZP*;mBQ;TNORSmi`aaQxr9;Kz%wr;wL;f7wItCvC8V+-b%Me5KSFKn8m1Z+)@{}3z_&-oiMPr>V=LFVKfA=Sw{*y4rxKLZ^q&%nT0$iTp1#KFK| z!Z1-$eRCkY9wXN&2PW394;dI)&u;GI$Y*6dxA`aU5+;4~q!beaVo_n`h zW$!_Qg=dX+v^ meta3dState // type addToFuncs = (meta3dState: meta3dState, func: func) => meta3dState -export type uiControlContribute = uiControlContribute_ +export type uiControlContribute = uiControlContribute_ + +export type inputContribute = inputContribute_ export type actionContribute = actionContribute_ diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/dist/static/js/main.js b/packages/editor-whole/ui/extensions/meta3d-ui/dist/static/js/main.js old mode 100755 new mode 100644 index 6d88eef79..548271603 --- a/packages/editor-whole/ui/extensions/meta3d-ui/dist/static/js/main.js +++ b/packages/editor-whole/ui/extensions/meta3d-ui/dist/static/js/main.js @@ -336,7 +336,7 @@ eval("\n\nvar Curry = __webpack_require__(/*! ./curry.js */ \"../../../../../nod \*******************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { -eval("\n\nvar UIManager$Meta3dUi = __webpack_require__(/*! ./UIManager.bs.js */ \"./lib/js/src/UIManager.bs.js\");\nvar NullableSt$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/NullableSt.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/NullableSt.bs.js\");\nvar ImmutableHashMap$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/hash_map/ImmutableHashMap.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/hash_map/ImmutableHashMap.bs.js\");\n\nfunction getExtensionService(api) {\n var partial_arg = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$1 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$2 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$3 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$4 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$5 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$6 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n return {\n registerElement: (function (meta3dState, elementContribute) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.registerElement(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), elementContribute));\n }),\n registerSkin: (function (meta3dState, skinContribute) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.registerSkin(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), skinContribute));\n }),\n registerUIControl: (function (meta3dState, uiControlContribute) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.registerUIControl(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), uiControlContribute));\n }),\n render: (function (param, param$1, param$2) {\n return UIManager$Meta3dUi.render(api, param, param$1, param$2);\n }),\n show: (function (meta3dState, elementName) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.show(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), elementName));\n }),\n hide: (function (meta3dState, elementName) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.hide(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), elementName));\n }),\n isStateChange: (function (meta3dState, elementName) {\n return UIManager$Meta3dUi.isStateChange(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), elementName);\n }),\n getElementState: (function (meta3dState, elementName) {\n return UIManager$Meta3dUi.getElementState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), elementName);\n }),\n updateElementState: (function (meta3dState, updateElementStateFunc) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.updateElementState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), updateElementStateFunc));\n }),\n getSkin: (function (meta3dState, skinName) {\n return UIManager$Meta3dUi.getSkin(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), skinName);\n }),\n getUIControlFunc: (function (meta3dState, uiControlName) {\n return UIManager$Meta3dUi.getUIControlFuncExn(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), uiControlName);\n }),\n getUIControlState: (function (meta3dState, uiControlName) {\n return UIManager$Meta3dUi.getUIControlState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), uiControlName);\n }),\n setUIControlState: (function (meta3dState, uiControlName, uiControlState) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.setUIControlState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), uiControlName, uiControlState));\n }),\n setStyle: (function (meta3dState, style) {\n return UIManager$Meta3dUi.setStyle(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], style);\n }),\n beginWindow: (function (meta3dState, label) {\n return UIManager$Meta3dUi.beginWindow(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], label);\n }),\n endWindow: (function (meta3dState) {\n return UIManager$Meta3dUi.endWindow(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ]);\n }),\n beginChild: (function (meta3dState, label) {\n return UIManager$Meta3dUi.beginChild(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], label);\n }),\n endChild: (function (meta3dState) {\n return UIManager$Meta3dUi.endChild(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ]);\n }),\n setNextWindowRect: (function (meta3dState, rect) {\n return UIManager$Meta3dUi.setNextWindowRect(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], rect);\n }),\n addFBOTexture: (function (meta3dState, texture, rect) {\n return UIManager$Meta3dUi.addFBOTexture(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], texture, rect);\n }),\n getFBOTexture: (function (meta3dState, textureID) {\n return UIManager$Meta3dUi.getFBOTexture(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), textureID);\n }),\n setFBOTexture: (function (meta3dState, textureID, texture) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.setFBOTexture(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), textureID, texture));\n }),\n getWindowBarHeight: (function (meta3dState) {\n return UIManager$Meta3dUi.getWindowBarHeight(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ]);\n }),\n getContext: (function (meta3dState) {\n return UIManager$Meta3dUi.getContext(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ]);\n }),\n button: (function (meta3dState, label, size) {\n return UIManager$Meta3dUi.button(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], label, size);\n }),\n setCursorPos: (function (meta3dState, pos) {\n return UIManager$Meta3dUi.setCursorPos(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], pos);\n }),\n loadImage: (function (param, param$1) {\n return UIManager$Meta3dUi.loadImage(partial_arg, param, param$1);\n }),\n asset: (function (param, param$1, param$2, param$3, param$4) {\n return UIManager$Meta3dUi.asset(partial_arg$1, param, param$1, param$2, param$3, param$4);\n }),\n handleDragDropTarget: (function (param, param$1) {\n return UIManager$Meta3dUi.handleDragDropTarget(partial_arg$2, param, param$1);\n }),\n menu: (function (param, param$1, param$2, param$3) {\n return UIManager$Meta3dUi.menu(partial_arg$3, param, param$1, param$2, param$3);\n }),\n sceneTree: (function (param, param$1, param$2, param$3, param$4, param$5) {\n return UIManager$Meta3dUi.sceneTree(partial_arg$4, param, param$1, param$2, param$3, param$4, param$5);\n }),\n inspector: (function (param, param$1, param$2, param$3, param$4, param$5, param$6) {\n return UIManager$Meta3dUi.inspector(partial_arg$5, param, param$1, param$2, param$3, param$4, param$5, param$6);\n }),\n runStopButton: (function (param, param$1, param$2, param$3) {\n return UIManager$Meta3dUi.runStopButton(partial_arg$6, param, param$1, param$2, param$3);\n }),\n init: UIManager$Meta3dUi.init,\n clear: UIManager$Meta3dUi.clear,\n getCurrentElementState: (function (meta3dState) {\n return UIManager$Meta3dUi.getCurrentElementState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"));\n }),\n setCurrentElementState: (function (meta3dState, currentElementState) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.setCurrentElementState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), currentElementState));\n })\n };\n}\n\nfunction createExtensionState(param) {\n return {\n elementFuncMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n elementStateMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n elementExecOrderMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n isShowMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n isStateChangeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n skinContributeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n uiControlContributeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n uiControlStateMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n currentElementName: undefined,\n fboTextureMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined)\n };\n}\n\nfunction getExtensionLife(api, param) {\n return {\n onRegister: null,\n onRestore: NullableSt$Meta3dCommonlib.$$return(function (param, param$1) {\n return UIManager$Meta3dUi.restore(api, param, param$1);\n }),\n onDeepCopy: NullableSt$Meta3dCommonlib.$$return(function (param) {\n return UIManager$Meta3dUi.deepCopy(api, param);\n }),\n onStart: null,\n onInit: null,\n onUpdate: null\n };\n}\n\nexports.getExtensionService = getExtensionService;\nexports.createExtensionState = createExtensionState;\nexports.getExtensionLife = getExtensionLife;\n/* No side effect */\n\n\n//# sourceURL=webpack://Extension/./lib/js/src/Main.bs.js?"); +eval("\n\nvar UIManager$Meta3dUi = __webpack_require__(/*! ./UIManager.bs.js */ \"./lib/js/src/UIManager.bs.js\");\nvar NullableSt$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/NullableSt.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/NullableSt.bs.js\");\nvar ImmutableHashMap$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/hash_map/ImmutableHashMap.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/hash_map/ImmutableHashMap.bs.js\");\n\nfunction getExtensionService(api) {\n var partial_arg = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$1 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$2 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$3 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$4 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$5 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n var partial_arg$6 = [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ];\n return {\n registerElement: (function (meta3dState, elementContribute) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.registerElement(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), elementContribute));\n }),\n registerSkin: (function (meta3dState, skinContribute) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.registerSkin(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), skinContribute));\n }),\n registerUIControl: (function (meta3dState, uiControlContribute) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.registerUIControl(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), uiControlContribute));\n }),\n registerInput: (function (meta3dState, inputContribute) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.registerInput(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), inputContribute));\n }),\n render: (function (param, param$1, param$2) {\n return UIManager$Meta3dUi.render(api, param, param$1, param$2);\n }),\n show: (function (meta3dState, elementName) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.show(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), elementName));\n }),\n hide: (function (meta3dState, elementName) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.hide(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), elementName));\n }),\n isStateChange: (function (meta3dState, elementName) {\n return UIManager$Meta3dUi.isStateChange(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), elementName);\n }),\n getElementState: (function (meta3dState, elementName) {\n return UIManager$Meta3dUi.getElementState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), elementName);\n }),\n updateElementState: (function (meta3dState, updateElementStateFunc) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.updateElementState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), updateElementStateFunc));\n }),\n getSkin: (function (meta3dState, skinName) {\n return UIManager$Meta3dUi.getSkin(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), skinName);\n }),\n getUIControlFunc: (function (meta3dState, uiControlName) {\n return UIManager$Meta3dUi.getUIControlFuncExn(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), uiControlName);\n }),\n getInputFunc: (function (meta3dState, inputName) {\n return UIManager$Meta3dUi.getInputFunc(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), inputName);\n }),\n getUIControlState: (function (meta3dState, uiControlName) {\n return UIManager$Meta3dUi.getUIControlState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), uiControlName);\n }),\n setUIControlState: (function (meta3dState, uiControlName, uiControlState) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.setUIControlState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), uiControlName, uiControlState));\n }),\n setStyle: (function (meta3dState, style) {\n return UIManager$Meta3dUi.setStyle(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], style);\n }),\n beginWindow: (function (meta3dState, label) {\n return UIManager$Meta3dUi.beginWindow(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], label);\n }),\n endWindow: (function (meta3dState) {\n return UIManager$Meta3dUi.endWindow(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ]);\n }),\n beginChild: (function (meta3dState, label) {\n return UIManager$Meta3dUi.beginChild(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], label);\n }),\n endChild: (function (meta3dState) {\n return UIManager$Meta3dUi.endChild(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ]);\n }),\n setNextWindowRect: (function (meta3dState, rect) {\n return UIManager$Meta3dUi.setNextWindowRect(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], rect);\n }),\n addFBOTexture: (function (meta3dState, texture, rect) {\n return UIManager$Meta3dUi.addFBOTexture(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], texture, rect);\n }),\n getFBOTexture: (function (meta3dState, textureID) {\n return UIManager$Meta3dUi.getFBOTexture(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), textureID);\n }),\n setFBOTexture: (function (meta3dState, textureID, texture) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.setFBOTexture(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), textureID, texture));\n }),\n getWindowBarHeight: (function (meta3dState) {\n return UIManager$Meta3dUi.getWindowBarHeight(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ]);\n }),\n getContext: (function (meta3dState) {\n return UIManager$Meta3dUi.getContext(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ]);\n }),\n button: (function (meta3dState, label, size) {\n return UIManager$Meta3dUi.button(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], label, size);\n }),\n setCursorPos: (function (meta3dState, pos) {\n return UIManager$Meta3dUi.setCursorPos(meta3dState, [\n api,\n \"meta3d-imgui-renderer-protocol\"\n ], pos);\n }),\n loadImage: (function (param, param$1) {\n return UIManager$Meta3dUi.loadImage(partial_arg, param, param$1);\n }),\n asset: (function (param, param$1, param$2, param$3, param$4) {\n return UIManager$Meta3dUi.asset(partial_arg$1, param, param$1, param$2, param$3, param$4);\n }),\n handleDragDropTarget: (function (param, param$1) {\n return UIManager$Meta3dUi.handleDragDropTarget(partial_arg$2, param, param$1);\n }),\n menu: (function (param, param$1, param$2, param$3) {\n return UIManager$Meta3dUi.menu(partial_arg$3, param, param$1, param$2, param$3);\n }),\n sceneTree: (function (param, param$1, param$2, param$3, param$4, param$5) {\n return UIManager$Meta3dUi.sceneTree(partial_arg$4, param, param$1, param$2, param$3, param$4, param$5);\n }),\n inspector: (function (param, param$1, param$2, param$3, param$4, param$5, param$6) {\n return UIManager$Meta3dUi.inspector(partial_arg$5, param, param$1, param$2, param$3, param$4, param$5, param$6);\n }),\n runStopButton: (function (param, param$1, param$2, param$3) {\n return UIManager$Meta3dUi.runStopButton(partial_arg$6, param, param$1, param$2, param$3);\n }),\n init: UIManager$Meta3dUi.init,\n clear: UIManager$Meta3dUi.clear,\n getCurrentElementState: (function (meta3dState) {\n return UIManager$Meta3dUi.getCurrentElementState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"));\n }),\n setCurrentElementState: (function (meta3dState, currentElementState) {\n return api.setExtensionState(meta3dState, \"meta3d-ui-protocol\", UIManager$Meta3dUi.setCurrentElementState(api.getExtensionState(meta3dState, \"meta3d-ui-protocol\"), currentElementState));\n })\n };\n}\n\nfunction createExtensionState(param) {\n return {\n elementFuncMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n elementStateMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n elementExecOrderMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n isShowMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n isStateChangeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n skinContributeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n uiControlContributeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n uiControlStateMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n inputContributeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined),\n currentElementName: undefined,\n fboTextureMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined)\n };\n}\n\nfunction getExtensionLife(api, param) {\n return {\n onRegister: null,\n onRestore: NullableSt$Meta3dCommonlib.$$return(function (param, param$1) {\n return UIManager$Meta3dUi.restore(api, param, param$1);\n }),\n onDeepCopy: NullableSt$Meta3dCommonlib.$$return(function (param) {\n return UIManager$Meta3dUi.deepCopy(api, param);\n }),\n onStart: null,\n onInit: null,\n onUpdate: null\n };\n}\n\nexports.getExtensionService = getExtensionService;\nexports.createExtensionState = createExtensionState;\nexports.getExtensionLife = getExtensionLife;\n/* No side effect */\n\n\n//# sourceURL=webpack://Extension/./lib/js/src/Main.bs.js?"); /***/ }), @@ -346,7 +346,7 @@ eval("\n\nvar UIManager$Meta3dUi = __webpack_require__(/*! ./UIManager.bs.js */ \************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { -eval("\n\nvar Curry = __webpack_require__(/*! rescript/lib/js/curry.js */ \"../../../../../node_modules/rescript/lib/js/curry.js\");\nvar Caml_obj = __webpack_require__(/*! rescript/lib/js/caml_obj.js */ \"../../../../../node_modules/rescript/lib/js/caml_obj.js\");\nvar Js_array = __webpack_require__(/*! rescript/lib/js/js_array.js */ \"../../../../../node_modules/rescript/lib/js/js_array.js\");\nvar Caml_option = __webpack_require__(/*! rescript/lib/js/caml_option.js */ \"../../../../../node_modules/rescript/lib/js/caml_option.js\");\nvar ArraySt$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/ArraySt.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/ArraySt.bs.js\");\nvar OptionSt$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/OptionSt.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/OptionSt.bs.js\");\nvar PromiseSt$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/PromiseSt.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/PromiseSt.bs.js\");\nvar NullableSt$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/NullableSt.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/NullableSt.bs.js\");\nvar ImmutableHashMap$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/hash_map/ImmutableHashMap.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/hash_map/ImmutableHashMap.bs.js\");\n\nfunction hide(state, elementName) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: ImmutableHashMap$Meta3dCommonlib.set(state.isShowMap, elementName, false),\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction show(state, elementName) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: ImmutableHashMap$Meta3dCommonlib.set(state.isShowMap, elementName, true),\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction _markStateChange(state, elementName) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: ImmutableHashMap$Meta3dCommonlib.set(state.isStateChangeMap, elementName, true),\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction _markStateNotChange(state, elementName) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: ImmutableHashMap$Meta3dCommonlib.set(state.isStateChangeMap, elementName, false),\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction _markAllStateNotChange(state, needMarkStateNotChangeIds) {\n return ArraySt$Meta3dCommonlib.reduceOneParam(needMarkStateNotChangeIds, _markStateNotChange, state);\n}\n\nfunction _getElementStateExn(param, elementName) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(param.elementStateMap, elementName);\n}\n\nfunction getElementState(param, elementName) {\n return ImmutableHashMap$Meta3dCommonlib.getNullable(param.elementStateMap, elementName);\n}\n\nfunction _setElementState(state, elementName, elementState) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: ImmutableHashMap$Meta3dCommonlib.set(state.elementStateMap, elementName, elementState),\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction _getElementExecOrderExn(state, elementName) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(state.elementExecOrderMap, elementName);\n}\n\nfunction _setElementExecOrder(state, elementName, execOrder) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: ImmutableHashMap$Meta3dCommonlib.set(state.elementExecOrderMap, elementName, execOrder),\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction _getCurrentElementName(state) {\n return OptionSt$Meta3dCommonlib.getExn(state.currentElementName);\n}\n\nfunction _setCurrentElementName(state, elementName) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: elementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction updateElementState(state, updateElementStateFunc) {\n var elementName = OptionSt$Meta3dCommonlib.getExn(state.currentElementName);\n var oldElementState = _getElementStateExn(state, elementName);\n var newElementState = Curry._1(updateElementStateFunc, oldElementState);\n if (Caml_obj.notequal(oldElementState, newElementState)) {\n return _setElementState(_markStateChange(state, elementName), elementName, newElementState);\n } else {\n return _markStateNotChange(state, elementName);\n }\n}\n\nfunction _exec(meta3dState, state) {\n var elementFuncMap = state.elementFuncMap;\n var __x = ImmutableHashMap$Meta3dCommonlib.entries(state.isShowMap);\n return ArraySt$Meta3dCommonlib.traverseReducePromiseM(Js_array.sortInPlaceWith((function (param, param$1) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(state.elementExecOrderMap, param[0]) - ImmutableHashMap$Meta3dCommonlib.getExn(state.elementExecOrderMap, param$1[0]) | 0;\n }), __x), (function (param, param$1) {\n var needMarkStateNotChangeIds = param[1];\n var meta3dState = param[0];\n if (!param$1[1]) {\n return Promise.resolve([\n meta3dState,\n needMarkStateNotChangeIds\n ]);\n }\n var elementName = param$1[0];\n var elementFunc = ImmutableHashMap$Meta3dCommonlib.getExn(elementFuncMap, elementName);\n return PromiseSt$Meta3dCommonlib.map(elementFunc(meta3dState, _getElementStateExn(state, elementName)), (function (meta3dState) {\n return [\n meta3dState,\n ArraySt$Meta3dCommonlib.push(needMarkStateNotChangeIds, elementName)\n ];\n }));\n }), [\n meta3dState,\n []\n ]);\n}\n\nfunction _invokeIMGUIRenderFunc(meta3dState, invokeFunc, param) {\n var imguiRendererExtensionProtocolName = param[1];\n var api = param[0];\n var imguiRendererState = api.getExtensionState(meta3dState, imguiRendererExtensionProtocolName);\n var imguiRendererService = api.getExtensionService(meta3dState, imguiRendererExtensionProtocolName);\n var imguiRendererState$1 = invokeFunc(imguiRendererState, imguiRendererService);\n return api.setExtensionState(meta3dState, imguiRendererExtensionProtocolName, imguiRendererState$1);\n}\n\nfunction _invokeIMGUIRenderFuncWithParam(meta3dState, invokeFunc, param) {\n var imguiRendererExtensionProtocolName = param[1];\n var api = param[0];\n var imguiRendererState = api.getExtensionState(meta3dState, imguiRendererExtensionProtocolName);\n var imguiRendererService = api.getExtensionService(meta3dState, imguiRendererExtensionProtocolName);\n var match = invokeFunc(imguiRendererState, imguiRendererService);\n var meta3dState$1 = api.setExtensionState(meta3dState, imguiRendererExtensionProtocolName, match[0]);\n return [\n meta3dState$1,\n match[1]\n ];\n}\n\nfunction _invokeIMGUIRenderFuncReturnData(meta3dState, invokeFunc, param) {\n var imguiRendererExtensionProtocolName = param[1];\n var api = param[0];\n var imguiRendererState = api.getExtensionState(meta3dState, imguiRendererExtensionProtocolName);\n var imguiRendererService = api.getExtensionService(meta3dState, imguiRendererExtensionProtocolName);\n return invokeFunc(imguiRendererState, imguiRendererService);\n}\n\nfunction render(api, meta3dState, param, time) {\n var imguiRendererExtensionProtocolName = param[1];\n var uiExtensionProtocolName = param[0];\n var state = api.getExtensionState(meta3dState, uiExtensionProtocolName);\n var meta3dState$1 = api.setExtensionState(meta3dState, uiExtensionProtocolName, state);\n var meta3dState$2 = _invokeIMGUIRenderFunc(meta3dState$1, (function (imguiRendererState, imguiRendererService) {\n return imguiRendererService.beforeExec(imguiRendererState, time);\n }), [\n api,\n imguiRendererExtensionProtocolName\n ]);\n return PromiseSt$Meta3dCommonlib.map(PromiseSt$Meta3dCommonlib.map(_exec(meta3dState$2, state), (function (param) {\n var meta3dState = param[0];\n var state = api.getExtensionState(meta3dState, uiExtensionProtocolName);\n var state$1 = _markAllStateNotChange(state, param[1]);\n return api.setExtensionState(meta3dState, uiExtensionProtocolName, state$1);\n })), (function (meta3dState) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n Curry._1(imguiRendererService.afterExec, undefined);\n Curry._1(imguiRendererService.render, undefined);\n return imguiRendererState;\n }), [\n api,\n imguiRendererExtensionProtocolName\n ]);\n }));\n}\n\nfunction _setElementFunc(state, elementName, elementFunc) {\n return {\n elementFuncMap: ImmutableHashMap$Meta3dCommonlib.set(state.elementFuncMap, elementName, elementFunc),\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction registerElement(state, param) {\n var elementName = param.elementName;\n return _markStateChange(show(_setElementExecOrder(_setElementState(_setElementFunc(_setCurrentElementName(state, elementName), elementName, param.elementFunc), elementName, param.elementState), elementName, param.execOrder), elementName), elementName);\n}\n\nfunction registerSkin(state, skinContribute) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: ImmutableHashMap$Meta3dCommonlib.set(state.skinContributeMap, skinContribute.skinName, skinContribute),\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction registerUIControl(state, uiControlContribute) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: ImmutableHashMap$Meta3dCommonlib.set(state.uiControlContributeMap, uiControlContribute.uiControlName, uiControlContribute),\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction getSkin(state, skinName) {\n return ImmutableHashMap$Meta3dCommonlib.getNullable(state.skinContributeMap, skinName);\n}\n\nfunction _getUIControlExn(state, uiControlName) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(state.uiControlContributeMap, uiControlName);\n}\n\nfunction getUIControlFuncExn(state, uiControlName) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(state.uiControlContributeMap, uiControlName).func;\n}\n\nfunction getUIControlState(state, uiControlName) {\n return ImmutableHashMap$Meta3dCommonlib.getNullable(state.uiControlStateMap, uiControlName);\n}\n\nfunction setUIControlState(state, uiControlName, uiControlState) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: ImmutableHashMap$Meta3dCommonlib.set(state.uiControlStateMap, uiControlName, uiControlState),\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction isStateChange(state, elementName) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(state.isStateChangeMap, elementName);\n}\n\nfunction setStyle(meta3dState, data, style) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return imguiRendererService.setStyle(imguiRendererState, style);\n }), data);\n}\n\nfunction beginWindow(meta3dState, data, label) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.beginWindow(label);\n return imguiRendererState;\n }), data);\n}\n\nfunction endWindow(meta3dState, data) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n Curry._1(imguiRendererService.endWindow, undefined);\n return imguiRendererState;\n }), data);\n}\n\nfunction beginChild(meta3dState, data, label) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.beginChild(label);\n return imguiRendererState;\n }), data);\n}\n\nfunction endChild(meta3dState, data) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n Curry._1(imguiRendererService.endChild, undefined);\n return imguiRendererState;\n }), data);\n}\n\nfunction setNextWindowRect(meta3dState, data, rect) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.setNextWindowRect(rect);\n return imguiRendererState;\n }), data);\n}\n\nfunction getFBOTexture(state, textureID) {\n return ImmutableHashMap$Meta3dCommonlib.getNullable(state.fboTextureMap, textureID);\n}\n\nfunction setFBOTexture(state, textureID, texture) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n currentElementName: state.currentElementName,\n fboTextureMap: ImmutableHashMap$Meta3dCommonlib.set(state.fboTextureMap, textureID, texture)\n };\n}\n\nfunction addFBOTexture(meta3dState, data, texture, rect) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.addFBOTexture(texture, rect);\n return imguiRendererState;\n }), data);\n}\n\nfunction getWindowBarHeight(meta3dState, data) {\n return _invokeIMGUIRenderFuncReturnData(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return Curry._1(imguiRendererService.getWindowBarHeight, undefined);\n }), data);\n}\n\nfunction getContext(meta3dState, data) {\n return _invokeIMGUIRenderFuncReturnData(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return Curry._1(imguiRendererService.getContext, undefined);\n }), data);\n}\n\nfunction button(meta3dState, data, label, size) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.button(label, size)\n ];\n }), data);\n}\n\nfunction setCursorPos(meta3dState, data, pos) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.setCursorPos(pos);\n return imguiRendererState;\n }), data);\n}\n\nfunction loadImage(data, meta3dState, imageBase64Src) {\n return _invokeIMGUIRenderFuncReturnData(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return imguiRendererService.loadImage(imageBase64Src);\n }), data);\n}\n\nfunction asset(data, meta3dState, textures, glbs, label, rect) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.asset(textures, glbs, label, rect)\n ];\n }), data);\n}\n\nfunction handleDragDropTarget(data, meta3dState, type_) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.handleDragDropTarget(type_)\n ];\n }), data);\n}\n\nfunction menu(data, meta3dState, allLabels, windowName, rect) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.menu(allLabels, windowName, rect)\n ];\n }), data);\n}\n\nfunction sceneTree(data, meta3dState, sceneTreeData, lastSceneTreeSelectedData, textures, windowName, rect) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.sceneTree(sceneTreeData, lastSceneTreeSelectedData, textures, windowName, rect)\n ];\n }), data);\n}\n\nfunction inspector(data, meta3dState, gameObjectName, localPosition, localEulerAngles, localScale, windowName, rect) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.inspector(gameObjectName, localPosition, localEulerAngles, localScale, windowName, rect)\n ];\n }), data);\n}\n\nfunction runStopButton(data, meta3dState, isRun, textures, size) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.runStopButton(isRun, textures, size)\n ];\n }), data);\n}\n\nfunction clear(meta3dState, data, clearColor) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.clear(clearColor);\n return imguiRendererState;\n }), data);\n}\n\nfunction _getCurrentElementStateOption(state) {\n return OptionSt$Meta3dCommonlib.bind(state.currentElementName, (function (currentElementName) {\n return ImmutableHashMap$Meta3dCommonlib.get(state.elementStateMap, currentElementName);\n }));\n}\n\nfunction getCurrentElementState(state) {\n return getElementState(state, OptionSt$Meta3dCommonlib.getExn(state.currentElementName));\n}\n\nfunction setCurrentElementState(state, currentElementState) {\n return _setElementState(state, OptionSt$Meta3dCommonlib.getExn(state.currentElementName), currentElementState);\n}\n\nfunction init(meta3dState, param, isInitEvent, isDebug, canvas) {\n var imguiRendererExtensionProtocolName = param[1];\n var api = param[0];\n var uiExtensionProtocolName = \"meta3d-ui-protocol\";\n var uiState = api.getExtensionState(meta3dState, uiExtensionProtocolName);\n var elementState = _getCurrentElementStateOption(uiState);\n var meta3dState$1;\n if (elementState !== undefined) {\n var eventExtensionProtocolName = \"meta3d-event-protocol\";\n var eventService = api.getExtensionService(meta3dState, eventExtensionProtocolName);\n var eventState = api.getExtensionState(meta3dState, eventExtensionProtocolName);\n var elementState$1 = ArraySt$Meta3dCommonlib.reduceOneParam(Curry._1(eventService.getAllActionContributes, eventState), (function (elementState, param) {\n return ImmutableHashMap$Meta3dCommonlib.set(elementState, param[0], Curry._1(param[1].createState, undefined));\n }), Caml_option.valFromOption(elementState));\n var uiState$1 = setCurrentElementState(uiState, elementState$1);\n meta3dState$1 = api.setExtensionState(meta3dState, uiExtensionProtocolName, uiState$1);\n } else {\n meta3dState$1 = meta3dState;\n }\n var imguiRendererState = api.getExtensionState(meta3dState$1, imguiRendererExtensionProtocolName);\n var imguiRendererService = api.getExtensionService(meta3dState$1, imguiRendererExtensionProtocolName);\n return PromiseSt$Meta3dCommonlib.map(imguiRendererService.init(imguiRendererState, isInitEvent, isDebug, canvas), (function (imguiRendererState) {\n return api.setExtensionState(meta3dState$1, imguiRendererExtensionProtocolName, imguiRendererState);\n }));\n}\n\nfunction restore(api, currentMeta3dState, targetMeta3dState) {\n var eventExtensionProtocolName = \"meta3d-event-protocol\";\n var uiExtensionProtocolName = \"meta3d-ui-protocol\";\n var eventService = api.getExtensionService(targetMeta3dState, eventExtensionProtocolName);\n var eventState = api.getExtensionState(targetMeta3dState, eventExtensionProtocolName);\n var currentUIState = api.getExtensionState(currentMeta3dState, uiExtensionProtocolName);\n var currentElementState = NullableSt$Meta3dCommonlib.getExn(getElementState(currentUIState, OptionSt$Meta3dCommonlib.getExn(currentUIState.currentElementName)));\n var targetUIState = api.getExtensionState(targetMeta3dState, uiExtensionProtocolName);\n var targetElementState = ArraySt$Meta3dCommonlib.reduceOneParam(Curry._1(eventService.getAllActionContributes, eventState), (function (targetElementState, param) {\n var actionName = param[0];\n return NullableSt$Meta3dCommonlib.getWithDefault(NullableSt$Meta3dCommonlib.map(param[1].restore, (function (restore) {\n return ImmutableHashMap$Meta3dCommonlib.set(targetElementState, actionName, Curry._2(restore, ImmutableHashMap$Meta3dCommonlib.getExn(currentElementState, actionName), ImmutableHashMap$Meta3dCommonlib.getExn(targetElementState, actionName)));\n })), targetElementState);\n }), NullableSt$Meta3dCommonlib.getExn(getElementState(targetUIState, OptionSt$Meta3dCommonlib.getExn(targetUIState.currentElementName))));\n var targetUIState$1 = setCurrentElementState(targetUIState, targetElementState);\n return api.setExtensionState(targetMeta3dState, uiExtensionProtocolName, targetUIState$1);\n}\n\nfunction deepCopy(api, meta3dState) {\n var eventExtensionProtocolName = \"meta3d-event-protocol\";\n var uiExtensionProtocolName = \"meta3d-ui-protocol\";\n var eventService = api.getExtensionService(meta3dState, eventExtensionProtocolName);\n var eventState = api.getExtensionState(meta3dState, eventExtensionProtocolName);\n var uiState = api.getExtensionState(meta3dState, uiExtensionProtocolName);\n var elementState = ArraySt$Meta3dCommonlib.reduceOneParam(Curry._1(eventService.getAllActionContributes, eventState), (function (elementState, param) {\n var actionName = param[0];\n return NullableSt$Meta3dCommonlib.getWithDefault(NullableSt$Meta3dCommonlib.map(param[1].deepCopy, (function (deepCopy) {\n return ImmutableHashMap$Meta3dCommonlib.set(elementState, actionName, Curry._1(deepCopy, ImmutableHashMap$Meta3dCommonlib.getExn(elementState, actionName)));\n })), elementState);\n }), NullableSt$Meta3dCommonlib.getExn(getElementState(uiState, OptionSt$Meta3dCommonlib.getExn(uiState.currentElementName))));\n var uiState$1 = setCurrentElementState(uiState, elementState);\n return api.setExtensionState(meta3dState, uiExtensionProtocolName, uiState$1);\n}\n\nexports.hide = hide;\nexports.show = show;\nexports._markStateChange = _markStateChange;\nexports._markStateNotChange = _markStateNotChange;\nexports._markAllStateNotChange = _markAllStateNotChange;\nexports._getElementStateExn = _getElementStateExn;\nexports.getElementState = getElementState;\nexports._setElementState = _setElementState;\nexports._getElementExecOrderExn = _getElementExecOrderExn;\nexports._setElementExecOrder = _setElementExecOrder;\nexports._getCurrentElementName = _getCurrentElementName;\nexports._setCurrentElementName = _setCurrentElementName;\nexports.updateElementState = updateElementState;\nexports._exec = _exec;\nexports._invokeIMGUIRenderFunc = _invokeIMGUIRenderFunc;\nexports._invokeIMGUIRenderFuncWithParam = _invokeIMGUIRenderFuncWithParam;\nexports._invokeIMGUIRenderFuncReturnData = _invokeIMGUIRenderFuncReturnData;\nexports.render = render;\nexports._setElementFunc = _setElementFunc;\nexports.registerElement = registerElement;\nexports.registerSkin = registerSkin;\nexports.registerUIControl = registerUIControl;\nexports.getSkin = getSkin;\nexports._getUIControlExn = _getUIControlExn;\nexports.getUIControlFuncExn = getUIControlFuncExn;\nexports.getUIControlState = getUIControlState;\nexports.setUIControlState = setUIControlState;\nexports.isStateChange = isStateChange;\nexports.setStyle = setStyle;\nexports.beginWindow = beginWindow;\nexports.endWindow = endWindow;\nexports.beginChild = beginChild;\nexports.endChild = endChild;\nexports.setNextWindowRect = setNextWindowRect;\nexports.getFBOTexture = getFBOTexture;\nexports.setFBOTexture = setFBOTexture;\nexports.addFBOTexture = addFBOTexture;\nexports.getWindowBarHeight = getWindowBarHeight;\nexports.getContext = getContext;\nexports.button = button;\nexports.setCursorPos = setCursorPos;\nexports.loadImage = loadImage;\nexports.asset = asset;\nexports.handleDragDropTarget = handleDragDropTarget;\nexports.menu = menu;\nexports.sceneTree = sceneTree;\nexports.inspector = inspector;\nexports.runStopButton = runStopButton;\nexports.clear = clear;\nexports._getCurrentElementStateOption = _getCurrentElementStateOption;\nexports.getCurrentElementState = getCurrentElementState;\nexports.setCurrentElementState = setCurrentElementState;\nexports.init = init;\nexports.restore = restore;\nexports.deepCopy = deepCopy;\n/* No side effect */\n\n\n//# sourceURL=webpack://Extension/./lib/js/src/UIManager.bs.js?"); +eval("\n\nvar Curry = __webpack_require__(/*! rescript/lib/js/curry.js */ \"../../../../../node_modules/rescript/lib/js/curry.js\");\nvar Caml_obj = __webpack_require__(/*! rescript/lib/js/caml_obj.js */ \"../../../../../node_modules/rescript/lib/js/caml_obj.js\");\nvar Js_array = __webpack_require__(/*! rescript/lib/js/js_array.js */ \"../../../../../node_modules/rescript/lib/js/js_array.js\");\nvar Caml_option = __webpack_require__(/*! rescript/lib/js/caml_option.js */ \"../../../../../node_modules/rescript/lib/js/caml_option.js\");\nvar ArraySt$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/ArraySt.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/ArraySt.bs.js\");\nvar OptionSt$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/OptionSt.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/OptionSt.bs.js\");\nvar PromiseSt$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/PromiseSt.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/PromiseSt.bs.js\");\nvar NullableSt$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/NullableSt.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/NullableSt.bs.js\");\nvar ImmutableHashMap$Meta3dCommonlib = __webpack_require__(/*! meta3d-commonlib/lib/js/src/structure/hash_map/ImmutableHashMap.bs.js */ \"../../../../../defaults/meta3d-commonlib/lib/js/src/structure/hash_map/ImmutableHashMap.bs.js\");\n\nfunction hide(state, elementName) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: ImmutableHashMap$Meta3dCommonlib.set(state.isShowMap, elementName, false),\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction show(state, elementName) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: ImmutableHashMap$Meta3dCommonlib.set(state.isShowMap, elementName, true),\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction _markStateChange(state, elementName) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: ImmutableHashMap$Meta3dCommonlib.set(state.isStateChangeMap, elementName, true),\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction _markStateNotChange(state, elementName) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: ImmutableHashMap$Meta3dCommonlib.set(state.isStateChangeMap, elementName, false),\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction _markAllStateNotChange(state, needMarkStateNotChangeIds) {\n return ArraySt$Meta3dCommonlib.reduceOneParam(needMarkStateNotChangeIds, _markStateNotChange, state);\n}\n\nfunction _getElementStateExn(param, elementName) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(param.elementStateMap, elementName);\n}\n\nfunction getElementState(param, elementName) {\n return ImmutableHashMap$Meta3dCommonlib.getNullable(param.elementStateMap, elementName);\n}\n\nfunction _setElementState(state, elementName, elementState) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: ImmutableHashMap$Meta3dCommonlib.set(state.elementStateMap, elementName, elementState),\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction _getElementExecOrderExn(state, elementName) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(state.elementExecOrderMap, elementName);\n}\n\nfunction _setElementExecOrder(state, elementName, execOrder) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: ImmutableHashMap$Meta3dCommonlib.set(state.elementExecOrderMap, elementName, execOrder),\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction _getCurrentElementName(state) {\n return OptionSt$Meta3dCommonlib.getExn(state.currentElementName);\n}\n\nfunction _setCurrentElementName(state, elementName) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: elementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction updateElementState(state, updateElementStateFunc) {\n var elementName = OptionSt$Meta3dCommonlib.getExn(state.currentElementName);\n var oldElementState = _getElementStateExn(state, elementName);\n var newElementState = Curry._1(updateElementStateFunc, oldElementState);\n if (Caml_obj.notequal(oldElementState, newElementState)) {\n return _setElementState(_markStateChange(state, elementName), elementName, newElementState);\n } else {\n return _markStateNotChange(state, elementName);\n }\n}\n\nfunction _exec(meta3dState, state) {\n var elementFuncMap = state.elementFuncMap;\n var __x = ImmutableHashMap$Meta3dCommonlib.entries(state.isShowMap);\n return ArraySt$Meta3dCommonlib.traverseReducePromiseM(Js_array.sortInPlaceWith((function (param, param$1) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(state.elementExecOrderMap, param[0]) - ImmutableHashMap$Meta3dCommonlib.getExn(state.elementExecOrderMap, param$1[0]) | 0;\n }), __x), (function (param, param$1) {\n var needMarkStateNotChangeIds = param[1];\n var meta3dState = param[0];\n if (!param$1[1]) {\n return Promise.resolve([\n meta3dState,\n needMarkStateNotChangeIds\n ]);\n }\n var elementName = param$1[0];\n var elementFunc = ImmutableHashMap$Meta3dCommonlib.getExn(elementFuncMap, elementName);\n return PromiseSt$Meta3dCommonlib.map(elementFunc(meta3dState, _getElementStateExn(state, elementName)), (function (meta3dState) {\n return [\n meta3dState,\n ArraySt$Meta3dCommonlib.push(needMarkStateNotChangeIds, elementName)\n ];\n }));\n }), [\n meta3dState,\n []\n ]);\n}\n\nfunction _invokeIMGUIRenderFunc(meta3dState, invokeFunc, param) {\n var imguiRendererExtensionProtocolName = param[1];\n var api = param[0];\n var imguiRendererState = api.getExtensionState(meta3dState, imguiRendererExtensionProtocolName);\n var imguiRendererService = api.getExtensionService(meta3dState, imguiRendererExtensionProtocolName);\n var imguiRendererState$1 = invokeFunc(imguiRendererState, imguiRendererService);\n return api.setExtensionState(meta3dState, imguiRendererExtensionProtocolName, imguiRendererState$1);\n}\n\nfunction _invokeIMGUIRenderFuncWithParam(meta3dState, invokeFunc, param) {\n var imguiRendererExtensionProtocolName = param[1];\n var api = param[0];\n var imguiRendererState = api.getExtensionState(meta3dState, imguiRendererExtensionProtocolName);\n var imguiRendererService = api.getExtensionService(meta3dState, imguiRendererExtensionProtocolName);\n var match = invokeFunc(imguiRendererState, imguiRendererService);\n var meta3dState$1 = api.setExtensionState(meta3dState, imguiRendererExtensionProtocolName, match[0]);\n return [\n meta3dState$1,\n match[1]\n ];\n}\n\nfunction _invokeIMGUIRenderFuncReturnData(meta3dState, invokeFunc, param) {\n var imguiRendererExtensionProtocolName = param[1];\n var api = param[0];\n var imguiRendererState = api.getExtensionState(meta3dState, imguiRendererExtensionProtocolName);\n var imguiRendererService = api.getExtensionService(meta3dState, imguiRendererExtensionProtocolName);\n return invokeFunc(imguiRendererState, imguiRendererService);\n}\n\nfunction render(api, meta3dState, param, time) {\n var imguiRendererExtensionProtocolName = param[1];\n var uiExtensionProtocolName = param[0];\n var state = api.getExtensionState(meta3dState, uiExtensionProtocolName);\n var meta3dState$1 = api.setExtensionState(meta3dState, uiExtensionProtocolName, state);\n var meta3dState$2 = _invokeIMGUIRenderFunc(meta3dState$1, (function (imguiRendererState, imguiRendererService) {\n return imguiRendererService.beforeExec(imguiRendererState, time);\n }), [\n api,\n imguiRendererExtensionProtocolName\n ]);\n return PromiseSt$Meta3dCommonlib.map(PromiseSt$Meta3dCommonlib.map(_exec(meta3dState$2, state), (function (param) {\n var meta3dState = param[0];\n var state = api.getExtensionState(meta3dState, uiExtensionProtocolName);\n var state$1 = _markAllStateNotChange(state, param[1]);\n return api.setExtensionState(meta3dState, uiExtensionProtocolName, state$1);\n })), (function (meta3dState) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n Curry._1(imguiRendererService.afterExec, undefined);\n Curry._1(imguiRendererService.render, undefined);\n return imguiRendererState;\n }), [\n api,\n imguiRendererExtensionProtocolName\n ]);\n }));\n}\n\nfunction _setElementFunc(state, elementName, elementFunc) {\n return {\n elementFuncMap: ImmutableHashMap$Meta3dCommonlib.set(state.elementFuncMap, elementName, elementFunc),\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction registerElement(state, param) {\n var elementName = param.elementName;\n return _markStateChange(show(_setElementExecOrder(_setElementState(_setElementFunc(_setCurrentElementName(state, elementName), elementName, param.elementFunc), elementName, param.elementState), elementName, param.execOrder), elementName), elementName);\n}\n\nfunction registerSkin(state, skinContribute) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: ImmutableHashMap$Meta3dCommonlib.set(state.skinContributeMap, skinContribute.skinName, skinContribute),\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction registerUIControl(state, uiControlContribute) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: ImmutableHashMap$Meta3dCommonlib.set(state.uiControlContributeMap, uiControlContribute.uiControlName, uiControlContribute),\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction registerInput(state, inputContribute) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: ImmutableHashMap$Meta3dCommonlib.set(state.inputContributeMap, inputContribute.inputName, inputContribute),\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction getSkin(state, skinName) {\n return ImmutableHashMap$Meta3dCommonlib.getNullable(state.skinContributeMap, skinName);\n}\n\nfunction _getUIControlExn(state, uiControlName) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(state.uiControlContributeMap, uiControlName);\n}\n\nfunction getUIControlFuncExn(state, uiControlName) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(state.uiControlContributeMap, uiControlName).func;\n}\n\nfunction getInputFunc(state, inputName) {\n return NullableSt$Meta3dCommonlib.map(ImmutableHashMap$Meta3dCommonlib.getNullable(state.inputContributeMap, inputName), (function (param) {\n return param.func;\n }));\n}\n\nfunction getUIControlState(state, uiControlName) {\n return ImmutableHashMap$Meta3dCommonlib.getNullable(state.uiControlStateMap, uiControlName);\n}\n\nfunction setUIControlState(state, uiControlName, uiControlState) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: ImmutableHashMap$Meta3dCommonlib.set(state.uiControlStateMap, uiControlName, uiControlState),\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: state.fboTextureMap\n };\n}\n\nfunction isStateChange(state, elementName) {\n return ImmutableHashMap$Meta3dCommonlib.getExn(state.isStateChangeMap, elementName);\n}\n\nfunction setStyle(meta3dState, data, style) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return imguiRendererService.setStyle(imguiRendererState, style);\n }), data);\n}\n\nfunction beginWindow(meta3dState, data, label) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.beginWindow(label);\n return imguiRendererState;\n }), data);\n}\n\nfunction endWindow(meta3dState, data) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n Curry._1(imguiRendererService.endWindow, undefined);\n return imguiRendererState;\n }), data);\n}\n\nfunction beginChild(meta3dState, data, label) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.beginChild(label);\n return imguiRendererState;\n }), data);\n}\n\nfunction endChild(meta3dState, data) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n Curry._1(imguiRendererService.endChild, undefined);\n return imguiRendererState;\n }), data);\n}\n\nfunction setNextWindowRect(meta3dState, data, rect) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.setNextWindowRect(rect);\n return imguiRendererState;\n }), data);\n}\n\nfunction getFBOTexture(state, textureID) {\n return ImmutableHashMap$Meta3dCommonlib.getNullable(state.fboTextureMap, textureID);\n}\n\nfunction setFBOTexture(state, textureID, texture) {\n return {\n elementFuncMap: state.elementFuncMap,\n elementStateMap: state.elementStateMap,\n elementExecOrderMap: state.elementExecOrderMap,\n isShowMap: state.isShowMap,\n isStateChangeMap: state.isStateChangeMap,\n skinContributeMap: state.skinContributeMap,\n uiControlContributeMap: state.uiControlContributeMap,\n uiControlStateMap: state.uiControlStateMap,\n inputContributeMap: state.inputContributeMap,\n currentElementName: state.currentElementName,\n fboTextureMap: ImmutableHashMap$Meta3dCommonlib.set(state.fboTextureMap, textureID, texture)\n };\n}\n\nfunction addFBOTexture(meta3dState, data, texture, rect) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.addFBOTexture(texture, rect);\n return imguiRendererState;\n }), data);\n}\n\nfunction getWindowBarHeight(meta3dState, data) {\n return _invokeIMGUIRenderFuncReturnData(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return Curry._1(imguiRendererService.getWindowBarHeight, undefined);\n }), data);\n}\n\nfunction getContext(meta3dState, data) {\n return _invokeIMGUIRenderFuncReturnData(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return Curry._1(imguiRendererService.getContext, undefined);\n }), data);\n}\n\nfunction button(meta3dState, data, label, size) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.button(label, size)\n ];\n }), data);\n}\n\nfunction setCursorPos(meta3dState, data, pos) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.setCursorPos(pos);\n return imguiRendererState;\n }), data);\n}\n\nfunction loadImage(data, meta3dState, imageBase64Src) {\n return _invokeIMGUIRenderFuncReturnData(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return imguiRendererService.loadImage(imageBase64Src);\n }), data);\n}\n\nfunction asset(data, meta3dState, textures, glbs, label, rect) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.asset(textures, glbs, label, rect)\n ];\n }), data);\n}\n\nfunction handleDragDropTarget(data, meta3dState, type_) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.handleDragDropTarget(type_)\n ];\n }), data);\n}\n\nfunction menu(data, meta3dState, allLabels, windowName, rect) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.menu(allLabels, windowName, rect)\n ];\n }), data);\n}\n\nfunction sceneTree(data, meta3dState, sceneTreeData, lastSceneTreeSelectedData, textures, windowName, rect) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.sceneTree(sceneTreeData, lastSceneTreeSelectedData, textures, windowName, rect)\n ];\n }), data);\n}\n\nfunction inspector(data, meta3dState, gameObjectName, localPosition, localEulerAngles, localScale, windowName, rect) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.inspector(gameObjectName, localPosition, localEulerAngles, localScale, windowName, rect)\n ];\n }), data);\n}\n\nfunction runStopButton(data, meta3dState, isRun, textures, size) {\n return _invokeIMGUIRenderFuncWithParam(meta3dState, (function (imguiRendererState, imguiRendererService) {\n return [\n imguiRendererState,\n imguiRendererService.runStopButton(isRun, textures, size)\n ];\n }), data);\n}\n\nfunction clear(meta3dState, data, clearColor) {\n return _invokeIMGUIRenderFunc(meta3dState, (function (imguiRendererState, imguiRendererService) {\n imguiRendererService.clear(clearColor);\n return imguiRendererState;\n }), data);\n}\n\nfunction _getCurrentElementStateOption(state) {\n return OptionSt$Meta3dCommonlib.bind(state.currentElementName, (function (currentElementName) {\n return ImmutableHashMap$Meta3dCommonlib.get(state.elementStateMap, currentElementName);\n }));\n}\n\nfunction getCurrentElementState(state) {\n return getElementState(state, OptionSt$Meta3dCommonlib.getExn(state.currentElementName));\n}\n\nfunction setCurrentElementState(state, currentElementState) {\n return _setElementState(state, OptionSt$Meta3dCommonlib.getExn(state.currentElementName), currentElementState);\n}\n\nfunction init(meta3dState, param, isInitEvent, isDebug, canvas) {\n var imguiRendererExtensionProtocolName = param[1];\n var api = param[0];\n var uiExtensionProtocolName = \"meta3d-ui-protocol\";\n var uiState = api.getExtensionState(meta3dState, uiExtensionProtocolName);\n var elementState = _getCurrentElementStateOption(uiState);\n var meta3dState$1;\n if (elementState !== undefined) {\n var eventExtensionProtocolName = \"meta3d-event-protocol\";\n var eventService = api.getExtensionService(meta3dState, eventExtensionProtocolName);\n var eventState = api.getExtensionState(meta3dState, eventExtensionProtocolName);\n var elementState$1 = ArraySt$Meta3dCommonlib.reduceOneParam(Curry._1(eventService.getAllActionContributes, eventState), (function (elementState, param) {\n return ImmutableHashMap$Meta3dCommonlib.set(elementState, param[0], Curry._1(param[1].createState, undefined));\n }), Caml_option.valFromOption(elementState));\n var uiState$1 = setCurrentElementState(uiState, elementState$1);\n meta3dState$1 = api.setExtensionState(meta3dState, uiExtensionProtocolName, uiState$1);\n } else {\n meta3dState$1 = meta3dState;\n }\n var imguiRendererState = api.getExtensionState(meta3dState$1, imguiRendererExtensionProtocolName);\n var imguiRendererService = api.getExtensionService(meta3dState$1, imguiRendererExtensionProtocolName);\n return PromiseSt$Meta3dCommonlib.map(imguiRendererService.init(imguiRendererState, isInitEvent, isDebug, canvas), (function (imguiRendererState) {\n return api.setExtensionState(meta3dState$1, imguiRendererExtensionProtocolName, imguiRendererState);\n }));\n}\n\nfunction restore(api, currentMeta3dState, targetMeta3dState) {\n var eventExtensionProtocolName = \"meta3d-event-protocol\";\n var uiExtensionProtocolName = \"meta3d-ui-protocol\";\n var eventService = api.getExtensionService(targetMeta3dState, eventExtensionProtocolName);\n var eventState = api.getExtensionState(targetMeta3dState, eventExtensionProtocolName);\n var currentUIState = api.getExtensionState(currentMeta3dState, uiExtensionProtocolName);\n var currentElementState = NullableSt$Meta3dCommonlib.getExn(getElementState(currentUIState, OptionSt$Meta3dCommonlib.getExn(currentUIState.currentElementName)));\n var targetUIState = api.getExtensionState(targetMeta3dState, uiExtensionProtocolName);\n var targetElementState = ArraySt$Meta3dCommonlib.reduceOneParam(Curry._1(eventService.getAllActionContributes, eventState), (function (targetElementState, param) {\n var actionName = param[0];\n return NullableSt$Meta3dCommonlib.getWithDefault(NullableSt$Meta3dCommonlib.map(param[1].restore, (function (restore) {\n return ImmutableHashMap$Meta3dCommonlib.set(targetElementState, actionName, Curry._2(restore, ImmutableHashMap$Meta3dCommonlib.getExn(currentElementState, actionName), ImmutableHashMap$Meta3dCommonlib.getExn(targetElementState, actionName)));\n })), targetElementState);\n }), NullableSt$Meta3dCommonlib.getExn(getElementState(targetUIState, OptionSt$Meta3dCommonlib.getExn(targetUIState.currentElementName))));\n var targetUIState$1 = setCurrentElementState(targetUIState, targetElementState);\n return api.setExtensionState(targetMeta3dState, uiExtensionProtocolName, targetUIState$1);\n}\n\nfunction deepCopy(api, meta3dState) {\n var eventExtensionProtocolName = \"meta3d-event-protocol\";\n var uiExtensionProtocolName = \"meta3d-ui-protocol\";\n var eventService = api.getExtensionService(meta3dState, eventExtensionProtocolName);\n var eventState = api.getExtensionState(meta3dState, eventExtensionProtocolName);\n var uiState = api.getExtensionState(meta3dState, uiExtensionProtocolName);\n var elementState = ArraySt$Meta3dCommonlib.reduceOneParam(Curry._1(eventService.getAllActionContributes, eventState), (function (elementState, param) {\n var actionName = param[0];\n return NullableSt$Meta3dCommonlib.getWithDefault(NullableSt$Meta3dCommonlib.map(param[1].deepCopy, (function (deepCopy) {\n return ImmutableHashMap$Meta3dCommonlib.set(elementState, actionName, Curry._1(deepCopy, ImmutableHashMap$Meta3dCommonlib.getExn(elementState, actionName)));\n })), elementState);\n }), NullableSt$Meta3dCommonlib.getExn(getElementState(uiState, OptionSt$Meta3dCommonlib.getExn(uiState.currentElementName))));\n var uiState$1 = setCurrentElementState(uiState, elementState);\n return api.setExtensionState(meta3dState, uiExtensionProtocolName, uiState$1);\n}\n\nexports.hide = hide;\nexports.show = show;\nexports._markStateChange = _markStateChange;\nexports._markStateNotChange = _markStateNotChange;\nexports._markAllStateNotChange = _markAllStateNotChange;\nexports._getElementStateExn = _getElementStateExn;\nexports.getElementState = getElementState;\nexports._setElementState = _setElementState;\nexports._getElementExecOrderExn = _getElementExecOrderExn;\nexports._setElementExecOrder = _setElementExecOrder;\nexports._getCurrentElementName = _getCurrentElementName;\nexports._setCurrentElementName = _setCurrentElementName;\nexports.updateElementState = updateElementState;\nexports._exec = _exec;\nexports._invokeIMGUIRenderFunc = _invokeIMGUIRenderFunc;\nexports._invokeIMGUIRenderFuncWithParam = _invokeIMGUIRenderFuncWithParam;\nexports._invokeIMGUIRenderFuncReturnData = _invokeIMGUIRenderFuncReturnData;\nexports.render = render;\nexports._setElementFunc = _setElementFunc;\nexports.registerElement = registerElement;\nexports.registerSkin = registerSkin;\nexports.registerUIControl = registerUIControl;\nexports.registerInput = registerInput;\nexports.getSkin = getSkin;\nexports._getUIControlExn = _getUIControlExn;\nexports.getUIControlFuncExn = getUIControlFuncExn;\nexports.getInputFunc = getInputFunc;\nexports.getUIControlState = getUIControlState;\nexports.setUIControlState = setUIControlState;\nexports.isStateChange = isStateChange;\nexports.setStyle = setStyle;\nexports.beginWindow = beginWindow;\nexports.endWindow = endWindow;\nexports.beginChild = beginChild;\nexports.endChild = endChild;\nexports.setNextWindowRect = setNextWindowRect;\nexports.getFBOTexture = getFBOTexture;\nexports.setFBOTexture = setFBOTexture;\nexports.addFBOTexture = addFBOTexture;\nexports.getWindowBarHeight = getWindowBarHeight;\nexports.getContext = getContext;\nexports.button = button;\nexports.setCursorPos = setCursorPos;\nexports.loadImage = loadImage;\nexports.asset = asset;\nexports.handleDragDropTarget = handleDragDropTarget;\nexports.menu = menu;\nexports.sceneTree = sceneTree;\nexports.inspector = inspector;\nexports.runStopButton = runStopButton;\nexports.clear = clear;\nexports._getCurrentElementStateOption = _getCurrentElementStateOption;\nexports.getCurrentElementState = getCurrentElementState;\nexports.setCurrentElementState = setCurrentElementState;\nexports.init = init;\nexports.restore = restore;\nexports.deepCopy = deepCopy;\n/* No side effect */\n\n\n//# sourceURL=webpack://Extension/./lib/js/src/UIManager.bs.js?"); /***/ }) diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/src/Main.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/src/Main.bs.js old mode 100755 new mode 100644 index 395de439b..b9f5d0dff --- a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/src/Main.bs.js +++ b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/src/Main.bs.js @@ -43,6 +43,9 @@ function getExtensionService(api) { registerUIControl: (function (meta3dState, uiControlContribute) { return api.setExtensionState(meta3dState, "meta3d-ui-protocol", UIManager$Meta3dUi.registerUIControl(api.getExtensionState(meta3dState, "meta3d-ui-protocol"), uiControlContribute)); }), + registerInput: (function (meta3dState, inputContribute) { + return api.setExtensionState(meta3dState, "meta3d-ui-protocol", UIManager$Meta3dUi.registerInput(api.getExtensionState(meta3dState, "meta3d-ui-protocol"), inputContribute)); + }), render: (function (param, param$1, param$2) { return UIManager$Meta3dUi.render(api, param, param$1, param$2); }), @@ -67,6 +70,9 @@ function getExtensionService(api) { getUIControlFunc: (function (meta3dState, uiControlName) { return UIManager$Meta3dUi.getUIControlFuncExn(api.getExtensionState(meta3dState, "meta3d-ui-protocol"), uiControlName); }), + getInputFunc: (function (meta3dState, inputName) { + return UIManager$Meta3dUi.getInputFunc(api.getExtensionState(meta3dState, "meta3d-ui-protocol"), inputName); + }), getUIControlState: (function (meta3dState, uiControlName) { return UIManager$Meta3dUi.getUIControlState(api.getExtensionState(meta3dState, "meta3d-ui-protocol"), uiControlName); }), @@ -187,6 +193,7 @@ function createExtensionState(param) { skinContributeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), uiControlContributeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), uiControlStateMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), + inputContributeMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined), currentElementName: undefined, fboTextureMap: ImmutableHashMap$Meta3dCommonlib.createEmpty(undefined, undefined) }; diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/src/UIManager.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/src/UIManager.bs.js old mode 100755 new mode 100644 index 92d2df24b..aad3c89c5 --- a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/src/UIManager.bs.js +++ b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/src/UIManager.bs.js @@ -20,6 +20,7 @@ function hide(state, elementName) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, currentElementName: state.currentElementName, fboTextureMap: state.fboTextureMap }; @@ -35,6 +36,7 @@ function show(state, elementName) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, currentElementName: state.currentElementName, fboTextureMap: state.fboTextureMap }; @@ -50,6 +52,7 @@ function _markStateChange(state, elementName) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, currentElementName: state.currentElementName, fboTextureMap: state.fboTextureMap }; @@ -65,6 +68,7 @@ function _markStateNotChange(state, elementName) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, currentElementName: state.currentElementName, fboTextureMap: state.fboTextureMap }; @@ -92,6 +96,7 @@ function _setElementState(state, elementName, elementState) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, currentElementName: state.currentElementName, fboTextureMap: state.fboTextureMap }; @@ -111,6 +116,7 @@ function _setElementExecOrder(state, elementName, execOrder) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, currentElementName: state.currentElementName, fboTextureMap: state.fboTextureMap }; @@ -130,6 +136,7 @@ function _setCurrentElementName(state, elementName) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, currentElementName: elementName, fboTextureMap: state.fboTextureMap }; @@ -242,6 +249,7 @@ function _setElementFunc(state, elementName, elementFunc) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, currentElementName: state.currentElementName, fboTextureMap: state.fboTextureMap }; @@ -262,6 +270,7 @@ function registerSkin(state, skinContribute) { skinContributeMap: ImmutableHashMap$Meta3dCommonlib.set(state.skinContributeMap, skinContribute.skinName, skinContribute), uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, currentElementName: state.currentElementName, fboTextureMap: state.fboTextureMap }; @@ -277,6 +286,23 @@ function registerUIControl(state, uiControlContribute) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: ImmutableHashMap$Meta3dCommonlib.set(state.uiControlContributeMap, uiControlContribute.uiControlName, uiControlContribute), uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, + currentElementName: state.currentElementName, + fboTextureMap: state.fboTextureMap + }; +} + +function registerInput(state, inputContribute) { + return { + elementFuncMap: state.elementFuncMap, + elementStateMap: state.elementStateMap, + elementExecOrderMap: state.elementExecOrderMap, + isShowMap: state.isShowMap, + isStateChangeMap: state.isStateChangeMap, + skinContributeMap: state.skinContributeMap, + uiControlContributeMap: state.uiControlContributeMap, + uiControlStateMap: state.uiControlStateMap, + inputContributeMap: ImmutableHashMap$Meta3dCommonlib.set(state.inputContributeMap, inputContribute.inputName, inputContribute), currentElementName: state.currentElementName, fboTextureMap: state.fboTextureMap }; @@ -294,6 +320,12 @@ function getUIControlFuncExn(state, uiControlName) { return ImmutableHashMap$Meta3dCommonlib.getExn(state.uiControlContributeMap, uiControlName).func; } +function getInputFunc(state, inputName) { + return NullableSt$Meta3dCommonlib.map(ImmutableHashMap$Meta3dCommonlib.getNullable(state.inputContributeMap, inputName), (function (param) { + return param.func; + })); +} + function getUIControlState(state, uiControlName) { return ImmutableHashMap$Meta3dCommonlib.getNullable(state.uiControlStateMap, uiControlName); } @@ -308,6 +340,7 @@ function setUIControlState(state, uiControlName, uiControlState) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: ImmutableHashMap$Meta3dCommonlib.set(state.uiControlStateMap, uiControlName, uiControlState), + inputContributeMap: state.inputContributeMap, currentElementName: state.currentElementName, fboTextureMap: state.fboTextureMap }; @@ -372,6 +405,7 @@ function setFBOTexture(state, textureID, texture) { skinContributeMap: state.skinContributeMap, uiControlContributeMap: state.uiControlContributeMap, uiControlStateMap: state.uiControlStateMap, + inputContributeMap: state.inputContributeMap, currentElementName: state.currentElementName, fboTextureMap: ImmutableHashMap$Meta3dCommonlib.set(state.fboTextureMap, textureID, texture) }; @@ -576,9 +610,11 @@ export { registerElement , registerSkin , registerUIControl , + registerInput , getSkin , _getUIControlExn , getUIControlFuncExn , + getInputFunc , getUIControlState , setUIControlState , isStateChange , diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/begin_window.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/begin_window.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/button.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/button.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/clear.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/clear.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/context.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/context.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/custom_control.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/custom_control.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/fbo_texture.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/fbo_texture.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/redo_undo.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/redo_undo.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/render.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/render.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/skin.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/skin.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/update_element_state.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/step-definitions/update_element_state.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/tool/ImguiRendererServiceTool.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/tool/ImguiRendererServiceTool.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/tool/MainTool.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/tool/MainTool.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/tool/SinonTool.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/es6_global/test/tool/SinonTool.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/begin_window.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/begin_window.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/button.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/button.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/clear.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/clear.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/context.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/context.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/custom_control.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/custom_control.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/fbo_texture.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/fbo_texture.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/redo_undo.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/redo_undo.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/render.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/render.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/skin.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/skin.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/update_element_state.steps.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/step-definitions/update_element_state.steps.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/tool/ImguiRendererServiceTool.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/tool/ImguiRendererServiceTool.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/tool/MainTool.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/tool/MainTool.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/tool/SinonTool.bs.js b/packages/editor-whole/ui/extensions/meta3d-ui/lib/js/test/tool/SinonTool.bs.js old mode 100755 new mode 100644 diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/package.json b/packages/editor-whole/ui/extensions/meta3d-ui/package.json index f1e4523cf..07a029bdc 100755 --- a/packages/editor-whole/ui/extensions/meta3d-ui/package.json +++ b/packages/editor-whole/ui/extensions/meta3d-ui/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui", - "version": "0.20.0", + "version": "0.20.3", "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", "displayName": "ui", "protocol": { diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/src/Main.res b/packages/editor-whole/ui/extensions/meta3d-ui/src/Main.res index 4bd6e30e7..e5bcae0b0 100755 --- a/packages/editor-whole/ui/extensions/meta3d-ui/src/Main.res +++ b/packages/editor-whole/ui/extensions/meta3d-ui/src/Main.res @@ -32,6 +32,16 @@ let getExtensionService: Meta3dType.Index.getExtensionService< ), ) }, + registerInput: (meta3dState, inputContribute) => { + api.setExtensionState(. + meta3dState, + "meta3d-ui-protocol", + (UIManager.registerInput->Obj.magic)( + api.getExtensionState(. meta3dState, "meta3d-ui-protocol"), + inputContribute, + ), + ) + }, getSkin: (meta3dState, skinName) => { (UIManager.getSkin->Obj.magic)( api.getExtensionState(. meta3dState, "meta3d-ui-protocol"), @@ -61,6 +71,12 @@ let getExtensionService: Meta3dType.Index.getExtensionService< ), ) }, + getInputFunc: (meta3dState, inputName) => { + (UIManager.getInputFunc->Obj.magic)( + api.getExtensionState(. meta3dState, "meta3d-ui-protocol"), + inputName, + ) + }, hide: (meta3dState, elementName) => { api.setExtensionState(. meta3dState, @@ -186,6 +202,7 @@ let createExtensionState: Meta3dType.Index.createExtensionState< skinContributeMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), uiControlContributeMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), uiControlStateMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), + inputContributeMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), // ioData: None, // reducers: [], currentElementName: None, diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/src/UIManager.res b/packages/editor-whole/ui/extensions/meta3d-ui/src/UIManager.res index 5625173b9..f35d41149 100755 --- a/packages/editor-whole/ui/extensions/meta3d-ui/src/UIManager.res +++ b/packages/editor-whole/ui/extensions/meta3d-ui/src/UIManager.res @@ -377,7 +377,8 @@ let registerSkin = ( let registerUIControl = ( state: Meta3dUiProtocol.StateType.state, uiControlContribute: Meta3dUiProtocol.UIControlContributeType.uiControlContribute< - Meta3dUiProtocol.StateType.inputData, + Meta3dUiProtocol.StateType.inputFunc, + Meta3dUiProtocol.StateType.specificData, Meta3dUiProtocol.StateType.outputData, >, ) => { @@ -390,6 +391,21 @@ let registerUIControl = ( } } +let registerInput = ( + state: Meta3dUiProtocol.StateType.state, + inputContribute: Meta3dUiProtocol.InputContributeType.inputContribute< + Meta3dUiProtocol.StateType.data, + >, +) => { + { + ...state, + inputContributeMap: state.inputContributeMap->Meta3dCommonlib.ImmutableHashMap.set( + inputContribute.inputName, + inputContribute, + ), + } +} + let getSkin = (state: Meta3dUiProtocol.StateType.state, skinName) => { state.skinContributeMap->Meta3dCommonlib.ImmutableHashMap.getNullable(skinName) } @@ -406,6 +422,12 @@ let getUIControlFuncExn = (state: Meta3dUiProtocol.StateType.state, uiControlNam _getUIControlExn(state, uiControlName).func } +let getInputFunc = (state: Meta3dUiProtocol.StateType.state, inputName) => { + state.inputContributeMap + ->Meta3dCommonlib.ImmutableHashMap.getNullable(inputName) + ->Meta3dCommonlib.NullableSt.map((. {func}) => func) +} + // let updateUIControlName = ( // meta3dState, // (api: Meta3dType.Index.api, uiExtensionProtocolName), diff --git a/packages/editor-whole/ui/extensions/meta3d-ui/test/tool/MainTool.res b/packages/editor-whole/ui/extensions/meta3d-ui/test/tool/MainTool.res index f94c52631..2857f1c8a 100755 --- a/packages/editor-whole/ui/extensions/meta3d-ui/test/tool/MainTool.res +++ b/packages/editor-whole/ui/extensions/meta3d-ui/test/tool/MainTool.res @@ -441,7 +441,8 @@ let registerUIControl = ( func, init, }: Meta3dUiProtocol.UIControlContributeType.uiControlContribute< - Meta3dUiProtocol.StateType.inputData, + Meta3dUiProtocol.StateType.inputFunc, + Meta3dUiProtocol.StateType.specificData, Meta3dUiProtocol.StateType.outputData, > ), diff --git a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/lib/es6_global/src/contribute/InputContributeType.bs.js b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/lib/es6_global/src/contribute/InputContributeType.bs.js new file mode 100644 index 000000000..ae1b9f17e --- /dev/null +++ b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/lib/es6_global/src/contribute/InputContributeType.bs.js @@ -0,0 +1 @@ +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/lib/js/src/contribute/InputContributeType.bs.js b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/lib/js/src/contribute/InputContributeType.bs.js new file mode 100644 index 000000000..ae1b9f17e --- /dev/null +++ b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/lib/js/src/contribute/InputContributeType.bs.js @@ -0,0 +1 @@ +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/package.json b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/package.json index ef6608b55..1db8bcf0d 100755 --- a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/package.json +++ b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-protocol", - "version": "0.20.1", + "version": "0.20.2", "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", "displayName": "ui protocol", "author": "Wonder", diff --git a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/InputContributeType.res b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/InputContributeType.res new file mode 100644 index 000000000..3d70bdbff --- /dev/null +++ b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/InputContributeType.res @@ -0,0 +1,8 @@ +type inputName = string + +type inputFunc<'data> = (. Meta3dType.Index.state) => Js.Promise.t<'data> + +type inputContribute<'data> = { + inputName: inputName, + func: inputFunc<'data>, +} diff --git a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/InputContributeType.ts b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/InputContributeType.ts new file mode 100755 index 000000000..1001a295f --- /dev/null +++ b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/InputContributeType.ts @@ -0,0 +1,10 @@ +import type { state as Meta3dType_Index_state } from 'meta3d-type/src/Index'; + +export type inputName = string; + +export type inputFunc = (_1: Meta3dType_Index_state) => Promise; + +export type inputContribute = { + inputName: inputName; + func: inputFunc +}; diff --git a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/UIControlContributeType.res b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/UIControlContributeType.res index 952991d34..ace5c862f 100755 --- a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/UIControlContributeType.res +++ b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/UIControlContributeType.res @@ -1,27 +1,31 @@ type uiControlName = string -type uiControlFunc<'inputData, 'outputData> = ( +// type getInputFunc<'data> = Meta3dType.Index.state => Js.Promise.t<'data> + +type uiControlFunc<'inputFunc, 'specificData, 'outputData> = ( . Meta3dType.Index.state, - 'inputData, + // getInputFunc<'inputFunc>, + 'inputFunc, + 'specificData, ) => Js.Promise.t<(Meta3dType.Index.state, 'outputData)> -// type uiControlContribute<'uiControlState, 'inputData, 'outputData> = { +// type uiControlContribute<'uiControlState, 'specificData, 'outputData> = { // uiControlName: uiControlName, // createStateFunc: unit => 'uiControlState, -// func: uiControlFunc<'inputData, 'outputData>, +// func: uiControlFunc<'specificData, 'outputData>, // } type init = Meta3dType.Index.state => Js.Promise.t -type uiControlContribute<'inputData, 'outputData> = { +type uiControlContribute<'inputFunc, 'specificData, 'outputData> = { uiControlName: uiControlName, - func: uiControlFunc<'inputData, 'outputData>, + func: uiControlFunc<'inputFunc, 'specificData, 'outputData>, init: init, } // type skinName = string -// type getUIControlContribute<'inputData, 'outputData> = skinName => uiControlContribute< -// 'inputData, +// type getUIControlContribute<'specificData, 'outputData> = skinName => uiControlContribute< +// 'specificData, // 'outputData, // > diff --git a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/UIControlContributeType.ts b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/UIControlContributeType.ts index 31d154b34..b5b4feba7 100755 --- a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/UIControlContributeType.ts +++ b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/contribute/UIControlContributeType.ts @@ -3,21 +3,23 @@ import type { state as Meta3dType_Index_state } from 'meta3d-type/src/Index'; // tslint:disable-next-line:interface-over-type-literal export type uiControlName = string; +// type getInputFunc = (_1: Meta3dType_Index_state) => Promise + // tslint:disable-next-line:interface-over-type-literal -export type uiControlFunc = (_1: Meta3dType_Index_state, _2: inputData) => Promise<[Meta3dType_Index_state, outputData]>; +export type uiControlFunc = (_1: Meta3dType_Index_state, _2: inputFunc, _3: specificData) => Promise<[Meta3dType_Index_state, outputData]>; // tslint:disable-next-line:interface-over-type-literal -// export type uiControlContribute = { +// export type uiControlContribute = { // uiControlName: uiControlName; // createStateFunc: () => uiControlState; -// func: uiControlFunc +// func: uiControlFunc // }; export type init = (meta3dState: Meta3dType_Index_state) => Promise -export type uiControlContribute = { +export type uiControlContribute = { uiControlName: uiControlName; - func: uiControlFunc + func: uiControlFunc init: init, }; @@ -26,4 +28,4 @@ export type uiControlContribute = { // export type skinName = string; // // tslint:disable-next-line:interface-over-type-literal -// export type getUIControlContribute = (_1: skinName) => uiControlContribute; +// export type getUIControlContribute = (_1: skinName) => uiControlContribute; diff --git a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/service/ServiceType.res b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/service/ServiceType.res index a06352e20..b6c7f3267 100755 --- a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/service/ServiceType.res +++ b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/service/ServiceType.res @@ -27,7 +27,15 @@ type service = { ) => Meta3dType.Index.state, registerUIControl: ( Meta3dType.Index.state, - UIControlContributeType.uiControlContribute, + UIControlContributeType.uiControlContribute< + StateType.inputFunc, + StateType.specificData, + StateType.outputData, + >, + ) => Meta3dType.Index.state, + registerInput: ( + Meta3dType.Index.state, + InputContributeType.inputContribute, ) => Meta3dType.Index.state, render: ( Meta3dType.Index.state, @@ -54,10 +62,14 @@ type service = { Meta3dType.Index.state, SkinContributeType.skinName, ) => Js.Nullable.t>, - getUIControlFunc: 'inputData 'outputData. ( + getUIControlFunc: 'inputFunc 'specificData 'outputData. ( Meta3dType.Index.state, UIControlContributeType.uiControlName, - ) => UIControlContributeType.uiControlFunc<'inputData, 'outputData>, + ) => UIControlContributeType.uiControlFunc<'inputFunc, 'specificData, 'outputData>, + getInputFunc: 'data. ( + Meta3dType.Index.state, + InputContributeType.inputName, + ) => Js.Nullable.t>, // updateUIControlName: ( // Meta3dType.Index.state, // uiExtensionProtocolName, @@ -166,16 +178,6 @@ type service = { }, Meta3dImguiRendererProtocol.ServiceType.size, ) => (Meta3dType.Index.state, (bool, bool)), - // prepare: ( - // Meta3dType.Index.state, - // array< - // UIControlContributeType.uiControlContribute< - // StateType.uiControlState, - // StateType.inputData, - // StateType.outputData, - // >, - // >, - // ) => Meta3dType.Index.state, init: ( Meta3dType.Index.state, (Meta3dType.Index.api, imguiRendererExtensionProtocolName), @@ -189,5 +191,8 @@ type service = { clearColor, ) => Meta3dType.Index.state, getCurrentElementState: Meta3dType.Index.state => Js.Nullable.t, - setCurrentElementState: (Meta3dType.Index.state, StateType.elementState) => Meta3dType.Index.state, + setCurrentElementState: ( + Meta3dType.Index.state, + StateType.elementState, + ) => Meta3dType.Index.state, } diff --git a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/service/ServiceType.ts b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/service/ServiceType.ts index b1eb7fdab..b57f84901 100755 --- a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/service/ServiceType.ts +++ b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/service/ServiceType.ts @@ -7,6 +7,7 @@ import { style, label, pos, size, rect, texture as imguiTexture, context, imguiI import { nullable, strictNullable } from "meta3d-commonlib-ts/src/nullable" import { name } from "meta3d-gameobject-protocol" import { localEulerAngles, localPosition, localScale } from "meta3d-component-transform-protocol" +import { inputContribute, inputFunc, inputName } from "../contribute/InputContributeType" export type uiExtensionProtocolName = extensionProtocolName @@ -33,18 +34,26 @@ export type service = { meta3dState: meta3dState, skinContribute: skinContribute ) => meta3dState; - readonly registerUIControl: ( + readonly registerUIControl: ( meta3dState: meta3dState, - uiControlContribute: uiControlContribute + uiControlContribute: uiControlContribute + ) => meta3dState; + readonly registerInput: ( + meta3dState: meta3dState, + inputContribute: inputContribute ) => meta3dState; readonly getSkin: ( meta3dState: meta3dState, skinName: skinName ) => nullable>; - readonly getUIControlFunc: < inputData, outputData> ( + readonly getUIControlFunc: < inputData, specificData, outputData> ( meta3dState: meta3dState, uiControlName: uiControlName - ) => uiControlFunc; + ) => uiControlFunc; + readonly getInputFunc: ( + meta3dState: meta3dState, + inputName: inputName + ) => nullable>; // readonly updateUIControlName: ( // meta3dState: meta3dState, // [api, uiExtensionProtocolName]: [api, uiExtensionProtocolName], @@ -59,10 +68,6 @@ export type service = { uiControlName: uiControlName, uiControlState: uiControlState ) => meta3dState; - // readonly prepare: ( - // meta3dState: meta3dState, - // allUIControlContributes: Array> - // ) => Promise; readonly init: ( meta3dState: meta3dState, [api, imguiRendererExtensionProtocolName]: [api, imguiRendererExtensionProtocolName], diff --git a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/state/StateType.res b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/state/StateType.res index eee3ac37e..360c76050 100755 --- a/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/state/StateType.res +++ b/packages/editor-whole/ui/protocols/extension_protocols/meta3d-ui-protocol/src/state/StateType.res @@ -2,7 +2,11 @@ type elementState type dependentExtensionProtocolNameMap -type inputData +type data + +type inputFunc + +type specificData type outputData @@ -40,12 +44,16 @@ type state = { >, uiControlContributeMap: Meta3dCommonlibType.ImmutableHashMapType.t< UIControlContributeType.uiControlName, - UIControlContributeType.uiControlContribute, + UIControlContributeType.uiControlContribute >, uiControlStateMap: Meta3dCommonlibType.ImmutableHashMapType.t< UIControlContributeType.uiControlName, uiControlState, >, + inputContributeMap: Meta3dCommonlibType.ImmutableHashMapType.t< + InputContributeType.inputName, + InputContributeType.inputContribute, + >, // reducers: array, currentElementName: option, fboTextureMap: Meta3dCommonlibType.ImmutableHashMapType.t< diff --git a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/element_visual/components/ElementVisual.res b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/element_visual/components/ElementVisual.res index 07ff630ba..b15f765e8 100755 --- a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/element_visual/components/ElementVisual.res +++ b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/element_visual/components/ElementVisual.res @@ -363,7 +363,14 @@ module Method = { ) => { uiControls ->Meta3dCommonlib.ArraySt.mapi(( - {rect, isDraw, event, specific, children}: FrontendUtils.BackendCloudbaseType.uiControl, + { + rect, + isDraw, + input, + event, + specific, + children, + }: FrontendUtils.BackendCloudbaseType.uiControl, index, ): FrontendUtils.ElementAssembleStoreType.uiControlInspectorData => { id: ( @@ -371,6 +378,7 @@ module Method = { ).id, rect, isDraw, + input: input->Meta3dCommonlib.OptionSt.fromNullable, event, specific, children: _generate( diff --git a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/element_visual/utils/ElementMRUtils.res b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/element_visual/utils/ElementMRUtils.res index 8b1ead22f..b429f19f1 100755 --- a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/element_visual/utils/ElementMRUtils.res +++ b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/element_visual/utils/ElementMRUtils.res @@ -82,16 +82,32 @@ elementMR => { } } -let _generateGetUIControlsStr = (service: FrontendUtils.AssembleSpaceType.service, uiControls) => { +let _getInputName = (data: FrontendUtils.ElementAssembleStoreType.uiControlInspectorData) => { + data.input->Meta3dCommonlib.OptionSt.map(input => input.inputName) +} + +let _generateGetUIControlsAndInputsStr = ( + service: FrontendUtils.AssembleSpaceType.service, + uiControls, +) => { uiControls ->Meta3dCommonlib.ArraySt.removeDuplicateItemsWithBuildKeyFunc((. {displayName}) => { displayName }) - ->Meta3dCommonlib.ArraySt.reduceOneParam((. str, {displayName, protocol}) => { + ->Meta3dCommonlib.ArraySt.reduceOneParam((. str, {displayName, data}) => { + let inputName = data->_getInputName + str ++ j` let ${displayName} = getUIControlFunc(meta3dState,"${displayName}") + ` ++ + switch inputName { + | None => "" + | Some(inputName) => + j` + let ${inputName} = getInputFunc(meta3dState,"${inputName}") ` + } }, "") } @@ -199,7 +215,7 @@ let rec _generateChildren = (service, children: array): string => { : { let str = j`childrenFunc: (meta3dState) =>{ ` - let str = str ++ _generateGetUIControlsStr(service, children) + let str = str ++ _generateGetUIControlsAndInputsStr(service, children) let str = str ++ @@ -223,6 +239,14 @@ and _generateAllDrawUIControlAndHandleEventStr = ( _generateIsDrawIfBegin(data.isDraw) ++ j` return ${displayName}(meta3dState, + ` ++ + data + ->_getInputName + ->Meta3dCommonlib.OptionSt.getWithDefault({ + j`null` + }) ++ + "," ++ + j` { ...${service.meta3d.generateUIControlCommonDataStr(. protocol.configLib, @@ -315,11 +339,11 @@ window.Contribute = { elementFunc: (meta3dState, elementState) => { let ui = api.getPackageService(meta3dState, "meta3d-editor-whole-protocol").ui(meta3dState) - let { getUIControlFunc } = ui + let { getUIControlFunc, getInputFunc } = ui ` } - let str = str ++ _generateGetUIControlsStr(service, mr.uiControls) + let str = str ++ _generateGetUIControlsAndInputsStr(service, mr.uiControls) let str = str ++ _generateAllDrawUIControlAndHandleEventStr(service, mr.uiControls) diff --git a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/publish_element/components/PublishElement.res b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/publish_element/components/PublishElement.res index 9f42ac7aa..2717b4fb3 100755 --- a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/publish_element/components/PublishElement.res +++ b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/publish_element/components/PublishElement.res @@ -22,6 +22,7 @@ module Method = { children, rect, isDraw, + input, event, specific, }): FrontendUtils.BackendCloudbaseType.uiControl => { @@ -39,6 +40,7 @@ module Method = { ).displayName, rect, isDraw, + input: input->Meta3dCommonlib.OptionSt.toNullable, event, specific, children: _convertToUIControls(children, selectedUIControls), @@ -143,7 +145,9 @@ module Method = { ) => { ( // elementInspectorData, - selectedUIControls, selectedUIControlInspectorData) + selectedUIControls, + selectedUIControlInspectorData, + ) } } @@ -153,7 +157,10 @@ let make = (~service: service, ~account: option) => { // elementInspectorData, selectedUIControls, selectedUIControlInspectorData, - ) = FrontendUtils.ReduxUtils.ElementAssemble.useSelector(service.react.useSelector, Method.useSelector) + ) = FrontendUtils.ReduxUtils.ElementAssemble.useSelector( + service.react.useSelector, + Method.useSelector, + ) let (visible, setVisible) = service.react.useState(_ => false) @@ -180,12 +187,12 @@ let make = (~service: service, ~account: option) => { {isUploadBegin ?

{React.string({j`${uploadProgress->Js.Int.toString}% uploading...`})}

:
) => { account, ( // elementInspectorData, - selectedUIControls, selectedUIControlInspectorData), + selectedUIControls, + selectedUIControlInspectorData, + ), ), event->Obj.magic, )->ignore diff --git a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/store/ElementAssembleStore.res b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/store/ElementAssembleStore.res index cd6d7d140..08b468a28 100755 --- a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/store/ElementAssembleStore.res +++ b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/store/ElementAssembleStore.res @@ -11,6 +11,7 @@ let _buildDefaultUIControlInspectorData = (id, specific) => { }, isDraw: true->BoolForIsDraw, event: [], + input: None, specific, children: list{}, } @@ -205,7 +206,15 @@ let reducer = (state, action) => { }, id, ) - + | SetInput(id, inputNameOpt) => + _setUIControlInspectorData( + state, + data => { + ...data, + input: inputNameOpt->Meta3dCommonlib.OptionSt.map(inputName => ( {inputName:inputName}:input )) + }, + id, + ) | SetAction(id, (eventName, actionNameOpt)) => _setUIControlInspectorData( state, diff --git a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/ui_control_Inspector/components/UIControlInspector.res b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/ui_control_Inspector/components/UIControlInspector.res index e396fd6b3..e6f68b954 100755 --- a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/ui_control_Inspector/components/UIControlInspector.res +++ b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/ui_control_Inspector/components/UIControlInspector.res @@ -92,6 +92,15 @@ module Method = { ) } + let setInput = (dispatch, id, inputName: string) => { + dispatch( + FrontendUtils.ElementAssembleStoreType.SetInput( + id, + FrontendUtils.SelectUtils.isEmptySelectOptionValue(inputName) ? None : Some(inputName), + ), + ) + } + let getActions = SelectedContributesForElementUtils.getActions let setAction = ( @@ -138,7 +147,7 @@ module Method = { // } // let buildRectField = (dispatch, setRectField, elementStateFields, id, rect, rectField) => { - let buildRectField = (dispatch, setRectField, id, rect, rectField) => { + let buildRectField = (dispatch, setRectField, id, rect, rectField) => { <> { selectedUIControlInspectorData, ) { | None => React.null - | Some({id, rect, isDraw, event, specific}) => + | Some({id, rect, isDraw, input, event, specific}) => let {x, y, width, height} = rect {service.ui.buildTitle(. ~level=2, ~children={React.string(`Rect`)}, ())} - {Method.buildRectField(dispatch, Method.setRectX, id, rect, x)} - {Method.buildRectField(dispatch, Method.setRectY, id, rect, y)} - {Method.buildRectField(dispatch, Method.setRectWidth, id, rect, width)} - {Method.buildRectField( - dispatch, - Method.setRectHeight, - id, - rect, - height, - )} + {Method.buildRectField(dispatch, Method.setRectX, id, rect, x)} + {Method.buildRectField(dispatch, Method.setRectY, id, rect, y)} + {Method.buildRectField(dispatch, Method.setRectWidth, id, rect, width)} + {Method.buildRectField(dispatch, Method.setRectHeight, id, rect, height)} {service.ui.buildTitle(. ~level=2, ~children={React.string(`IsDraw`)}, ())} {Method.buildIsDraw(dispatch, id, isDraw)} @@ -400,7 +403,7 @@ let make = (~service: service) => { ), None, )->Obj.magic - | Some({id, protocolConfigStr}) => + | Some({id, protocolConfigStr, data}) => // let {name, version} = data.contributePackageData.protocol let actions = selectedContributes->Method.getActions->Meta3dCommonlib.ListSt.toArray @@ -409,14 +412,41 @@ let make = (~service: service) => { protocolConfigStr, ) + let uiControlProtocolName = data.contributePackageData.protocol.name + + {service.ui.buildTitle(. ~level=2, ~children={React.string(`Input`)}, ())} + {FrontendUtils.SelectUtils.buildSelect( + Method.setInput(dispatch, id), + input + ->Meta3dCommonlib.OptionSt.map(input => input.inputName) + ->Meta3dCommonlib.OptionSt.getWithDefault( + FrontendUtils.SelectUtils.buildEmptySelectOptionValue(), + ) + ->Meta3dCommonlib.Log.printForDebug, + SelectedContributesForElementUtils.getInputs(selectedContributes) + ->Meta3dCommonlib.ListSt.toArray + ->Meta3dCommonlib.Log.printForDebug + ->Meta3dCommonlib.ArraySt.filter(({data}) => { + data.contributePackageData.protocol.name + ->Js.String.replace("-input-", "-ui-control-", _) + ->Meta3dCommonlib.Log.printForDebug == uiControlProtocolName + }) + ->Meta3dCommonlib.Log.printForDebug + ->Meta3dCommonlib.ArraySt.map(({data}) => { + ( + service.meta3d.execGetContributeFunc(. data.contributeFuncData)->Obj.magic + )["inputName"] + }) + ->Meta3dCommonlib.Log.printForDebug, + )} {service.ui.buildTitle(. ~level=2, ~children={React.string(`Specific`)}, ())} {Method.buildSpecific(service, dispatch, id, specific)} {service.ui.buildTitle(. ~level=2, ~children={React.string(`Event`)}, ())} { - renderItem={(eventName) => { + renderItem={eventName => { let value = ElementMRUtils.getActionName( event, diff --git a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/utils/ContributeTypeUtils.res b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/utils/ContributeTypeUtils.res index 15411ba31..f91885cf0 100755 --- a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/utils/ContributeTypeUtils.res +++ b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/utils/ContributeTypeUtils.res @@ -1,16 +1,17 @@ +let isAction = protocolName => { + protocolName->Js.String.includes("-action-", _) +} + let decideContributeType = (protocolName: string): Meta3dType.ContributeType.contributeType => { switch protocolName { | name if name->Js.String.includes("-ui-control-", _) => UIControl | name if name->Js.String.includes("-pipeline-", _) => Pipeline - | name if name->Js.String.includes("-action-", _) => Action + | name if isAction(name) => Action | name if name->Js.String.includes("-component-", _) => Component | name if name->Js.String.includes("-gameobject-", _) => GameObject | name if name->Js.String.includes("-element-", _) => Element + | name if FrontendUtils.ContributeTypeUtils.isInput(name) => Input | name if name->Js.String.includes("-skin-", _) => Skin | _ => Unknown } } - -let isAction = (protocolName) => { - protocolName->Js.String.includes("-action-", _) -} \ No newline at end of file diff --git a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/utils/SelectedContributesForElementUtils.res b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/utils/SelectedContributesForElementUtils.res index 77bf16dc1..d51aee45f 100755 --- a/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/utils/SelectedContributesForElementUtils.res +++ b/platform/assemble-space/src/external_layer/ui/assemble_space/components/element_assemble/utils/SelectedContributesForElementUtils.res @@ -26,6 +26,8 @@ let getElements = _getContributes(_, Meta3dType.ContributeType.Element) let getSkins = _getContributes(_, Meta3dType.ContributeType.Skin) +let getInputs = _getContributes(_, Meta3dType.ContributeType.Input) + let hasUIControl = ( selectedContributes: array, ) => { diff --git a/platform/assemble-space/src/external_layer/ui/assemble_space/components/utils/DependencyGraphUtils.res b/platform/assemble-space/src/external_layer/ui/assemble_space/components/utils/DependencyGraphUtils.res index 95dd13bb2..83a785bb4 100755 --- a/platform/assemble-space/src/external_layer/ui/assemble_space/components/utils/DependencyGraphUtils.res +++ b/platform/assemble-space/src/external_layer/ui/assemble_space/components/utils/DependencyGraphUtils.res @@ -207,6 +207,9 @@ module Method = { | _ => true } }) + ->ListSt.filter(({protocol}) => { + !FrontendUtils.ContributeTypeUtils.isInput(protocol.name) + }) ->ListSt.toArray // let resultArr = [] diff --git a/platform/assemble-space/test/features/uiControlInspector.feature b/platform/assemble-space/test/features/uiControlInspector.feature index 692beac94..f8cc0e850 100755 --- a/platform/assemble-space/test/features/uiControlInspector.feature +++ b/platform/assemble-space/test/features/uiControlInspector.feature @@ -43,6 +43,16 @@ Feature: UIControlInsepctor Then should dispatch SetIsDraw action + Rule: Input + + Scenario: show input + Given select ui control window w1 + And select input i1 match w1 + And set inspector current selected ui control data to w1 + When render + Then should show dom with defalut value + + Rule: Specific Scenario: show specific diff --git a/platform/assemble-space/test/step-definitions/__snapshots__/uiControlInspector.steps.bs.js.snap b/platform/assemble-space/test/step-definitions/__snapshots__/uiControlInspector.steps.bs.js.snap index 37bb1ba6d..253938073 100755 --- a/platform/assemble-space/test/step-definitions/__snapshots__/uiControlInspector.steps.bs.js.snap +++ b/platform/assemble-space/test/step-definitions/__snapshots__/uiControlInspector.steps.bs.js.snap @@ -476,14 +476,15 @@ exports[`UIControlInsepctor show default action and action select 1`] = ` className="ant-select-selection-search" > +
+

+ 2 +

+
+
+
+
+ + + + + empty + +
+ + + + + +
+
+
+

+ 2 +

+
+
+
+
+ + + + + empty + +
+ + + + + +
+
`; -exports[`UIControlInsepctor show nothing 1`] = `null`; - -exports[`UIControlInsepctor show specific 1`] = ` +exports[`UIControlInsepctor show input 1`] = `
+
+

+ 2 +

+
+
+
+
+ + + + + input1 + +
+ + + + + +
+
+
+

+ 2 +

+
+
+

+ 2 +

+
+
+
+
+
+
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+
+
+
+
+
+
+
+`; + +exports[`UIControlInsepctor show nothing 1`] = `null`; + +exports[`UIControlInsepctor show specific 1`] = ` +
+
+

+ 2 +

+
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + + + + + + +
+
+ +
+
+
+
+
+
+

+ 2 +

+
+
+
+
+
+
+ + + + + true + +
+ + + + + +
+
+
+
+
+
+
+

+ 2 +

+
+
+
+
+ + + + + empty + +
+ + + + + +
+
{ \"and"( "generate correct result", () => { - str.contents->NewlineTool.unifyNewlineChar->NewlineTool.removeBlankChar->expect == - // "\nwindow.Contribute = {\n getContribute: (api) => { return {\n elementName:\"ElementAssembleElement\",\n execOrder: 0,\n elementState: {\"a1\":10,\"a2\":\"zzz\",\"a3\":false},\n elementFunc: (meta3dState, elementState) => {\n let { getUIControlFunc } = api.getPackageService(meta3dState, \"meta3d-ui-protocol\")\n\n let Button1 = getUIControlFunc(meta3dState,\"Button1\")\n \n let Button2 = getUIControlFunc(meta3dState,\"Button2\")\n \n let data = null\n if(elementState.a3){\n return Button1(meta3dState,\n {\n ...{rect: {\n x: 1,\n y: 0,\n width: 0,\n height: 0\n }},\n ...{},\n childrenFunc:(meta3dState) => new Promise((resolve, reject) => resolve(meta3dState))\n }\n ).then(data =>{\n meta3dState = data[0]\nif(false){\n return Button2(meta3dState,\n {\n ...{rect: {\n x: elementState.a2,\n y: 0,\n width: 0,\n height: 0\n }},\n ...{},\n childrenFunc:(meta3dState) => new Promise((resolve, reject) => resolve(meta3dState))\n }\n ).then(data =>{\n meta3dState = data[0]\n\n return new Promise((resolve) => {\n resolve(meta3dState)\n })\n })}})}\n return new Promise((resolve) => {\n resolve(meta3dState)\n })\n \n }\n }\n }\n}\n "->NewlineTool.removeBlankChar + str.contents + ->NewlineTool.unifyNewlineChar + ->NewlineTool.removeBlankChar + ->expect == // "\nwindow.Contribute = {\n getContribute: (api) => { return {\n elementName:\"ElementAssembleElement\",\n execOrder: 0,\n elementState: {\"a1\":10,\"a2\":\"zzz\",\"a3\":false},\n elementFunc: (meta3dState, elementState) => {\n let { getUIControlFunc } = api.getPackageService(meta3dState, \"meta3d-ui-protocol\")\n\n let Button1 = getUIControlFunc(meta3dState,\"Button1\")\n \n let Button2 = getUIControlFunc(meta3dState,\"Button2\")\n \n let data = null\n if(elementState.a3){\n return Button1(meta3dState,\n {\n ...{rect: {\n x: 1,\n y: 0,\n width: 0,\n height: 0\n }},\n ...{},\n childrenFunc:(meta3dState) => new Promise((resolve, reject) => resolve(meta3dState))\n }\n ).then(data =>{\n meta3dState = data[0]\nif(false){\n return Button2(meta3dState,\n {\n ...{rect: {\n x: elementState.a2,\n y: 0,\n width: 0,\n height: 0\n }},\n ...{},\n childrenFunc:(meta3dState) => new Promise((resolve, reject) => resolve(meta3dState))\n }\n ).then(data =>{\n meta3dState = data[0]\n\n return new Promise((resolve) => {\n resolve(meta3dState)\n })\n })}})}\n return new Promise((resolve) => {\n resolve(meta3dState)\n })\n \n }\n }\n }\n}\n "->NewlineTool.removeBlankChar "window.Contribute={getContribute:(api)=>{return{elementName:\"ElementAssembleElement\",execOrder:0,elementState:{},elementFunc:(meta3dState,elementState)=>{let{ui}=api.getPackageService(meta3dState,\"meta3d-editor-whole-protocol\")let {getUIControlFunc}=uiletButton1=getUIControlFunc(meta3dState,\"Button1\")letButton2=getUIControlFunc(meta3dState,\"Button2\")letdata=nullif(true){returnButton1(meta3dState,{...{rect:{x:1,y:0,width:0,height:0}},...{},childrenFunc:(meta3dState)=>newPromise((resolve,reject)=>resolve(meta3dState))}).then(data=>{meta3dState=data[0]if(false){returnButton2(meta3dState,{...{rect:{x:2,y:0,width:0,height:0}},...{},childrenFunc:(meta3dState)=>newPromise((resolve,reject)=>resolve(meta3dState))}).then(data=>{meta3dState=data[0]returnnewPromise((resolve)=>{resolve(meta3dState)})})}})}returnnewPromise((resolve)=>{resolve(meta3dState)})}}}}" }, ) @@ -584,6 +586,7 @@ handle click event code... ~id="w1", ~x=1->FrontendUtils.ElementAssembleStoreType.IntForRectField, ~isDraw=true->FrontendUtils.ElementAssembleStoreType.BoolForIsDraw, + ~input=UIControlInspectorTool.buildInput("input1")->Some, ~specific=[ UIControlInspectorTool.buildSpecific( ~name="label", @@ -658,7 +661,7 @@ handle click event code... "generate correct result", () => { str.contents->NewlineTool.unifyNewlineChar->NewlineTool.removeBlankChar->expect == - "\nwindow.Contribute = {\n getContribute: (api) => { return {\n elementName:\"ElementAssembleElement\",\n execOrder: 0,\n elementState: {},\n elementFunc: (meta3dState, elementState) => {\n let { getUIControlFunc } = api.getPackageService(meta3dState, \"meta3d-ui-protocol\")\n\n let Window1 = getUIControlFunc(meta3dState,\"Window1\")\n \n let data = null\n if(true){\n return Window1(meta3dState,\n {\n ...{rect: {\n x: 1,\n y: 0,\n width: 0,\n height: 0\n }},\n ...{label: \"Window1\"},\n childrenFunc:(meta3dState) => new Promise((resolve, reject) => resolve(meta3dState))\n }\n ).then(data =>{\n meta3dState = data[0]\n\n return new Promise((resolve) => {\n resolve(meta3dState)\n })\n })}\n return new Promise((resolve) => {\n resolve(meta3dState)\n })\n \n }\n }\n }\n}\n "->NewlineTool.removeBlankChar + "\nwindow.Contribute = {\n getContribute: (api) => {\n return {\n elementName:\"ElementAssembleElement\",\n execOrder: 0,\n elementState: {},\n elementFunc: (meta3dState, elementState) => {\n let ui = api.getPackageService(meta3dState, \"meta3d-editor-whole-protocol\").ui(meta3dState)\n\n let { getUIControlFunc, getInputFunc } = ui\n\n let Window1 = getUIControlFunc(meta3dState,\"Window1\")\n \n let input1 = getInputFunc(meta3dState,\"input1\")\n \n let data = null\n if(true){\n return Window1(meta3dState,\n input1,\n {\n ...{rect: {\n x: 1,\n y: 0,\n width: 0,\n height: 0\n }},\n ...{label: \"Window1\"},\n childrenFunc:(meta3dState) => new Promise((resolve, reject) => resolve(meta3dState))\n }\n ).then(data =>{\n meta3dState = data[0]\n\n return new Promise((resolve) => {\n resolve(meta3dState)\n })\n })}\n return new Promise((resolve) => {\n resolve(meta3dState)\n })\n \n }\n }\n }\n}\n "->NewlineTool.removeBlankChar }, ) }) @@ -925,8 +928,10 @@ handle click event code... \"and"( "generate correct result", () => { - str.contents->NewlineTool.unifyNewlineChar->NewlineTool.removeBlankChar->expect == - "window.Contribute={getContribute:(api)=>{return{elementName:\"ElementAssembleElement\",execOrder:0,elementState:{},elementFunc:(meta3dState,elementState)=>{let{ui}=api.getPackageService(meta3dState,\"meta3d-editor-whole-protocol\")let {getUIControlFunc}=uiletParentWindow=getUIControlFunc(meta3dState,\"ParentWindow\")letdata=nullif(true){returnParentWindow(meta3dState,{...{rect:{x:1,y:0,width:0,height:0}},...{label:\"Window1\"},childrenFunc:(meta3dState)=>{letChildWindow=getUIControlFunc(meta3dState,\"ChildWindow\")letdata=nullif(false){returnChildWindow(meta3dState,{...{rect:{x:2,y:0,width:0,height:0}},...{label:\"Window1\"},childrenFunc:(meta3dState)=>newPromise((resolve,reject)=>resolve(meta3dState))}).then(data=>{meta3dState=data[0]returnnewPromise((resolve)=>{resolve(meta3dState)})})}returnnewPromise((resolve,reject)=>resolve(meta3dState))}}).then(data=>{meta3dState=data[0]returnnewPromise((resolve)=>{resolve(meta3dState)})})}returnnewPromise((resolve)=>{resolve(meta3dState)})}}}}" + str.contents + ->NewlineTool.unifyNewlineChar + ->NewlineTool.removeBlankChar + ->expect == "window.Contribute={getContribute:(api)=>{return{elementName:\"ElementAssembleElement\",execOrder:0,elementState:{},elementFunc:(meta3dState,elementState)=>{let{ui}=api.getPackageService(meta3dState,\"meta3d-editor-whole-protocol\")let {getUIControlFunc}=uiletParentWindow=getUIControlFunc(meta3dState,\"ParentWindow\")letdata=nullif(true){returnParentWindow(meta3dState,{...{rect:{x:1,y:0,width:0,height:0}},...{label:\"Window1\"},childrenFunc:(meta3dState)=>{letChildWindow=getUIControlFunc(meta3dState,\"ChildWindow\")letdata=nullif(false){returnChildWindow(meta3dState,{...{rect:{x:2,y:0,width:0,height:0}},...{label:\"Window1\"},childrenFunc:(meta3dState)=>newPromise((resolve,reject)=>resolve(meta3dState))}).then(data=>{meta3dState=data[0]returnnewPromise((resolve)=>{resolve(meta3dState)})})}returnnewPromise((resolve,reject)=>resolve(meta3dState))}}).then(data=>{meta3dState=data[0]returnnewPromise((resolve)=>{resolve(meta3dState)})})}returnnewPromise((resolve)=>{resolve(meta3dState)})}}}}" }, ) }, diff --git a/platform/assemble-space/test/step-definitions/publishElement.steps.res b/platform/assemble-space/test/step-definitions/publishElement.steps.res index b5d849ac9..ca9931f9d 100755 --- a/platform/assemble-space/test/step-definitions/publishElement.steps.res +++ b/platform/assemble-space/test/step-definitions/publishElement.steps.res @@ -14,6 +14,7 @@ defineFeature(feature, test => { // let elementInspectorData = ref(Obj.magic(1)) let selectedUIControls = ref(Obj.magic(1)) let selectedUIControlInspectorData = ref(Obj.magic(1)) + let input = ref(Obj.magic(1)) let event = ref(Obj.magic(1)) let isDraw = ref(Obj.magic(1)) let specific = ref(Obj.magic(1)) @@ -45,10 +46,7 @@ defineFeature(feature, test => { ~service=ServiceTool.build( ~sandbox, ~useSelector=createEmptyStub(refJsObjToSandbox(sandbox.contents))->returns( - ( - list{} , - list{}, - ), + (list{}, list{}), _, ), (), @@ -129,6 +127,7 @@ defineFeature(feature, test => { // elementInspectorData := // ElementInspectorTool.buildElementInspectorData(list{}) + input := UIControlInspectorTool.buildInput("input") event := [UIControlInspectorTool.buildEventData(#button_click, "a1")] isDraw := false->FrontendUtils.ElementAssembleStoreType.BoolForIsDraw @@ -156,6 +155,7 @@ defineFeature(feature, test => { UIControlInspectorTool.buildUIControlInspectorData( ~id="b1", ~x=1->FrontendUtils.ElementAssembleStoreType.IntForRectField, + ~input=input.contents->Some, ~event=event.contents, ~isDraw=isDraw.contents, ~specific=specific.contents, @@ -234,7 +234,7 @@ defineFeature(feature, test => { version: ElementContributeUtils.getElementContributeProtocolVersion(), }, dependentPackageStoredInAppProtocolNameMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), - dependentBlockProtocolNameMap: Meta3dCommonlib.ImmutableHashMap.createEmpty() + dependentBlockProtocolNameMap: Meta3dCommonlib.ImmutableHashMap.createEmpty(), // ->Meta3dCommonlib.ImmutableHashMap.set( // "meta3d-ui-protocol", // ElementVisualTool.getUIProtocolVersion(), @@ -391,6 +391,7 @@ defineFeature(feature, test => { (), ), isDraw: isDraw.contents, + input: input.contents->Meta3dCommonlib.NullableSt.return, event: event.contents, specific: specific.contents, children: [ @@ -401,6 +402,7 @@ defineFeature(feature, test => { (), ), isDraw: isDraw.contents, + input: Js.Nullable.null, event: event.contents, specific: specific.contents, children: [], diff --git a/platform/assemble-space/test/step-definitions/uiControlInspector.steps.res b/platform/assemble-space/test/step-definitions/uiControlInspector.steps.res index fc5d0d789..aea850f5e 100755 --- a/platform/assemble-space/test/step-definitions/uiControlInspector.steps.res +++ b/platform/assemble-space/test/step-definitions/uiControlInspector.steps.res @@ -406,6 +406,122 @@ defineFeature(feature, test => { ) }) + test(."show input", ({given, \"when", \"and", then}) => { + let id = "d1" + let w1 = ref(Obj.magic(1)) + let i1 = ref(Obj.magic(1)) + let i1Name = "input1" + let useSelectorStub = ref(Obj.magic(1)) + let execGetContributeFuncStub = ref(Obj.magic(1)) + + _prepare(given) + + given( + "select ui control window w1", + () => { + w1 := + SelectedUIControlsTool.buildSelectedUIControl( + ~id, + ~data=ContributeTool.buildContributeData( + ~contributePackageData=ContributeTool.buildContributePackageData( + ~protocol={ + name: "meta3d-ui-control-window-protocol", + version: "^0.7.0", + }, + (), + ), + (), + ), + (), + ) + }, + ) + + \"and"( + "select input i1 match w1", + () => { + execGetContributeFuncStub := createEmptyStub(refJsObjToSandbox(sandbox.contents)) + + i1 := + SelectedContributesTool.buildSelectedContribute( + ~id=i1Name, + ~protocolConfigStr=Some(""), + ~data=ContributeTool.buildContributeData( + ~contributePackageData=ContributeTool.buildContributePackageData( + ~name=i1Name, + ~protocol={ + name: "meta3d-input-window-protocol", + version: "^0.6.0", + }, + (), + ), + (), + ), + (), + ) + + execGetContributeFuncStub.contents + ->onCall(0, _) + ->returns( + { + "inputName": i1Name, + }, + _, + ) + ->ignore + }, + ) + + \"and"( + "set inspector current selected ui control data to w1", + () => { + useSelectorStub := + createEmptyStub(refJsObjToSandbox(sandbox.contents))->returns( + ( + list{i1.contents}, + ( + id->Some, + list{w1.contents}, + list{ + UIControlInspectorTool.buildUIControlInspectorData( + ~id, + ~input=UIControlInspectorTool.buildInput(i1Name)->Some, + (), + ), + }, + ), + ), + _, + ) + }, + ) + + \"when"( + "render", + () => { + () + }, + ) + + then( + "should show dom with defalut value", + () => { + UIControlInspectorTool.buildUI( + ~sandbox, + ~service=ServiceTool.build( + ~sandbox, + ~useSelector=useSelectorStub.contents, + ~execGetContributeFunc=execGetContributeFuncStub.contents->Obj.magic, + (), + ), + (), + ) + ->ReactTestRenderer.create + ->ReactTestTool.createSnapshotAndMatch + }, + ) + }) + test(."show specific", ({given, \"when", \"and", then}) => { let id = "d1" let w1 = ref(Obj.magic(1)) diff --git a/platform/assemble-space/test/tool/ImportElementTool.res b/platform/assemble-space/test/tool/ImportElementTool.res index 1572bccd3..1b2ee9922 100755 --- a/platform/assemble-space/test/tool/ImportElementTool.res +++ b/platform/assemble-space/test/tool/ImportElementTool.res @@ -8,6 +8,7 @@ let buildUIControl = ( ~displayName="u1", ~rect=UIControlInspectorTool.buildRect(), ~isDraw=true->FrontendUtils.ElementAssembleStoreType.BoolForIsDraw, + ~input=None, ~event=[], ~specific=[], ~children=[], @@ -16,6 +17,7 @@ let buildUIControl = ( displayName, rect, isDraw, + input: input->Meta3dCommonlib.OptionSt.toNullable, event, specific, children, @@ -30,7 +32,7 @@ let buildElementAssembleData = ( elementName, elementVersion, inspectorData: { - uiControls, + uiControls: uiControls, }, } diff --git a/platform/assemble-space/test/tool/UIControlInspectorTool.res b/platform/assemble-space/test/tool/UIControlInspectorTool.res index f3a458088..c575d7c62 100755 --- a/platform/assemble-space/test/tool/UIControlInspectorTool.res +++ b/platform/assemble-space/test/tool/UIControlInspectorTool.res @@ -19,20 +19,24 @@ let buildRect = ( (), ): FrontendUtils.ElementAssembleStoreType.rect => { { - x: x, - y: y, - width: width, - height: height, + x, + y, + width, + height, } } +let buildInput = (inputName): FrontendUtils.ElementAssembleStoreType.input => { + inputName: inputName, +} + let buildEventData = ( // eventName: Meta3dType.ContributeProtocolConfigType.eventName, eventName, actionName, ): FrontendUtils.ElementAssembleStoreType.eventData => { - eventName: eventName, - actionName: actionName, + eventName, + actionName, } let buildSpecific = ( @@ -42,9 +46,9 @@ let buildSpecific = ( (), ): FrontendUtils.ElementAssembleStoreType.specificData => { { - name: name, - type_: type_, - value: value, + name, + type_, + value, } } @@ -55,17 +59,19 @@ let buildUIControlInspectorData = ( ~width=0->FrontendUtils.ElementAssembleStoreType.IntForRectField, ~height=0->FrontendUtils.ElementAssembleStoreType.IntForRectField, ~isDraw=true->FrontendUtils.ElementAssembleStoreType.BoolForIsDraw, + ~input=None, ~event=[], ~specific=[], ~children=list{}, (), ): FrontendUtils.ElementAssembleStoreType.uiControlInspectorData => { - id: id, + id, rect: buildRect(~x, ~y, ~width, ~height, ()), - isDraw: isDraw, - event: event, - specific: specific, - children: children, + isDraw, + input, + event, + specific, + children, } let setRectX = UIControlInspector.Method.setRectX diff --git a/platform/frontend-utils/src/ContributeTypeUtils.res b/platform/frontend-utils/src/ContributeTypeUtils.res new file mode 100644 index 000000000..368357a67 --- /dev/null +++ b/platform/frontend-utils/src/ContributeTypeUtils.res @@ -0,0 +1,3 @@ +let isInput = protocolName => { + protocolName->Js.String.includes("-input-", _) +} diff --git a/platform/frontend-utils/src/assemble_space/element_assemble/ElementAssembleStoreType.res b/platform/frontend-utils/src/assemble_space/element_assemble/ElementAssembleStoreType.res index 78802e39b..f92e47fa4 100755 --- a/platform/frontend-utils/src/assemble_space/element_assemble/ElementAssembleStoreType.res +++ b/platform/frontend-utils/src/assemble_space/element_assemble/ElementAssembleStoreType.res @@ -66,11 +66,16 @@ type specificData = { type specific = array +type inputName = string + +type input = {inputName: inputName} + type rec uiControlInspectorData = { id: id, rect: rect, specific: specific, isDraw: isDraw, + input: option, event: event, children: list, } @@ -137,6 +142,7 @@ type action = | SetRect(id, rect) | SetIsDraw(id, isDraw) // | SetAction(id, (eventName, option)) + | SetInput(id, option) | SetAction(id, (Meta3dType.ContributeProtocolConfigType.eventName, option)) // | SetVisualExtension(ApAssembleStoreType.extension) // | SetRunVisualExtension(ApAssembleStoreType.extension) diff --git a/platform/frontend-utils/src/backend_cloudbase/BackendCloudbaseType.res b/platform/frontend-utils/src/backend_cloudbase/BackendCloudbaseType.res index 5a461df87..56abb7bb0 100755 --- a/platform/frontend-utils/src/backend_cloudbase/BackendCloudbaseType.res +++ b/platform/frontend-utils/src/backend_cloudbase/BackendCloudbaseType.res @@ -102,6 +102,16 @@ type batchFindPublishExtensionProtocols = ( // . array<(protocolName, protocolVersion)>, + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + // . array<(protocolName, protocolVersion)>, protocolName, >, @@ -144,6 +154,16 @@ type batchFindPublishContributeProtocols = ( // . array<(protocolName, protocolVersion)>, + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + // . array<(protocolName, protocolVersion)>, protocolName, >, @@ -202,6 +222,16 @@ type batchFindPublishExtensionProtocolConfigs = ( // . array<(protocolName, protocolVersion)>, + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + // . array<(protocolName, protocolVersion)>, protocolName, >, @@ -244,6 +274,16 @@ type batchFindPublishContributeProtocolConfigs = ( // . array<(protocolName, protocolVersion)>, + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + + // . array<(protocolName, protocolVersion)>, + // . array<(protocolName, protocolVersion)>, protocolName, >, @@ -330,6 +370,7 @@ type rec uiControl = { displayName: string, rect: ElementAssembleStoreType.rect, isDraw: ElementAssembleStoreType.isDraw, + input: Js.Nullable.t, event: ElementAssembleStoreType.event, specific: ElementAssembleStoreType.specific, children: array, diff --git a/platform/frontend/src/external_layer/ui/app/user_center/store/UserCenterStore.res b/platform/frontend/src/external_layer/ui/app/user_center/store/UserCenterStore.res index ac4134cc2..65549b95d 100755 --- a/platform/frontend/src/external_layer/ui/app/user_center/store/UserCenterStore.res +++ b/platform/frontend/src/external_layer/ui/app/user_center/store/UserCenterStore.res @@ -55,15 +55,17 @@ let _removeOtherSelectedExtensionsOfSameProtocolName = ( }) } -let _removeOtherSelectedContributesOfSameProtocolName = ( +let _removeOtherSelectedContributesOfSameProtocolNameExceptInput = ( selectedContributes: selectedContributes, data: contribute, ) => { let protocolName = data.protocolName - selectedContributes->Meta3dCommonlib.ListSt.filter(((selectedContribute, _)) => { - selectedContribute.protocolName !== protocolName - }) + FrontendUtils.ContributeTypeUtils.isInput(protocolName) + ? selectedContributes + : selectedContributes->Meta3dCommonlib.ListSt.filter(((selectedContribute, _)) => { + selectedContribute.protocolName !== protocolName + }) } let _removeOtherSelectedPackagesOfSameProtocolName = ( @@ -100,7 +102,7 @@ let reducer = (state, action) => { | SelectContribute(data, protocolConfigOpt) => { ...state, selectedContributes: state.selectedContributes - ->_removeOtherSelectedContributesOfSameProtocolName(data) + ->_removeOtherSelectedContributesOfSameProtocolNameExceptInput(data) ->Meta3dCommonlib.ListSt.push((data, protocolConfigOpt)), // selectedContributeProtocolConfigs: state.selectedContributeProtocolConfigs->Meta3dCommonlib.ListSt.push( // protocolConfigOpt, @@ -151,7 +153,7 @@ let reducer = (state, action) => { state.selectedContributes, (result, (data, protocolConfigOpt) as selectedContribute) => { result - ->_removeOtherSelectedContributesOfSameProtocolName(data) + ->_removeOtherSelectedContributesOfSameProtocolNameExceptInput(data) ->Meta3dCommonlib.ListSt.push(selectedContribute) }, ), @@ -179,7 +181,7 @@ let reducer = (state, action) => { state.selectedContributes, (result, (data, protocolConfigOpt) as selectedContribute) => { result - ->_removeOtherSelectedContributesOfSameProtocolName(data) + ->_removeOtherSelectedContributesOfSameProtocolNameExceptInput(data) ->Meta3dCommonlib.ListSt.push(selectedContribute) }, ), diff --git a/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/.gitignore b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/.gitignore new file mode 100755 index 000000000..27f6619fb --- /dev/null +++ b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/.gitignore @@ -0,0 +1,19 @@ +.DS_Store +.merlin +.idea/ +.vscode/ +jest_0/ +reference/ +node_modules/ +mine/ + +coverage + +dist/ + +npm-debug + +.bsb.lock + +yarn.lock + diff --git a/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/gulpfile.js b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/gulpfile.js new file mode 100755 index 000000000..ce0e8ab73 --- /dev/null +++ b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/gulpfile.js @@ -0,0 +1,23 @@ +var gulp = require("gulp"); +var path = require("path"); +var publish = require("meta3d-tool-publish-protocol") + +gulp.task("publish_local_env", function (done) { + publish.publishContributeProtocol( + "local", + path.join(__dirname, "package.json"), + path.join(__dirname, "icon.png") + ).then(() => { + done() + }) +}); + +gulp.task("publish_production_env", function (done) { + publish.publishContributeProtocol( + "production", + path.join(__dirname, "package.json"), + path.join(__dirname, "icon.png") + ).then(() => { + done() + }) +}); \ No newline at end of file diff --git a/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/icon.png b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..828c6d76a7f6cdd3f6e8c8fa455188982b05b555 GIT binary patch literal 3766 zcmV;n4oUHeP)w zdYhm+H(4FGLU8Ul4(CF&ah)~iD%g14Uo86w&SKxZPeZ>dZ#ieZoT={r&M&vJ^22n$ z*mEpHxbaU_SqnLtgjCe!@#LqAJj()vKT*=eTnlc9$>T#3{n&pT+k`=Kh=pTD_o8$} zd^iV|pU5iV&o1j;I~3iElIPjZ>PXrn^v>Pj*^!9P_EsKSghg%m;;F@0U08ZD8-!k% zv{v~ZjF)rhS$H}+VOo?I+jzf_qAch;2$e964#c%Z$;ht}m61lcIc5v;Js7j&=6i(4 zo2}JTC0-xDL|DZ91AKSJn6R*-3DeuM)AL>I7Jis8-7Wn7O%R+pv?yLB-e0Rn? zLK!+3!lL=q3-~VHU|vUaLNCcbKY$OhJTV_eW5OW&&Hz5dGvmXRDd92yB44lEbaON# z+%#Y2>(!XqI7WoQLMFDESZg#>4G6vJ+iWjY2FEIW!gRNW0epz<^i3RXLO=U9)|)cl zHenHen`tC%V_cIkYQIf1Q5)GLJbrVRhs5=EMlHe>tuaHfoh3qVrGP!6#;!3>xGBF4 zqEI<+-^>!Gtx}I77JmHh_j^R#Y|NYFE*r zW;P8a;qhMp>=2b(zltzg`#bm)R~c{$!eV{4D5O?lhQoyZ+D;QH#qePYBuv+I9%Kv( z%6TdScYcV_ThBhh*rhr8VR$;%iXacrM1=^e^(>?HpW|tJ1{Xh8nGpt`L{KU|z0WP! z$O1fYa>C8!lMpIp6SK2|miUX@LX{IXYnh`5$=d~aR9K@=c>F8|C?;PaD`=uhZ5tV3 z@a?;ar*h!cg62tm;5GE!eT9RRB`az zLLbSe2I_=xznXPaKzn$n8u$!rCYQt$LU5t_xD?j3dxnOAPkxp$VY;3ZMXk8AKY|OI8$Y4M>1V2CVX^aR%n@oTIYagecl}S|ior0oD%B+udS7I_8q2r7O zaYSf8l&j;&n<(`>Z;(3DCz^O^)Lc}QD#8H%7`v$m3)_JF(!8Gy#yVYFXlaWT_q-|} z8GGL`-U;n4Gd!QcdqU))7|^U;*fB2 zvxdjo-N_^jeIH4J#joI%gyJ>qRS!QnB(ye!jF*9FMw(ZY9PSaXVD29VLAhhRQ zy9Ssvf_;&V9{dVS^V8e|49}GVLQ5`g)<)QjLa!Q4Rk^!C}GdWSopG1&fPlL7J*9}k>FN5esn9zqXugFQufn*U8hotDA zcjH$(ZKI35%!L;r-3Oc(ivaf9Ya3@-RvYCvUdDuUo4eJH76hfb&@+9$m;L=DoUsz- z1^CoW6x#HGv8Vn0OXyJnTMK}8W2~9?MhJR#G?mk*sAWKho!{|0Gw^FYEB75?iZ^;8 zgOp}wjse|0-fXVZjxa<|b0|HIbOFL7hiQBalL$LPA3aGYVGj>&DM3}kRrK#CL!S(o z-x1;$8o(kA2>XN-&~>lq@2gyAi(Y7eLq$q4LWKP89=)Nla_ekw*r#dbLrB{Rfz=tE z`f=+Bv2z?aHtlIn&sZJ^g}(V~w+MzTz1R~Ts~oI9A9!Kt_pCztz372B zJLn(BEKxvT@?^pkJ=L5W@b6mXNIFgT*q<(QuqTUHN@&A5U(3GO!yZ>^2l+`R zJvmvq~jjUA*t#H4{iB){ZSLiQq}&F9=fJ`+o1gjSMKq*0e!Y^;bt6G~S+ zJBg>#OcLyN!5!qU&ZM`#IssYpk}js$U=ci_)VQ)kc#wTH)*M8?HvplHyLcug#5-HC zkMVy(!dF`+#J-18fBq`p!xgTjQbPP%iro*T$$<;*hgb&}p77tXX^^(^KVz4+|IFC} z>t~Mt2hNAsdm{eXGd|j_n_2eLSjfAX<|_9h_-X$8eQm4rmtLjcOYoPXozxfUll+hg z<;|Y3mru+m+*`=wFqXNua0&Mow(p*3*N0HKC(7N^7Crv*7iLcj_g&!r(E1(lY=Wms zzzU7eS?ceAZQtWllHh={Nwj->!lkWrnvxPjgkjmFS@p3P1owa}gq;M)rAIPyJPm$U zNe*&8sY45tfl7>tqQte07d~3%3zR%XD9v?`Ya_%aj?bzzKmjFBozT%VkJv;?e8_tp zW?D!hU_o@pd%XAO5noD)5xxw6_K*e$2K@*4TDZS4!jw4g^6yQg^~#wc|}5GhlCxc|DqNkcsj5BW+sOe6yD^%|NnnEr0$LKMUaM>FEe?-fQYqXA0_Q<{#TPj8MZY>RSxrzDsGEFjHjJ2(ZRRVqngqDl#_36FzG7{8cxNkKT$aOJB z0un=v9}dVHqDxQtDESi8mB~Q5Y0QHGp+k>psk%wcJkVn8gUe{{4n=EQJFC5NBqtgK?gBI$?KPD zq+kOczjVCZWCdm%y#Sr=I~GubcCL;vlLjmG8rQ&JyeUk_aU1O9+bcp)9pSlJ(DIfu**-IHuJY5fBhz|1dQL5WgMLq-Nz?r-_Wi9mvBP}7Cxx35 zUiMeh(o?5r7km>1Pt(;*QoX)w@O_9pJl`c+Y9m)WZ@;6rjWs zSe14UOZaZNm3U!1J1Kc|ne-ured_IG6gR8sczKZ@NKN|z^O2+Jw3cPmuph80oR1I6 zK`v5;8z{ zXtz0dS@tsD5la|Y0QDfFF(~Pj&8NYo;k?ZY(ctSU@5&nr5 zAIG;YK`#0YiM&4lBoni>x{anw#CB)(i6`PA9?6-ewp^}<> ze1~k?jwI|Du_eTDfH!nodNg78I@X_h9l5rdZI`gy9B-e9qY<^~7HE&q-5j%p-$%x? zBdz5(jj(T}dRUN=@vAzS{R4y@V^J<-kTX#hR6ZMoos|x3Nn~~O9$J8~)5b5VvKD#~Dcv85x~xtdk literal 0 HcmV?d00001 diff --git a/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/package.json b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/package.json new file mode 100755 index 000000000..0d884eddb --- /dev/null +++ b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/package.json @@ -0,0 +1,18 @@ +{ + "name": "meta3d-input-runstopbutton-protocol", + "version": "0.20.0", + "description": "", + "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", + "author": "Meta3D", + "main": "src/Index.ts", + "license": "MIT", + "scripts": { + "watch": "tsc -w -noEmit", + "meta3d:publish_dev": "gulp publish_local_env", + "meta3d:publish_pro": "gulp publish_production_env" + }, + "keywords": [], + "devDependencies": { + "typescript": "^4.2.3" + } +} \ No newline at end of file diff --git a/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/src/Index.ts b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/src/Index.ts new file mode 100755 index 000000000..83247ca55 --- /dev/null +++ b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/src/Index.ts @@ -0,0 +1,7 @@ +import { inputFunc } from "meta3d-ui-protocol/src/contribute/InputContributeType" + +type isRun = boolean + +export type data = isRun + +export type func = inputFunc \ No newline at end of file diff --git a/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/tsconfig.json b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/tsconfig.json new file mode 100755 index 000000000..518e066d1 --- /dev/null +++ b/protocols/contribute_protocols/meta3d-input-runstopbutton-protocol/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "ES6", + "moduleResolution": "node", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "jsx": "react", + // "noEmit": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "lib": [ + "DOM", + "ESNext", + ], + "types": [], + "strict": true + }, + "include": [ + "./src" + ] +} \ No newline at end of file diff --git a/protocols/contribute_protocols/meta3d-ui-control-button-protocol/package.json b/protocols/contribute_protocols/meta3d-ui-control-button-protocol/package.json index 718f9712d..3b49a70dc 100755 --- a/protocols/contribute_protocols/meta3d-ui-control-button-protocol/package.json +++ b/protocols/contribute_protocols/meta3d-ui-control-button-protocol/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-control-button-protocol", - "version": "0.20.0", + "version": "0.20.1", "displayName": "button protocol", "repoLink": "https://github.com/Meta3D-Technology/Meta3D/tree/master/protocols/contribute_protocols/meta3d-ui-control-button-protocol", "description": "", diff --git a/protocols/contribute_protocols/meta3d-ui-control-button-protocol/src/Index.ts b/protocols/contribute_protocols/meta3d-ui-control-button-protocol/src/Index.ts index fad217c20..adb2fd811 100755 --- a/protocols/contribute_protocols/meta3d-ui-control-button-protocol/src/Index.ts +++ b/protocols/contribute_protocols/meta3d-ui-control-button-protocol/src/Index.ts @@ -6,7 +6,9 @@ export const uiControlName = "Button" export type state = null -export type inputData = { +export type inputFunc = null + +export type specificData = { rect: rect, label: string, } diff --git a/protocols/contribute_protocols/meta3d-ui-control-game-view-protocol/package.json b/protocols/contribute_protocols/meta3d-ui-control-game-view-protocol/package.json index f7cd0f01a..3d62d940a 100755 --- a/protocols/contribute_protocols/meta3d-ui-control-game-view-protocol/package.json +++ b/protocols/contribute_protocols/meta3d-ui-control-game-view-protocol/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-control-game-view-protocol", - "version": "0.20.0", + "version": "0.20.1", "displayName": "game view protocol", "repoLink": "https://github.com/Meta3D-Technology/Meta3D/tree/master/protocols/contribute_protocols/meta3d-ui-control-game-view-protocol", "description": "", diff --git a/protocols/contribute_protocols/meta3d-ui-control-game-view-protocol/src/Index.ts b/protocols/contribute_protocols/meta3d-ui-control-game-view-protocol/src/Index.ts index 4e76c262b..5da4381f9 100755 --- a/protocols/contribute_protocols/meta3d-ui-control-game-view-protocol/src/Index.ts +++ b/protocols/contribute_protocols/meta3d-ui-control-game-view-protocol/src/Index.ts @@ -9,7 +9,9 @@ export type state = { rect: rect, } -export type inputData = Merge diff --git a/protocols/contribute_protocols/meta3d-ui-control-runstopbutton-protocol/package.json b/protocols/contribute_protocols/meta3d-ui-control-runstopbutton-protocol/package.json index 1e7234563..958c53937 100755 --- a/protocols/contribute_protocols/meta3d-ui-control-runstopbutton-protocol/package.json +++ b/protocols/contribute_protocols/meta3d-ui-control-runstopbutton-protocol/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-control-runstopbutton-protocol", - "version": "0.20.0", + "version": "0.20.1", "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", "author": "Meta3D", "main": "src/Index.ts", diff --git a/protocols/contribute_protocols/meta3d-ui-control-runstopbutton-protocol/src/Index.ts b/protocols/contribute_protocols/meta3d-ui-control-runstopbutton-protocol/src/Index.ts index 796686410..2c0c9a4d1 100755 --- a/protocols/contribute_protocols/meta3d-ui-control-runstopbutton-protocol/src/Index.ts +++ b/protocols/contribute_protocols/meta3d-ui-control-runstopbutton-protocol/src/Index.ts @@ -1,5 +1,7 @@ import { rect } from "meta3d-type/src/contribute/UIControlProtocolConfigType" import { imguiImplTexture } from "meta3d-imgui-renderer-protocol/src/service/ServiceType" +import { func } from "meta3d-input-runstopbutton-protocol" +import { nullable } from "meta3d-commonlib-ts/src/nullable" export const uiControlName = "RunStopButton" @@ -8,7 +10,9 @@ export type state = { stopTexture: imguiImplTexture, } -export type inputData = { +export type inputFunc = nullable + +export type specificData = { rect: rect, label: string, } diff --git a/protocols/contribute_protocols/meta3d-ui-control-scene-view-protocol/package.json b/protocols/contribute_protocols/meta3d-ui-control-scene-view-protocol/package.json index e5fab53f6..7214a011a 100755 --- a/protocols/contribute_protocols/meta3d-ui-control-scene-view-protocol/package.json +++ b/protocols/contribute_protocols/meta3d-ui-control-scene-view-protocol/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-control-scene-view-protocol", - "version": "0.20.0", + "version": "0.20.1", "displayName": "scene view protocol", "publisher": "0xf63e1991A343814EdE505D7cfC368615EAe75307", "author": "Meta3D", diff --git a/protocols/contribute_protocols/meta3d-ui-control-scene-view-protocol/src/Index.ts b/protocols/contribute_protocols/meta3d-ui-control-scene-view-protocol/src/Index.ts index 2d5cf9f77..95993f0b5 100755 --- a/protocols/contribute_protocols/meta3d-ui-control-scene-view-protocol/src/Index.ts +++ b/protocols/contribute_protocols/meta3d-ui-control-scene-view-protocol/src/Index.ts @@ -24,7 +24,9 @@ export type state = { rect: rect, } -export type inputData = Merge diff --git a/protocols/contribute_protocols/meta3d-ui-control-window-protocol/package.json b/protocols/contribute_protocols/meta3d-ui-control-window-protocol/package.json index e2a8fcce0..1d07deb95 100755 --- a/protocols/contribute_protocols/meta3d-ui-control-window-protocol/package.json +++ b/protocols/contribute_protocols/meta3d-ui-control-window-protocol/package.json @@ -1,6 +1,6 @@ { "name": "meta3d-ui-control-window-protocol", - "version": "0.20.0", + "version": "0.20.1", "displayName": "window protocol", "repoLink": "https://github.com/Meta3D-Technology/Meta3D/tree/master/protocols/contribute_protocols/meta3d-ui-control-window-protocol", "description": "", diff --git a/protocols/contribute_protocols/meta3d-ui-control-window-protocol/src/Index.ts b/protocols/contribute_protocols/meta3d-ui-control-window-protocol/src/Index.ts index 5d8994cb9..fe71901b8 100755 --- a/protocols/contribute_protocols/meta3d-ui-control-window-protocol/src/Index.ts +++ b/protocols/contribute_protocols/meta3d-ui-control-window-protocol/src/Index.ts @@ -7,7 +7,9 @@ export type state = null type childrenFunc = (meta3dState: meta3dState) => Promise -export type inputData = { +export type inputFunc = null + +export type specificData = { rect: rect, label: string, childrenFunc: childrenFunc diff --git a/utils/meta3d-ui-utils/src/ElementStateUtils.ts b/utils/meta3d-ui-utils/src/ElementStateUtils.ts index ef2d60575..6c199bbdb 100755 --- a/utils/meta3d-ui-utils/src/ElementStateUtils.ts +++ b/utils/meta3d-ui-utils/src/ElementStateUtils.ts @@ -9,7 +9,7 @@ export let getActionState = (meta3dState: meta3dState, api: api, ac return getExn(getCurrentElementState(meta3dState))[actionName] as actionState } -export let getActionStateInUIControl = (meta3dState: meta3dState, api: api, actionName: string): nullable => { +export let getActionStateInInput = (meta3dState: meta3dState, api: api, actionName: string): nullable => { let { getCurrentElementState } = getExn(api.getPackageService(meta3dState, "meta3d-editor-whole-protocol")).ui(meta3dState) return bind(currentElementState => {