unreal-toolkit 0.1.6 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@ with your hosted Unreal Engine streaming web application.
4
4
 
5
5
  <a href="https://www.npmjs.com/package/unreal-toolkit-next">Next Edition (ES6)</a>
6
6
  <br/>
7
- <a href="https://github.com/UnrealJS/UnrealToolkit/tree/master/Runtime">Browser Edition (CDN)</a>
7
+ <a href="https://github.com/MackeyK24/UnrealToolkit/tree/master/Runtime">Browser Edition (CDN)</a>
8
8
 
9
9
 
10
10
  ## Default Installation (UMD)
package/dist/index.d.ts CHANGED
@@ -24,8 +24,7 @@ export declare class UnrealToolkit {
24
24
  * @class UnrealMessageBus - All rights reserved (c) 2024 Mackey Kinard
25
25
  */
26
26
  export declare class UnrealMessageBus {
27
- /** Unreal Message Bus API Key */
28
- static ApiKey: string;
27
+ RequiredOrigin: string;
29
28
  constructor();
30
29
  /** Handle event bus message
31
30
  * @param message The message to handle
@@ -40,7 +39,7 @@ export declare class UnrealMessageBus {
40
39
  * @param transfer The transfer to post
41
40
  * @returns void
42
41
  */
43
- PostMessage(message: string, data?: string): void;
42
+ PostMessage(message: string, data?: string, targetOrigin?: string): void;
44
43
  /** Remove event bus message handler
45
44
  * @param message The message to remove
46
45
  * @param handler The handler to remove
@@ -24,8 +24,7 @@ export declare class UnrealToolkit {
24
24
  * @class UnrealMessageBus - All rights reserved (c) 2024 Mackey Kinard
25
25
  */
26
26
  export declare class UnrealMessageBus {
27
- /** Unreal Message Bus API Key */
28
- static ApiKey: string;
27
+ RequiredOrigin: string;
29
28
  constructor();
30
29
  /** Handle event bus message
31
30
  * @param message The message to handle
@@ -40,7 +39,7 @@ export declare class UnrealMessageBus {
40
39
  * @param transfer The transfer to post
41
40
  * @returns void
42
41
  */
43
- PostMessage(message: string, data?: string): void;
42
+ PostMessage(message: string, data?: string, targetOrigin?: string): void;
44
43
  /** Remove event bus message handler
45
44
  * @param message The message to remove
46
45
  * @param handler The handler to remove
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.TOOLKIT=n():e.TOOLKIT=n()}(this,(()=>(()=>{"use strict";var e={d:(n,t)=>{for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n)},n={};e.d(n,{default:()=>i});var t=function(){function e(){}return Object.defineProperty(e,"EventBus",{get:function(){return null==e._EventBus&&(e._EventBus=new o),e._EventBus},enumerable:!1,configurable:!0}),e._EventBus=null,e}(),o=function(){function e(){this.ListenerDictionary={},window&&window.top?(this.HandleWindowMessage=this.HandleWindowMessage.bind(this),window.top.addEventListener("message",this.HandleWindowMessage)):console.warn("UnrealMessageBus: No Top Window Available")}return e.prototype.OnMessage=function(e,n){var t;null==this.ListenerDictionary[e]?(t=[],this.ListenerDictionary[e]=t):t=this.ListenerDictionary[e],t.findIndex((function(e){return n==e}))<0&&t.push(n)},e.prototype.PostMessage=function(n,t){window&&window.top?window.top.postMessage({source:"unrealmessagebus",message:n,data:t,key:e.ApiKey}):console.warn("UnrealMessageBus: No Top Window Available")},e.prototype.RemoveHandler=function(e,n){var t=this.ListenerDictionary[e];if(null!=t){var o=t.findIndex((function(e){return n==e}));o>=0&&t.splice(o,1)}},e.prototype.ResetHandlers=function(){this.ListenerDictionary={}},e.prototype.Dispose=function(){this.ResetHandlers(),window&&window.top&&window.top.removeEventListener("message",this.HandleWindowMessage)},e.prototype.HandleWindowMessage=function(n){if(null!=n&&null!=n.data&&null!=n.data.message&&null!=n.data.source&&"unrealmessagebus"==n.data.source){if(null!=e.ApiKey&&""!==e.ApiKey&&(null==n.data.key||""===n.data.key||n.data.key!=e.ApiKey))return void console.warn("UnrealMessageBus: Missing Or Invalid API Key");this.OnDispatchMessage(n.data.message,null!=n.data.data?n.data.data:null)}},e.prototype.OnDispatchMessage=function(e,n){void 0===n&&(n=null);var t=this.ListenerDictionary[e];null!=t&&t.forEach((function(e){try{e&&e(n)}catch(e){console.warn(e)}}))},e.ApiKey=null,e}();"undefined"!=typeof window&&(window.UnrealToolkit=t),console.log("Unreal Toolkit Runtime - Version 0.0.1");const i=t;return n.default})()));
1
+ !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.UnrealToolkit=n():e.UnrealToolkit=n()}(this,(()=>(()=>{"use strict";var e={d:(n,t)=>{for(var i in t)e.o(t,i)&&!e.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:t[i]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n)},n={};e.d(n,{default:()=>o});var t=function(){function e(){}return Object.defineProperty(e,"EventBus",{get:function(){return null==e._EventBus&&(e._EventBus=new i),e._EventBus},enumerable:!1,configurable:!0}),e._EventBus=null,e}(),i=function(){function e(){this.RequiredOrigin="*",this.ListenerDictionary={},window&&window.top?(this.HandleWindowMessage=this.HandleWindowMessage.bind(this),window.top.addEventListener("message",this.HandleWindowMessage)):console.warn("UnrealMessageBus: No Top Window Available")}return e.prototype.OnMessage=function(e,n){var t;null==this.ListenerDictionary[e]?(t=[],this.ListenerDictionary[e]=t):t=this.ListenerDictionary[e],t.findIndex((function(e){return n==e}))<0&&t.push(n)},e.prototype.PostMessage=function(e,n,t){void 0===t&&(t="*"),window&&window.top?window.top.postMessage({source:"unrealmessagebus",message:e,data:n},t):console.warn("UnrealMessageBus: No Top Window Available")},e.prototype.RemoveHandler=function(e,n){var t=this.ListenerDictionary[e];if(null!=t){var i=t.findIndex((function(e){return n==e}));i>=0&&t.splice(i,1)}},e.prototype.ResetHandlers=function(){this.ListenerDictionary={}},e.prototype.Dispose=function(){this.ResetHandlers(),window&&window.top&&window.top.removeEventListener("message",this.HandleWindowMessage)},e.prototype.HandleWindowMessage=function(e){null!=e&&null!=e.data&&(!0==(null!=this.RequiredOrigin&&""!==this.RequiredOrigin&&"*"!==this.RequiredOrigin)&&e.origin!==this.RequiredOrigin||null!=e.data.message&&null!=e.data.source&&"unrealmessagebus"==e.data.source&&this.OnDispatchMessage(e.data.message,null!=e.data.data?e.data.data:null))},e.prototype.OnDispatchMessage=function(e,n){void 0===n&&(n=null);var t=this.ListenerDictionary[e];null!=t&&t.forEach((function(e){try{e&&e(n)}catch(e){console.warn(e)}}))},e}();console.log("Unreal Toolkit Runtime - Version 0.1.8");const o=t;return n.default})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unreal-toolkit",
3
- "version": "0.1.6",
3
+ "version": "0.1.11",
4
4
  "description": "Unreal Toolkit Runtime Library (UMD)",
5
5
  "main": "dist/unreal.toolkit.js",
6
6
  "types": "dist/index.d.ts",