From c6fd08895a7832015b7697756e8fd533aa70b653 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Sun, 10 Oct 2021 16:18:26 +0200 Subject: [PATCH] have to start thinking about assigning runtimes to components --- .r3_history | 10 +- dist/r3.js | 186 ++++++------------ package.json | 2 +- src/r3/r3-runtime/index.js | 12 +- ...me-js-d-o-m.js => r3-runtime-j-s-d-o-m.js} | 4 +- .../r3-runtime/r3-runtime-node-j-s-image.js | 113 ----------- ...me-document.js => r3-runtime-web-d-o-m.js} | 12 +- src/r3/r3-runtime/r3-runtime-web-image.js | 119 ----------- src/r3/r3-runtime/r3-runtime.js | 10 +- src/r3/r3-system/r3-system-render.js | 16 +- src/r3/r3-system/r3-system-runtime.js | 42 ++-- src/r3/r3.js | 4 +- test/R3.test.js | 12 +- version | 2 +- 14 files changed, 111 insertions(+), 433 deletions(-) rename src/r3/r3-runtime/{r3-runtime-js-d-o-m.js => r3-runtime-j-s-d-o-m.js} (97%) delete mode 100644 src/r3/r3-runtime/r3-runtime-node-j-s-image.js rename src/r3/r3-runtime/{r3-runtime-document.js => r3-runtime-web-d-o-m.js} (88%) delete mode 100644 src/r3/r3-runtime/r3-runtime-web-image.js diff --git a/.r3_history b/.r3_history index d1478e9..03b7f45 100644 --- a/.r3_history +++ b/.r3_history @@ -18,7 +18,6 @@ r3 create RuntimeCodeMirror runtime_extends RuntimeCoder ./r3-runtime/ r3 create RuntimeCoder runtime_base ./r3-runtime/ r3 create RuntimeControlKit runtime_extends RuntimeGUI ./r3-runtime/ r3 create RuntimeDOM runtime_base ./r3-runtime/ -r3 create RuntimeDocument runtime_extends RuntimeDOM ./r3-runtime/ r3 create RuntimeGUI runtime_base ./r3-runtime/ r3 create RuntimeGraphics runtime_base ./r3-runtime/ r3 create RuntimePhysics runtime_base ./r3-runtime/ @@ -35,10 +34,8 @@ r3 create SystemSocket system_extends System ./r3-system/ r3 create Utils base ./ r3 create SystemRender system_extends System ./r3-system/ r3 create SystemStorage system_extends System ./r3-system/ -r3 create RuntimeImage runtime_base ./r3-runtime/ -r3 create RuntimeWebImage runtime_extends RuntimeImage ./r3-runtime/ -r3 create RuntimeNodeJSImage runtime_extends RuntimeImage ./r3-runtime/ -r3 create Runtime base ./r3-runtime/ +r3 create RuntimeImage runtime_base ./r3-runtime/ +r3 create Runtime base ./r3-runtime/ r3 create ComponentCode component_extends Component ./r3-component/ r3 create R3Object object_base ./r3-object/ r3 create ComponentMaterial component_extends Component ./r3-component/ @@ -49,4 +46,5 @@ r3 create ComponentBufferGeometry component_extends ComponentGeometry ./r3-compo r3 create ComponentPlaneGeometry component_extends ComponentBufferGeometry ./r3-component/ r3 create Graph base ./ r3 create Node base ./ -r3 create RuntimeJsDOM runtime_extends RuntimeDOM ./r3-runtime/ +r3 create RuntimeJSDOM runtime_extends RuntimeDOM ./r3-runtime/ +r3 create RuntimeWebDOM runtime_extends RuntimeDOM ./r3-runtime/ diff --git a/dist/r3.js b/dist/r3.js index c300d89..7759dee 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -17,12 +17,12 @@ class R3 { /** * static Version - Current R3 version */ -R3.Version = '3.0.338'; +R3.Version = '3.0.346'; /** * static CompileDate - Current compile date of R3 */ -R3.CompileDate = '2021 Oct 10 - 15:24:05 pm'; +R3.CompileDate = '2021 Oct 10 - 16:15:59 pm'; class System { @@ -1269,21 +1269,21 @@ class SystemRuntime extends System { ) { if (SystemRuntime.CurrentProject === null) { - if (typeof process === 'undefined') { + if (SystemRuntime.ServerSide) { - if (!SystemRuntime.RuntimeDocument) { - SystemRuntime.RuntimeDocument = new RuntimeDocument(); + if (!SystemRuntime.RuntimeDOM.JS) { + SystemRuntime.RuntimeDOM.JS = new RuntimeJSDOM(); } - return SystemRuntime.RuntimeDocument; + return SystemRuntime.RuntimeDOM.JS; } else { - if (!SystemRuntime.RuntimeJsDOM) { - SystemRuntime.RuntimeJsDOM = new RuntimeJsDOM(); + if (!SystemRuntime.RuntimeDOM.Web) { + SystemRuntime.RuntimeDOM.Web = new RuntimeWebDOM(); } - return SystemRuntime.RuntimeJsDOM; + return SystemRuntime.RuntimeDOM.Web; } } else { @@ -1291,13 +1291,9 @@ class SystemRuntime extends System { } } - // if (object instanceof ComponentImage) { - // if (SystemRuntime.CurrentProject === null) { - // return new RuntimeWebImage(); - // } else { - // console.log('TODO: implement a project based Image runtime'); - // } - // } + if (object instanceof ComponentCode) { + + } } @@ -1399,16 +1395,6 @@ SystemRuntime.RuntimePhysics = {}; */ SystemRuntime.RuntimeStatistics = {}; -/** - * static RuntimeJsDOM - No comment - */ -SystemRuntime.RuntimeJsDOM = null; - -/** - * static RuntimeDocument - No comment - */ -SystemRuntime.RuntimeDocument = null; - class SystemSocket extends System { constructor(options) { @@ -1564,14 +1550,12 @@ Runtime.BASE_PHYSICS = 0x5; Runtime.BASE_SOCKET = 0x6; Runtime.BASE_STATISTICS = 0x7; Runtime.CODE_MIRROR = 0x8; -Runtime.DOCUMENT = 0x9; -Runtime.JS_DOM = 0xa; +Runtime.JSDOM = 0x9; +Runtime.WEB_DOM = 0xa; Runtime.CONTROL_KIT = 0xb; Runtime.THREE = 0xc; -Runtime.NODE_JS_IMAGE = 0xd; -Runtime.WEB_IMAGE = 0xe; -Runtime.BULLET = 0xf; -Runtime.STATS = 0x10; +Runtime.BULLET = 0xd; +Runtime.STATS = 0xe; class RuntimeCoder extends Runtime { @@ -1646,40 +1630,7 @@ class RuntimeDOM extends Runtime { } -class RuntimeDocument extends RuntimeDOM { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - super(options); - - Object.assign(this, options); - - } - - /** - * buildInstance() - * - Creates a runtime instance object based on the R3.Component representing it. - * @param component - */ - buildInstance(component) { - - if (component instanceof ComponentCanvas) { - let canvas = document.createElement('canvas'); - canvas.setAttribute('width', component.width); - canvas.setAttribute('height', component.height); - canvas.setAttribute('style', component.style); - return canvas; - } - - } - -} - -class RuntimeJsDOM extends RuntimeDOM { +class RuntimeJSDOM extends RuntimeDOM { constructor(options) { @@ -1719,6 +1670,46 @@ class RuntimeJsDOM extends RuntimeDOM { } +class RuntimeWebDOM extends RuntimeDOM { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + super(options); + + Object.assign(this, options); + + } + + /** + * buildInstance() + * - Creates a runtime instance object based on the R3.Component representing it. + * @param component + */ + buildInstance(component) { + + if (component instanceof ComponentCanvas) { + let canvas = document.createElement('canvas'); + canvas.setAttribute('width', component.width); + canvas.setAttribute('height', component.height); + canvas.setAttribute('style', component.style); + return canvas; + } + + if (component instanceof ComponentImage) { + let image = document.createElement('img'); + image.setAttribute('src', component.src); + image.setAttribute('alt', component.alt); + return image; + } + + } + +} + class RuntimeGUI extends Runtime { constructor(options) { @@ -1841,63 +1832,6 @@ class RuntimeImage extends Runtime { } -class RuntimeNodeJSImage extends RuntimeImage { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - super(options); - - Object.assign(this, options); - - } - - /** - * buildInstance() - * - Creates a runtime instance object based on the R3.Component representing it. - * @param component - */ - buildInstance(component) { - - } - -} - -class RuntimeWebImage extends RuntimeImage { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - super(options); - - Object.assign(this, options); - - } - - /** - * buildInstance() - * - Creates a runtime instance object based on the R3.Component representing it. - * @param component - */ - buildInstance(component) { - - if (component instanceof R3.Component.Graphics.Image) { - let image = document.createElement('img'); - image.setAttribute('src', component.src); - image.setAttribute('alt', component.alt); - return image; - } - - } - -} - class RuntimePhysics extends Runtime { constructor(options) { @@ -6799,15 +6733,13 @@ R3Object.Component.Texture = ComponentTexture; Runtime.Coder = RuntimeCoder; Runtime.Coder.CodeMirror = RuntimeCodeMirror; Runtime.DOM = RuntimeDOM; -Runtime.DOM.Document = RuntimeDocument; -Runtime.DOM.JsDOM = RuntimeJsDOM; +Runtime.DOM.JSDOM = RuntimeJSDOM; +Runtime.DOM.WebDOM = RuntimeWebDOM; Runtime.GUI = RuntimeGUI; Runtime.GUI.ControlKit = RuntimeControlKit; Runtime.Graphics = RuntimeGraphics; Runtime.Graphics.Three = RuntimeThree; Runtime.Image = RuntimeImage; -Runtime.Image.NodeJSImage = RuntimeNodeJSImage; -Runtime.Image.WebImage = RuntimeWebImage; Runtime.Physics = RuntimePhysics; Runtime.Physics.Bullet = RuntimeBullet; Runtime.Socket = RuntimeSocket; diff --git a/package.json b/package.json index 18ac1b1..01daf31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version": "3.0.339", + "version": "3.0.346", "description": "", "private": true, "dependencies": { diff --git a/src/r3/r3-runtime/index.js b/src/r3/r3-runtime/index.js index d9364bd..287dd68 100644 --- a/src/r3/r3-runtime/index.js +++ b/src/r3/r3-runtime/index.js @@ -3,15 +3,13 @@ const Runtime = require('./r3-runtime.js'); const RuntimeCoder = require('./r3-runtime-coder.js'); const RuntimeCodeMirror = require('./r3-runtime-code-mirror.js'); const RuntimeDOM = require('./r3-runtime-d-o-m.js'); -const RuntimeDocument = require('./r3-runtime-document.js'); -const RuntimeJsDOM = require('./r3-runtime-js-d-o-m.js'); +const RuntimeJSDOM = require('./r3-runtime-j-s-d-o-m.js'); +const RuntimeWebDOM = require('./r3-runtime-web-d-o-m.js'); const RuntimeGUI = require('./r3-runtime-g-u-i.js'); const RuntimeControlKit = require('./r3-runtime-control-kit.js'); const RuntimeGraphics = require('./r3-runtime-graphics.js'); const RuntimeThree = require('./r3-runtime-three.js'); const RuntimeImage = require('./r3-runtime-image.js'); -const RuntimeNodeJSImage = require('./r3-runtime-node-j-s-image.js'); -const RuntimeWebImage = require('./r3-runtime-web-image.js'); const RuntimePhysics = require('./r3-runtime-physics.js'); const RuntimeBullet = require('./r3-runtime-bullet.js'); const RuntimeSocket = require('./r3-runtime-socket.js'); @@ -23,15 +21,13 @@ const RuntimeStats = require('./r3-runtime-stats.js'); Runtime.Coder = RuntimeCoder; Runtime.Coder.CodeMirror = RuntimeCodeMirror; Runtime.DOM = RuntimeDOM; -Runtime.DOM.Document = RuntimeDocument; -Runtime.DOM.JsDOM = RuntimeJsDOM; +Runtime.DOM.JSDOM = RuntimeJSDOM; +Runtime.DOM.WebDOM = RuntimeWebDOM; Runtime.GUI = RuntimeGUI; Runtime.GUI.ControlKit = RuntimeControlKit; Runtime.Graphics = RuntimeGraphics; Runtime.Graphics.Three = RuntimeThree; Runtime.Image = RuntimeImage; -Runtime.Image.NodeJSImage = RuntimeNodeJSImage; -Runtime.Image.WebImage = RuntimeWebImage; Runtime.Physics = RuntimePhysics; Runtime.Physics.Bullet = RuntimeBullet; Runtime.Socket = RuntimeSocket; diff --git a/src/r3/r3-runtime/r3-runtime-js-d-o-m.js b/src/r3/r3-runtime/r3-runtime-j-s-d-o-m.js similarity index 97% rename from src/r3/r3-runtime/r3-runtime-js-d-o-m.js rename to src/r3/r3-runtime/r3-runtime-j-s-d-o-m.js index 7c4a882..ea656c4 100644 --- a/src/r3/r3-runtime/r3-runtime-js-d-o-m.js +++ b/src/r3/r3-runtime/r3-runtime-j-s-d-o-m.js @@ -45,7 +45,7 @@ const RuntimeDOM = require('./r3-runtime-d-o-m.js'); **/ -class RuntimeJsDOM extends RuntimeDOM { +class RuntimeJSDOM extends RuntimeDOM { //GENERATED_CONSTRUCTOR_START constructor(options) { @@ -127,4 +127,4 @@ class RuntimeJsDOM extends RuntimeDOM { //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END -module.exports = RuntimeJsDOM; +module.exports = RuntimeJSDOM; diff --git a/src/r3/r3-runtime/r3-runtime-node-j-s-image.js b/src/r3/r3-runtime/r3-runtime-node-j-s-image.js deleted file mode 100644 index 93cdae7..0000000 --- a/src/r3/r3-runtime/r3-runtime-node-j-s-image.js +++ /dev/null @@ -1,113 +0,0 @@ -//GENERATED_IMPORTS_START -//GENERATED_IMPORTS_END - -//CUSTOM_IMPORTS_START -//CUSTOM_IMPORTS_END - -const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); -const RuntimeImage = require('./r3-runtime-image.js'); - -/** - - GENERATED_INHERITED_START - - GENERATED_INHERITED_END - - TEMPLATE_OPTIONS_START - TEMPLATE_OPTIONS_END - - CUSTOM_OPTIONS_START - CUSTOM_OPTIONS_END - - TEMPLATE_STATIC_OPTIONS_START - TEMPLATE_STATIC_OPTIONS_END - - CUSTOM_STATIC_OPTIONS_START - CUSTOM_STATIC_OPTIONS_END - - TEMPLATE_METHODS_START - buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it. - TEMPLATE_METHODS_END - - CUSTOM_METHODS_START - CUSTOM_METHODS_END - - TEMPLATE_STATIC_METHODS_START - TEMPLATE_STATIC_METHODS_END - - CUSTOM_STATIC_METHODS_START - CUSTOM_STATIC_METHODS_END - - **/ - -class RuntimeNodeJSImage extends RuntimeImage { - - //GENERATED_CONSTRUCTOR_START - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - super(options); - - //GENERATED_TEMPLATE_OPTIONS_INIT_START - //GENERATED_TEMPLATE_OPTIONS_INIT_END - - //GENERATED_OPTIONS_INIT_START - //GENERATED_OPTIONS_INIT_END - - Object.assign(this, options); - - } - //GENERATED_CONSTRUCTOR_END - - //GENERATED_TEMPLATE_METHODS_START - - /** - * buildInstance() - * - Creates a runtime instance object based on the R3.Component representing it. - * @param component - */ - buildInstance(component) { - - //GENERATED_BUILD_INSTANCE_METHOD_START - //GENERATED_BUILD_INSTANCE_METHOD_END - - //CUSTOM_BUILD_INSTANCE_METHOD_START - //CUSTOM_BUILD_INSTANCE_METHOD_END - - //GENERATED_BUILD_INSTANCE_METHOD_AFTER_START - //GENERATED_BUILD_INSTANCE_METHOD_AFTER_END - - } - //GENERATED_TEMPLATE_METHODS_END - - //GENERATED_METHODS_START - //GENERATED_METHODS_END - - //GENERATED_TEMPLATE_STATIC_METHODS_START - //GENERATED_TEMPLATE_STATIC_METHODS_END - - //GENERATED_STATIC_METHODS_START - //GENERATED_STATIC_METHODS_END - - //CUSTOM_IMPLEMENTATION_START - //CUSTOM_IMPLEMENTATION_END - -} - -//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START -//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END - -//GENERATED_STATIC_OPTIONS_INIT_START -//GENERATED_STATIC_OPTIONS_INIT_END - -//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START -//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END - -//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START -//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END - -module.exports = RuntimeNodeJSImage; diff --git a/src/r3/r3-runtime/r3-runtime-document.js b/src/r3/r3-runtime/r3-runtime-web-d-o-m.js similarity index 88% rename from src/r3/r3-runtime/r3-runtime-document.js rename to src/r3/r3-runtime/r3-runtime-web-d-o-m.js index 7e39c41..284b803 100644 --- a/src/r3/r3-runtime/r3-runtime-document.js +++ b/src/r3/r3-runtime/r3-runtime-web-d-o-m.js @@ -3,6 +3,7 @@ //CUSTOM_IMPORTS_START const ComponentCanvas = require('../r3-component/r3-component-canvas'); +const ComponentImage = require('../r3-component/r3-component-image'); //CUSTOM_IMPORTS_END const Event = require('.././r3-event'); @@ -42,7 +43,7 @@ const RuntimeDOM = require('./r3-runtime-d-o-m.js'); **/ -class RuntimeDocument extends RuntimeDOM { +class RuntimeWebDOM extends RuntimeDOM { //GENERATED_CONSTRUCTOR_START constructor(options) { @@ -84,6 +85,13 @@ class RuntimeDocument extends RuntimeDOM { canvas.setAttribute('style', component.style); return canvas; } + + if (component instanceof ComponentImage) { + let image = document.createElement('img'); + image.setAttribute('src', component.src); + image.setAttribute('alt', component.alt); + return image; + } //CUSTOM_BUILD_INSTANCE_METHOD_END //GENERATED_BUILD_INSTANCE_METHOD_AFTER_START @@ -118,4 +126,4 @@ class RuntimeDocument extends RuntimeDOM { //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END -module.exports = RuntimeDocument; +module.exports = RuntimeWebDOM; diff --git a/src/r3/r3-runtime/r3-runtime-web-image.js b/src/r3/r3-runtime/r3-runtime-web-image.js deleted file mode 100644 index 14c180e..0000000 --- a/src/r3/r3-runtime/r3-runtime-web-image.js +++ /dev/null @@ -1,119 +0,0 @@ -//GENERATED_IMPORTS_START -//GENERATED_IMPORTS_END - -//CUSTOM_IMPORTS_START -//CUSTOM_IMPORTS_END - -const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); -const RuntimeImage = require('./r3-runtime-image.js'); - -/** - - GENERATED_INHERITED_START - - GENERATED_INHERITED_END - - TEMPLATE_OPTIONS_START - TEMPLATE_OPTIONS_END - - CUSTOM_OPTIONS_START - CUSTOM_OPTIONS_END - - TEMPLATE_STATIC_OPTIONS_START - TEMPLATE_STATIC_OPTIONS_END - - CUSTOM_STATIC_OPTIONS_START - CUSTOM_STATIC_OPTIONS_END - - TEMPLATE_METHODS_START - buildInstance(component) - Creates a runtime instance object based on the R3.Component representing it. - TEMPLATE_METHODS_END - - CUSTOM_METHODS_START - CUSTOM_METHODS_END - - TEMPLATE_STATIC_METHODS_START - TEMPLATE_STATIC_METHODS_END - - CUSTOM_STATIC_METHODS_START - CUSTOM_STATIC_METHODS_END - - **/ - -class RuntimeWebImage extends RuntimeImage { - - //GENERATED_CONSTRUCTOR_START - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - super(options); - - //GENERATED_TEMPLATE_OPTIONS_INIT_START - //GENERATED_TEMPLATE_OPTIONS_INIT_END - - //GENERATED_OPTIONS_INIT_START - //GENERATED_OPTIONS_INIT_END - - Object.assign(this, options); - - } - //GENERATED_CONSTRUCTOR_END - - //GENERATED_TEMPLATE_METHODS_START - - /** - * buildInstance() - * - Creates a runtime instance object based on the R3.Component representing it. - * @param component - */ - buildInstance(component) { - - //GENERATED_BUILD_INSTANCE_METHOD_START - //GENERATED_BUILD_INSTANCE_METHOD_END - - //CUSTOM_BUILD_INSTANCE_METHOD_START - if (component instanceof R3.Component.Graphics.Image) { - let image = document.createElement('img'); - image.setAttribute('src', component.src); - image.setAttribute('alt', component.alt); - return image; - } - //CUSTOM_BUILD_INSTANCE_METHOD_END - - //GENERATED_BUILD_INSTANCE_METHOD_AFTER_START - //GENERATED_BUILD_INSTANCE_METHOD_AFTER_END - - } - //GENERATED_TEMPLATE_METHODS_END - - //GENERATED_METHODS_START - //GENERATED_METHODS_END - - //GENERATED_TEMPLATE_STATIC_METHODS_START - //GENERATED_TEMPLATE_STATIC_METHODS_END - - //GENERATED_STATIC_METHODS_START - //GENERATED_STATIC_METHODS_END - - //CUSTOM_IMPLEMENTATION_START - //CUSTOM_IMPLEMENTATION_END - -} - -//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START -//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END - -//GENERATED_STATIC_OPTIONS_INIT_START -//GENERATED_STATIC_OPTIONS_INIT_END - -//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START -//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END - -//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START -//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END - -module.exports = RuntimeWebImage; diff --git a/src/r3/r3-runtime/r3-runtime.js b/src/r3/r3-runtime/r3-runtime.js index 823a9ad..eabd339 100644 --- a/src/r3/r3-runtime/r3-runtime.js +++ b/src/r3/r3-runtime/r3-runtime.js @@ -97,14 +97,12 @@ Runtime.BASE_PHYSICS = 0x5; Runtime.BASE_SOCKET = 0x6; Runtime.BASE_STATISTICS = 0x7; Runtime.CODE_MIRROR = 0x8; -Runtime.DOCUMENT = 0x9; -Runtime.JS_DOM = 0xa; +Runtime.JSDOM = 0x9; +Runtime.WEB_DOM = 0xa; Runtime.CONTROL_KIT = 0xb; Runtime.THREE = 0xc; -Runtime.NODE_JS_IMAGE = 0xd; -Runtime.WEB_IMAGE = 0xe; -Runtime.BULLET = 0xf; -Runtime.STATS = 0x10; +Runtime.BULLET = 0xd; +Runtime.STATS = 0xe; //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/r3/r3-system/r3-system-render.js b/src/r3/r3-system/r3-system-render.js index 3f68e01..b7d45c6 100644 --- a/src/r3/r3-system/r3-system-render.js +++ b/src/r3/r3-system/r3-system-render.js @@ -4,8 +4,7 @@ //CUSTOM_IMPORTS_START const ComponentDOM = require('../r3-component/r3-component-d-o-m'); const ComponentImage = require('../r3-component/r3-component-image'); -const RuntimeDocument = require('../r3-runtime/r3-runtime-document'); -const RuntimeWebImage = require('../r3-runtime/r3-runtime-web-image'); +const RuntimeWebDOM = require('../r3-runtime/r3-runtime-web-d-o-m'); //CUSTOM_IMPORTS_END const Event = require('.././r3-event'); @@ -170,18 +169,15 @@ class SystemRender extends System { //GENERATED_STATIC_ON_INSTANCE_CREATED_METHOD_END //CUSTOM_STATIC_ON_INSTANCE_CREATED_METHOD_START - if (object instanceof ComponentDOM) { - if (object.runtime instanceof RuntimeDocument) { + if ( + object instanceof ComponentDOM || + object instanceof ComponentImage + ) { + if (object.runtime instanceof RuntimeWebDOM) { document.body.appendChild(object.instance); } } - if (object instanceof ComponentImage) { - if (object.runtime instanceof RuntimeWebImage) { - document.body.appendChild(object.instance); - } - } - //CUSTOM_STATIC_ON_INSTANCE_CREATED_METHOD_END } diff --git a/src/r3/r3-system/r3-system-runtime.js b/src/r3/r3-system/r3-system-runtime.js index 75e9db3..5e8be5d 100644 --- a/src/r3/r3-system/r3-system-runtime.js +++ b/src/r3/r3-system/r3-system-runtime.js @@ -5,9 +5,9 @@ const ComponentDOM = require('../r3-component/r3-component-d-o-m.js'); const ComponentInput = require('../r3-component/r3-component-input.js'); const ComponentImage = require('../r3-component/r3-component-image.js'); -const RuntimeDocument = require('../r3-runtime/r3-runtime-document.js'); -const RuntimeWebImage = require('../r3-runtime/r3-runtime-web-image.js'); -const RuntimeJsDOM = require('../r3-runtime/r3-runtime-js-d-o-m.js'); +const ComponentCode = require('../r3-component/r3-component-code.js'); +const RuntimeWebDOM = require('../r3-runtime/r3-runtime-web-d-o-m.js'); +const RuntimeJSDOM = require('../r3-runtime/r3-runtime-j-s-d-o-m.js'); const Utils = require('.././r3-utils.js'); //CUSTOM_IMPORTS_END @@ -41,8 +41,6 @@ const System = require('./r3-system.js'); RuntimeGraphics={} RuntimePhysics={} RuntimeStatistics={} - RuntimeJsDOM=null - RuntimeDocument=null CUSTOM_STATIC_OPTIONS_END CUSTOM_EVENT_LISTENERS_START @@ -241,19 +239,19 @@ class SystemRuntime extends System { if (SystemRuntime.ServerSide) { - if (!SystemRuntime.RuntimeJsDOM) { - SystemRuntime.RuntimeJsDOM = new RuntimeJsDOM(); + if (!SystemRuntime.RuntimeDOM.JS) { + SystemRuntime.RuntimeDOM.JS = new RuntimeJSDOM(); } - return SystemRuntime.RuntimeJsDOM; + return SystemRuntime.RuntimeDOM.JS; } else { - if (!SystemRuntime.RuntimeDocument) { - SystemRuntime.RuntimeDocument = new RuntimeDocument(); + if (!SystemRuntime.RuntimeDOM.Web) { + SystemRuntime.RuntimeDOM.Web = new RuntimeWebDOM(); } - return SystemRuntime.RuntimeDocument; + return SystemRuntime.RuntimeDOM.Web; } } else { @@ -261,13 +259,11 @@ class SystemRuntime extends System { } } - // if (object instanceof ComponentImage) { - // if (SystemRuntime.CurrentProject === null) { - // return new RuntimeWebImage(); - // } else { - // console.log('TODO: implement a project based Image runtime'); - // } - // } + + + if (object instanceof ComponentCode) { + + } //CUSTOM_STATIC_ON_GET_RUNTIME_METHOD_END } @@ -387,16 +383,6 @@ SystemRuntime.RuntimePhysics = {}; */ SystemRuntime.RuntimeStatistics = {}; -/** - * static RuntimeJsDOM - No comment - */ -SystemRuntime.RuntimeJsDOM = null; - -/** - * static RuntimeDocument - No comment - */ -SystemRuntime.RuntimeDocument = null; - //GENERATED_STATIC_OPTIONS_INIT_END //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/r3/r3.js b/src/r3/r3.js index 2490b54..6731448 100644 --- a/src/r3/r3.js +++ b/src/r3/r3.js @@ -90,12 +90,12 @@ class R3 { /** * static Version - Current R3 version */ -R3.Version = '3.0.338'; +R3.Version = '3.0.346'; /** * static CompileDate - Current compile date of R3 */ -R3.CompileDate = '2021 Oct 10 - 15:24:05 pm'; +R3.CompileDate = '2021 Oct 10 - 16:15:59 pm'; //GENERATED_STATIC_OPTIONS_INIT_END diff --git a/test/R3.test.js b/test/R3.test.js index a1a5b51..6eaf49b 100644 --- a/test/R3.test.js +++ b/test/R3.test.js @@ -25,15 +25,13 @@ const EntitySlider = require('../src/r3/r3-entity/./r3-entity-slider.js'); const RuntimeCoder = require('../src/r3/r3-runtime/./r3-runtime-coder.js'); const RuntimeCodeMirror = require('../src/r3/r3-runtime/./r3-runtime-code-mirror.js'); const RuntimeDOM = require('../src/r3/r3-runtime/./r3-runtime-d-o-m.js'); -const RuntimeDocument = require('../src/r3/r3-runtime/./r3-runtime-document.js'); -const RuntimeJsDOM = require('../src/r3/r3-runtime/./r3-runtime-js-d-o-m.js'); +const RuntimeJSDOM = require('../src/r3/r3-runtime/./r3-runtime-j-s-d-o-m.js'); +const RuntimeWebDOM = require('../src/r3/r3-runtime/./r3-runtime-web-d-o-m.js'); const RuntimeGUI = require('../src/r3/r3-runtime/./r3-runtime-g-u-i.js'); const RuntimeControlKit = require('../src/r3/r3-runtime/./r3-runtime-control-kit.js'); const RuntimeGraphics = require('../src/r3/r3-runtime/./r3-runtime-graphics.js'); const RuntimeThree = require('../src/r3/r3-runtime/./r3-runtime-three.js'); const RuntimeImage = require('../src/r3/r3-runtime/./r3-runtime-image.js'); -const RuntimeNodeJSImage = require('../src/r3/r3-runtime/./r3-runtime-node-j-s-image.js'); -const RuntimeWebImage = require('../src/r3/r3-runtime/./r3-runtime-web-image.js'); const RuntimePhysics = require('../src/r3/r3-runtime/./r3-runtime-physics.js'); const RuntimeBullet = require('../src/r3/r3-runtime/./r3-runtime-bullet.js'); const RuntimeSocket = require('../src/r3/r3-runtime/./r3-runtime-socket.js'); @@ -118,15 +116,13 @@ describe('R3 Tests', () => { const runtimeCoder = new RuntimeCoder(); const runtimeCodeMirror = new RuntimeCodeMirror(); const runtimeDOM = new RuntimeDOM(); - const runtimeDocument = new RuntimeDocument(); - const runtimeJsDOM = new RuntimeJsDOM(); + const runtimeJSDOM = new RuntimeJSDOM(); + const runtimeWebDOM = new RuntimeWebDOM(); const runtimeGUI = new RuntimeGUI(); const runtimeControlKit = new RuntimeControlKit(); const runtimeGraphics = new RuntimeGraphics(); const runtimeThree = new RuntimeThree(); const runtimeImage = new RuntimeImage(); - const runtimeNodeJSImage = new RuntimeNodeJSImage(); - const runtimeWebImage = new RuntimeWebImage(); const runtimePhysics = new RuntimePhysics(); const runtimeBullet = new RuntimeBullet(); const runtimeSocket = new RuntimeSocket(); diff --git a/version b/version index 0d6ca30..1f89cf2 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.0.339 \ No newline at end of file +3.0.346 \ No newline at end of file