hermes-io 2.9.85 → 2.9.87

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.
@@ -1 +1 @@
1
- function _extends(){return(_extends=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}import e from"../constants";var _obj,_window_addEventListener,_window,recording=!1,collection=[];export var listenersMap=new Map;var actions=((_obj={})[e.START_RECORDING]=function(){recording=!0},_obj[e.STOP_RECORDING]=function(){recording=!1},_obj[e.RESET_RECORDING]=function(){collection=[],recording=!1},_obj[e.SET_CONTEXT]=function(e){var n=e.id,t=void 0===n?"":n,r=collection.find(function(e){return e._internalId===t});if(r){if(r.isFromExternalRecording){var i=listenersMap.get(r.listener);return null==i?void 0:i({value:JSON.parse(r.value)})}return r.listener(r.value)}},_obj[e.LOAD_RECORDING]=function(e){collection=e.recording.map(function(e){return void 0===e&&(e={}),_extends({},e,{isFromExternalRecording:!0,_internalId:e.id})})},_obj);try{null==(_window=window)||null==(_window_addEventListener=_window.addEventListener)||_window_addEventListener.call(_window,"message",function(n){try{var t=n.data,r=t.source,i=t.payload;if(r===e.CHROME_EXTENSION){if(null==i?void 0:i.type)return actions[i.type](i);actions[i]()}}catch(e){console.error(e)}})}catch(e){console.error(e)}export var Context=function(n){var t=this;this.id=null,this._internalId=null,this.date=null,this.value=null,this.listener=null,this.stackTrace=null,this.update=function(e){var n=e.value,r=e.listener;t.date=new Date,t.value=n,t.stackTrace=t.getStackTrace(),t.listener=r,recording&&t.sendSnapshot()},this.sendSnapshot=function(){var n,r,i=t.takeSnapshot(),a=i.listener,o=i.stackTrace,l=i.value,c=i.date,s=i._internalId;collection.push(i);try{null==(r=window)||null==(n=r.postMessage)||n.call(r,{type:e.CONTEXT_SNAPSHOT,payload:{value:JSON.stringify(l.value),listener:a.name,stackTrace:o,date:c,id:s},source:"hermes-io"},"*")}catch(e){console.error(e)}},this.takeSnapshot=function(){return{_internalId:crypto.randomUUID(),value:t.value,date:t.date,listener:t.listener,stackTrace:t.stackTrace}},this.getStackTrace=function(){return Error().stack},this.id=Symbol(n)};
1
+ function _extends(){return(_extends=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}import e from"../constants.js";var _obj,_window_addEventListener,_window,recording=!1,collection=[];export var listenersMap=new Map;var actions=((_obj={})[e.START_RECORDING]=function(){recording=!0},_obj[e.STOP_RECORDING]=function(){recording=!1},_obj[e.RESET_RECORDING]=function(){collection=[],recording=!1},_obj[e.SET_CONTEXT]=function(e){var n=e.id,t=void 0===n?"":n,r=collection.find(function(e){return e._internalId===t});if(r){if(r.isFromExternalRecording){var i=listenersMap.get(r.listener);return null==i?void 0:i({value:JSON.parse(r.value)})}return r.listener(r.value)}},_obj[e.LOAD_RECORDING]=function(e){collection=e.recording.map(function(e){return void 0===e&&(e={}),_extends({},e,{isFromExternalRecording:!0,_internalId:e.id})})},_obj);try{null==(_window=window)||null==(_window_addEventListener=_window.addEventListener)||_window_addEventListener.call(_window,"message",function(n){try{var t=n.data,r=t.source,i=t.payload;if(r===e.CHROME_EXTENSION){if(null==i?void 0:i.type)return actions[i.type](i);actions[i]()}}catch(e){console.error(e)}})}catch(e){console.error(e)}export var Context=function(n){var t=this;this.id=null,this._internalId=null,this.date=null,this.value=null,this.listener=null,this.stackTrace=null,this.update=function(e){var n=e.value,r=e.listener;t.date=new Date,t.value=n,t.stackTrace=t.getStackTrace(),t.listener=r,recording&&t.sendSnapshot()},this.sendSnapshot=function(){var n,r,i=t.takeSnapshot(),a=i.listener,o=i.stackTrace,l=i.value,c=i.date,s=i._internalId;collection.push(i);try{null==(r=window)||null==(n=r.postMessage)||n.call(r,{type:e.CONTEXT_SNAPSHOT,payload:{value:JSON.stringify(l.value),listener:a.name,stackTrace:o,date:c,id:s},source:"hermes-io"},"*")}catch(e){console.error(e)}},this.takeSnapshot=function(){return{_internalId:crypto.randomUUID(),value:t.value,date:t.date,listener:t.listener,stackTrace:t.stackTrace}},this.getStackTrace=function(){return Error().stack},this.id=Symbol(n)};
@@ -1 +1 @@
1
- function _set_prototype_of(t,e){return(_set_prototype_of=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}import{Observer as t}from"../observer/observer";export var Store=function(t){var e=this,o=t.context,r=t.observer,n=t.id;this.context=null,this.observer=null,this.id=null,this.notify=function(t){return e.observer.notify({context:e.context,value:t})},this.query=function(){return console.log("method is not conencted to the reducer, please call useStore first")},this.mutate=function(){return console.log("method is not connected to the store, you need call useStore first")},this.id=n,this.context=o,this.observer=r};export var MicroStore=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.collection=new Map,e.add=function(t,o){return e.collection.set(t,o),o},e.remove=function(t){return e.collection.delete(t)},e.get=function(t){return e.collection.get(t)},e}return!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_set_prototype_of(t,e)}(e,t),e}(t);
1
+ function _set_prototype_of(t,e){return(_set_prototype_of=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}import{Observer as t}from"../observer/observer.js";export var Store=function(t){var e=this,o=t.context,r=t.observer,n=t.id;this.context=null,this.observer=null,this.id=null,this.notify=function(t){return e.observer.notify({context:e.context,value:t})},this.query=function(){return console.log("method is not conencted to the reducer, please call useStore first")},this.mutate=function(){return console.log("method is not connected to the store, you need call useStore first")},this.id=n,this.context=o,this.observer=r};export var MicroStore=function(t){function e(){var e;return e=t.apply(this,arguments)||this,e.collection=new Map,e.add=function(t,o){return e.collection.set(t,o),o},e.remove=function(t){return e.collection.delete(t)},e.get=function(t){return e.collection.get(t)},e}return!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_set_prototype_of(t,e)}(e,t),e}(t);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hermes-io",
3
- "version": "2.9.85",
3
+ "version": "2.9.87",
4
4
  "description": "A lightweight React library that allows communication between Reactjs components by using the observer pattern and the hook api",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",