diff --git a/dist/index.html b/dist/index.html index fb69c6d..5298dbc 100644 --- a/dist/index.html +++ b/dist/index.html @@ -30,6 +30,7 @@ window.addEventListener("load", function(){ let canvas = new R3.Canvas(); let image = new R3.Image(); + let touch = new R3.Touch(); let slider = new R3.Entity.Slider( { canvas : null diff --git a/dist/r3.js b/dist/r3.js index e6cab09..ee8dd4b 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '3.0.73'; - static compileDate = '2021 Sep 24 - 07:04:55 am'; + static version = '3.0.74'; + static compileDate = '2021 Sep 24 - 07:23:19 am'; } class Runtime { @@ -1857,7 +1857,14 @@ class SystemRuntime extends System { */ static OnGetRuntime(object) { - if (object instanceof R3.Component.DOM) { + /** + * DOM and Input Components are typically managed through + * the DOM. + */ + if ( + object instanceof R3.Component.DOM || + object instanceof R3.Component.Input + ) { if (SystemRuntime.CurrentProject === null) { return new R3.Runtime.DOM.Document(); } else { @@ -1865,7 +1872,7 @@ class SystemRuntime extends System { } } - if (object instanceof R3.Image) { + if (object instanceof R3.Component.Graphics.Image) { if (SystemRuntime.CurrentProject === null) { return new R3.Runtime.Image.WebImage(); } else { @@ -2442,16 +2449,17 @@ Event.RESTART = 0x21; Event.SLIDER_ENTITY_INITIALIZED = 0x22; Event.START = 0x23; Event.TOUCH_CANCEL = 0x24; -Event.TOUCH_END = 0x25; -Event.TOUCH_MOVE = 0x26; -Event.TOUCH_START = 0x27; -Event.UPDATE_FROM_INSTANCE_AFTER = 0x28; -Event.UPDATE_FROM_INSTANCE_BEFORE = 0x29; -Event.UPDATE_INSTANCE_AFTER = 0x2a; -Event.UPDATE_INSTANCE_BEFORE = 0x2b; -Event.UPDATE_INSTANCE_PROPERTY = 0x2c; -Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x2d; -Event.MAX_EVENTS = 0x2e; +Event.TOUCH_COMPONENT_INITIALIZED = 0x25; +Event.TOUCH_END = 0x26; +Event.TOUCH_MOVE = 0x27; +Event.TOUCH_START = 0x28; +Event.UPDATE_FROM_INSTANCE_AFTER = 0x29; +Event.UPDATE_FROM_INSTANCE_BEFORE = 0x2a; +Event.UPDATE_INSTANCE_AFTER = 0x2b; +Event.UPDATE_INSTANCE_BEFORE = 0x2c; +Event.UPDATE_INSTANCE_PROPERTY = 0x2d; +Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x2e; +Event.MAX_EVENTS = 0x2f; Event.GetEventName = function(eventId) { @@ -2492,15 +2500,16 @@ Event.GetEventName = function(eventId) { case 0x22 : return 'slider_entity_initialized'; case 0x23 : return 'start'; case 0x24 : return 'touch_cancel'; - case 0x25 : return 'touch_end'; - case 0x26 : return 'touch_move'; - case 0x27 : return 'touch_start'; - case 0x28 : return 'update_from_instance_after'; - case 0x29 : return 'update_from_instance_before'; - case 0x2a : return 'update_instance_after'; - case 0x2b : return 'update_instance_before'; - case 0x2c : return 'update_instance_property'; - case 0x2d : return 'update_property_from_instance'; + case 0x25 : return 'touch_component_initialized'; + case 0x26 : return 'touch_end'; + case 0x27 : return 'touch_move'; + case 0x28 : return 'touch_start'; + case 0x29 : return 'update_from_instance_after'; + case 0x2a : return 'update_from_instance_before'; + case 0x2b : return 'update_instance_after'; + case 0x2c : return 'update_instance_before'; + case 0x2d : return 'update_instance_property'; + case 0x2e : return 'update_property_from_instance'; default : throw new Error('Event type not defined : ' + eventId); } @@ -2930,6 +2939,8 @@ Entity.MAX_ENTITY = 0x1; - canvas (Default value null - The Canvas Component to which this entity binds its custom code components) + - touch (Default value null - The slider component reacts to TOUCH Events, for this a touch + component is required) - images (Default value [] - The Image Components which will be used to slide from one image to the next) @@ -2945,8 +2956,9 @@ Entity.MAX_ENTITY = 0x1; - images=[R3.Image] - We need a list of at least one image which to slide - canvas=R3.Canvas - We need a canvas to attach our Input events + images=[R3.Image] - We need a list of at least one Image which to slide + canvas=R3.Canvas - We need a Canvas to attach our Input events + touch=R3.Touch - We need a Touch Component to respond to TOUCH Events **/ @@ -3028,6 +3040,12 @@ class EntitySlider extends Entity { if (typeof options.canvas === 'undefined') { options.canvas = null; } + /** + * touch - The slider component reacts to TOUCH Events, for this a touch component is required + */ + if (typeof options.touch === 'undefined') { + options.touch = null; + } /** * images - The Image Components which will be used to slide from one image to the next */ @@ -3040,7 +3058,7 @@ class EntitySlider extends Entity { } /** - * images - We need a list of at least one image which to slide + * images - We need a list of at least one Image which to slide */ options.required.images = [R3.Image]; this.imagesBackup = options.images; @@ -3075,7 +3093,7 @@ class EntitySlider extends Entity { } } ) /** - * canvas - We need a canvas to attach our Input events + * canvas - We need a Canvas to attach our Input events */ options.required.canvas = R3.Canvas; this.canvasBackup = options.canvas; @@ -3109,6 +3127,41 @@ class EntitySlider extends Entity { return this.canvasBackup; } } + ) /** + * touch - We need a Touch Component to respond to TOUCH Events + */ + options.required.touch = R3.Touch; + this.touchBackup = options.touch; + Object.defineProperty( + this, + 'touch', + { + configurable : true, + enumerable : true, + set: function(x) { + Event.Emit( + Event.ENTITY_PROPERTY_UPDATE, + { + entity : this, + property : 'touch', + value : x + } + ); + this.touchBackup = x; + Event.Emit( + Event.ENTITY_PROPERTY_UPDATED, + { + entity : this, + property : 'touch', + value : x + } + ); + return x; + }, + get : function() { + return this.touchBackup; + } + } ) this.underConstruction = true; @@ -5999,7 +6052,7 @@ class ComponentInput extends Component { Properties: - + - canvas (Default value null - A Touch Component requires a Canvas component to bind to.) Static Properties: @@ -6056,6 +6109,13 @@ class ComponentTouch extends ComponentInput { super(options); + /** + * canvas - A Touch Component requires a Canvas component to bind to. + */ + if (typeof options.canvas === 'undefined') { + options.canvas = null; + } + Object.assign(this, options); if (options.callDepth === 0) { @@ -6074,6 +6134,8 @@ class ComponentTouch extends ComponentInput { super.initialize(); + Event.Emit(Event.TOUCH_COMPONENT_INITIALIZED, this); + if (this.initializeDepth === this.maxDepth) { if (this instanceof R3.Component) { @@ -6099,6 +6161,21 @@ class ComponentTouch extends ComponentInput { this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + if (property === 'canvas') { + this.instance.canvas = this.canvas; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : 'canvas', + instanceProperty : 'canvas' + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_INSTANCE_AFTER, this); } @@ -6112,6 +6189,21 @@ class ComponentTouch extends ComponentInput { this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + if (property === 'canvas' || property === 'all') { + this.canvas = this.instance.canvas; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : 'canvas', + instanceProperty : 'canvas' + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); } diff --git a/package.json b/package.json index 03cf5a7..14782bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version" : "3.0.73", + "version" : "3.0.74", "description": "", "private": true, "dependencies": { diff --git a/src/r3/r3-component/r3-component-canvas.js b/src/r3/r3-component/r3-component-canvas.js index d0f5533..b891b88 100644 --- a/src/r3/r3-component/r3-component-canvas.js +++ b/src/r3/r3-component/r3-component-canvas.js @@ -138,6 +138,9 @@ const ComponentDOM = require('.././r3-component-d-o-m.js'); style='border:1px solid #00bb00;' CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END diff --git a/src/r3/r3-component/r3-component-code.js b/src/r3/r3-component/r3-component-code.js index 86d4845..bae4c3a 100644 --- a/src/r3/r3-component/r3-component-code.js +++ b/src/r3/r3-component/r3-component-code.js @@ -112,6 +112,9 @@ const Component = require('.././r3-component.js'); CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END diff --git a/src/r3/r3-component/r3-component-d-o-m.js b/src/r3/r3-component/r3-component-d-o-m.js index 649f7be..7ea24b5 100644 --- a/src/r3/r3-component/r3-component-d-o-m.js +++ b/src/r3/r3-component/r3-component-d-o-m.js @@ -114,6 +114,9 @@ const Component = require('.././r3-component.js'); instance=null - Holds the current instance of this object as determined (built) by the runtime object. CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END diff --git a/src/r3/r3-component/r3-component-graphics.js b/src/r3/r3-component/r3-component-graphics.js index ce49219..4fa5b21 100644 --- a/src/r3/r3-component/r3-component-graphics.js +++ b/src/r3/r3-component/r3-component-graphics.js @@ -112,6 +112,9 @@ const Component = require('.././r3-component.js'); CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END diff --git a/src/r3/r3-component/r3-component-image.js b/src/r3/r3-component/r3-component-image.js index 2234eff..45dd710 100644 --- a/src/r3/r3-component/r3-component-image.js +++ b/src/r3/r3-component/r3-component-image.js @@ -157,6 +157,9 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); orientation='square' - The orientation of the image, one of 'square', 'landscape', 'portrait' CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END diff --git a/src/r3/r3-component/r3-component-input.js b/src/r3/r3-component/r3-component-input.js index 015c9c1..85dd8d7 100644 --- a/src/r3/r3-component/r3-component-input.js +++ b/src/r3/r3-component/r3-component-input.js @@ -112,6 +112,9 @@ const Component = require('.././r3-component.js'); CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END diff --git a/src/r3/r3-component/r3-component-material.js b/src/r3/r3-component/r3-component-material.js index 78d89da..f8e72a2 100644 --- a/src/r3/r3-component/r3-component-material.js +++ b/src/r3/r3-component/r3-component-material.js @@ -130,6 +130,9 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END diff --git a/src/r3/r3-component/r3-component-mesh.js b/src/r3/r3-component/r3-component-mesh.js index 66da9a1..81a2d27 100644 --- a/src/r3/r3-component/r3-component-mesh.js +++ b/src/r3/r3-component/r3-component-mesh.js @@ -130,6 +130,9 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END diff --git a/src/r3/r3-component/r3-component-texture.js b/src/r3/r3-component/r3-component-texture.js index a97f683..4d3ba41 100644 --- a/src/r3/r3-component/r3-component-texture.js +++ b/src/r3/r3-component/r3-component-texture.js @@ -130,6 +130,9 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END diff --git a/src/r3/r3-component/r3-component-touch.js b/src/r3/r3-component/r3-component-touch.js index c12b1e5..0db0d9b 100644 --- a/src/r3/r3-component/r3-component-touch.js +++ b/src/r3/r3-component/r3-component-touch.js @@ -105,7 +105,7 @@ const ComponentInput = require('.././r3-component-input.js'); Properties: - + - canvas (Default value null - A Touch Component requires a Canvas component to bind to.) Static Properties: @@ -128,8 +128,12 @@ const ComponentInput = require('.././r3-component-input.js'); TEMPLATE_OPTIONS_END CUSTOM_OPTIONS_START + canvas=null - A Touch Component requires a Canvas component to bind to. CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END @@ -213,6 +217,12 @@ class ComponentTouch extends ComponentInput { super(options); //GENERATED_OPTIONS_INIT_START + /** + * canvas - A Touch Component requires a Canvas component to bind to. + */ + if (typeof options.canvas === 'undefined') { + options.canvas = null; + } //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -247,6 +257,7 @@ class ComponentTouch extends ComponentInput { //GENERATED_INITIALIZE_METHOD_END //CUSTOM_INITIALIZE_METHOD_START + Event.Emit(Event.TOUCH_COMPONENT_INITIALIZED, this); //CUSTOM_INITIALIZE_METHOD_END //GENERATED_INITIALIZE_METHOD_AFTER_START @@ -278,6 +289,20 @@ class ComponentTouch extends ComponentInput { this.emit(Event.UPDATE_INSTANCE_BEFORE, this); //GENERATED_UPDATE_INSTANCE_OPTIONS_START + if (property === 'canvas') { + this.instance.canvas = this.canvas; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : 'canvas', + instanceProperty : 'canvas' + } + ); + if (property !== 'all') { + return; + } + } //GENERATED_UPDATE_INSTANCE_OPTIONS_END //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START @@ -305,6 +330,20 @@ class ComponentTouch extends ComponentInput { this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'canvas' || property === 'all') { + this.canvas = this.instance.canvas; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : 'canvas', + instanceProperty : 'canvas' + } + ); + if (property !== 'all') { + return; + } + } //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START diff --git a/src/r3/r3-entity/r3-entity-slider.js b/src/r3/r3-entity/r3-entity-slider.js index e563aae..f0492f5 100644 --- a/src/r3/r3-entity/r3-entity-slider.js +++ b/src/r3/r3-entity/r3-entity-slider.js @@ -89,6 +89,8 @@ const Entity = require('.././r3-entity.js'); - canvas (Default value null - The Canvas Component to which this entity binds its custom code components) + - touch (Default value null - The slider component reacts to TOUCH Events, for this a touch + component is required) - images (Default value [] - The Image Components which will be used to slide from one image to the next) @@ -118,9 +120,16 @@ const Entity = require('.././r3-entity.js'); CUSTOM_OPTIONS_START canvas=null - The Canvas Component to which this entity binds its custom code components + touch=null - The slider component reacts to TOUCH Events, for this a touch component is required images=[] - The Image Components which will be used to slide from one image to the next CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + images=[R3.Image] - We need a list of at least one Image which to slide + canvas=R3.Canvas - We need a Canvas to attach our Input events + touch=R3.Touch - We need a Touch Component to respond to TOUCH Events + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END @@ -137,11 +146,6 @@ const Entity = require('.././r3-entity.js'); CUSTOM_METHODS_START CUSTOM_METHODS_END - CUSTOM_REQUIRED_COMPONENTS_START - images=[R3.Image] - We need a list of at least one image which to slide - canvas=R3.Canvas - We need a canvas to attach our Input events - CUSTOM_REQUIRED_COMPONENTS_END - TEMPLATE_STATIC_METHODS_START TEMPLATE_STATIC_METHODS_END @@ -239,6 +243,12 @@ class EntitySlider extends Entity { if (typeof options.canvas === 'undefined') { options.canvas = null; } + /** + * touch - The slider component reacts to TOUCH Events, for this a touch component is required + */ + if (typeof options.touch === 'undefined') { + options.touch = null; + } /** * images - The Image Components which will be used to slide from one image to the next */ @@ -253,7 +263,7 @@ class EntitySlider extends Entity { //GENERATED_REQUIRED_COMPONENTS_START /** - * images - We need a list of at least one image which to slide + * images - We need a list of at least one Image which to slide */ options.required.images = [R3.Image]; this.imagesBackup = options.images; @@ -288,7 +298,7 @@ class EntitySlider extends Entity { } } ) /** - * canvas - We need a canvas to attach our Input events + * canvas - We need a Canvas to attach our Input events */ options.required.canvas = R3.Canvas; this.canvasBackup = options.canvas; @@ -322,6 +332,41 @@ class EntitySlider extends Entity { return this.canvasBackup; } } + ) /** + * touch - We need a Touch Component to respond to TOUCH Events + */ + options.required.touch = R3.Touch; + this.touchBackup = options.touch; + Object.defineProperty( + this, + 'touch', + { + configurable : true, + enumerable : true, + set: function(x) { + Event.Emit( + Event.ENTITY_PROPERTY_UPDATE, + { + entity : this, + property : 'touch', + value : x + } + ); + this.touchBackup = x; + Event.Emit( + Event.ENTITY_PROPERTY_UPDATED, + { + entity : this, + property : 'touch', + value : x + } + ); + return x; + }, + get : function() { + return this.touchBackup; + } + } ) //GENERATED_REQUIRED_COMPONENTS_END diff --git a/src/r3/r3-event.js b/src/r3/r3-event.js index c49739f..55a7f68 100644 --- a/src/r3/r3-event.js +++ b/src/r3/r3-event.js @@ -381,16 +381,17 @@ Event.RESTART = 0x21; Event.SLIDER_ENTITY_INITIALIZED = 0x22; Event.START = 0x23; Event.TOUCH_CANCEL = 0x24; -Event.TOUCH_END = 0x25; -Event.TOUCH_MOVE = 0x26; -Event.TOUCH_START = 0x27; -Event.UPDATE_FROM_INSTANCE_AFTER = 0x28; -Event.UPDATE_FROM_INSTANCE_BEFORE = 0x29; -Event.UPDATE_INSTANCE_AFTER = 0x2a; -Event.UPDATE_INSTANCE_BEFORE = 0x2b; -Event.UPDATE_INSTANCE_PROPERTY = 0x2c; -Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x2d; -Event.MAX_EVENTS = 0x2e; +Event.TOUCH_COMPONENT_INITIALIZED = 0x25; +Event.TOUCH_END = 0x26; +Event.TOUCH_MOVE = 0x27; +Event.TOUCH_START = 0x28; +Event.UPDATE_FROM_INSTANCE_AFTER = 0x29; +Event.UPDATE_FROM_INSTANCE_BEFORE = 0x2a; +Event.UPDATE_INSTANCE_AFTER = 0x2b; +Event.UPDATE_INSTANCE_BEFORE = 0x2c; +Event.UPDATE_INSTANCE_PROPERTY = 0x2d; +Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x2e; +Event.MAX_EVENTS = 0x2f; Event.GetEventName = function(eventId) { @@ -431,15 +432,16 @@ Event.GetEventName = function(eventId) { case 0x22 : return 'slider_entity_initialized'; case 0x23 : return 'start'; case 0x24 : return 'touch_cancel'; - case 0x25 : return 'touch_end'; - case 0x26 : return 'touch_move'; - case 0x27 : return 'touch_start'; - case 0x28 : return 'update_from_instance_after'; - case 0x29 : return 'update_from_instance_before'; - case 0x2a : return 'update_instance_after'; - case 0x2b : return 'update_instance_before'; - case 0x2c : return 'update_instance_property'; - case 0x2d : return 'update_property_from_instance'; + case 0x25 : return 'touch_component_initialized'; + case 0x26 : return 'touch_end'; + case 0x27 : return 'touch_move'; + case 0x28 : return 'touch_start'; + case 0x29 : return 'update_from_instance_after'; + case 0x2a : return 'update_from_instance_before'; + case 0x2b : return 'update_instance_after'; + case 0x2c : return 'update_instance_before'; + case 0x2d : return 'update_instance_property'; + case 0x2e : return 'update_property_from_instance'; default : throw new Error('Event type not defined : ' + eventId); } diff --git a/src/r3/r3-r3.js b/src/r3/r3-r3.js index 5bfc859..0826171 100644 --- a/src/r3/r3-r3.js +++ b/src/r3/r3-r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '3.0.73'; - static compileDate = '2021 Sep 24 - 07:04:55 am'; + static version = '3.0.74'; + static compileDate = '2021 Sep 24 - 07:23:19 am'; } //GENERATED_IMPORTS_START diff --git a/src/r3/r3-system/r3-system-runtime.js b/src/r3/r3-system/r3-system-runtime.js index f958d12..c42a26e 100644 --- a/src/r3/r3-system/r3-system-runtime.js +++ b/src/r3/r3-system/r3-system-runtime.js @@ -231,7 +231,14 @@ class SystemRuntime extends System { //GENERATED_STATIC_ON_GET_RUNTIME_METHOD_END //CUSTOM_STATIC_ON_GET_RUNTIME_METHOD_START - if (object instanceof R3.Component.DOM) { + /** + * DOM and Input Components are typically managed through + * the DOM. + */ + if ( + object instanceof R3.Component.DOM || + object instanceof R3.Component.Input + ) { if (SystemRuntime.CurrentProject === null) { return new R3.Runtime.DOM.Document(); } else { @@ -239,7 +246,7 @@ class SystemRuntime extends System { } } - if (object instanceof R3.Image) { + if (object instanceof R3.Component.Graphics.Image) { if (SystemRuntime.CurrentProject === null) { return new R3.Runtime.Image.WebImage(); } else { diff --git a/src/templates/component_extends.template b/src/templates/component_extends.template index 81d66da..987108e 100644 --- a/src/templates/component_extends.template +++ b/src/templates/component_extends.template @@ -17,6 +17,9 @@ const EXTEND_CLASS = require('INCLUDE_PATH/EXTEND_CLASS_FILE_NAME'); CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END diff --git a/src/templates/entity_extends.template b/src/templates/entity_extends.template index 08faa0f..7d82bde 100644 --- a/src/templates/entity_extends.template +++ b/src/templates/entity_extends.template @@ -21,6 +21,9 @@ const EXTEND_CLASS = require('INCLUDE_PATH/EXTEND_CLASS_FILE_NAME'); CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + CUSTOM_REQUIRED_COMPONENTS_START + CUSTOM_REQUIRED_COMPONENTS_END + TEMPLATE_STATIC_OPTIONS_START TEMPLATE_STATIC_OPTIONS_END @@ -37,9 +40,6 @@ const EXTEND_CLASS = require('INCLUDE_PATH/EXTEND_CLASS_FILE_NAME'); CUSTOM_METHODS_START CUSTOM_METHODS_END - CUSTOM_REQUIRED_COMPONENTS_START - CUSTOM_REQUIRED_COMPONENTS_END - TEMPLATE_STATIC_METHODS_START TEMPLATE_STATIC_METHODS_END diff --git a/version b/version index 9ad03a7..b8a51c0 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.0.73 \ No newline at end of file +3.0.74 \ No newline at end of file