@knowlearning/agents 0.9.36 → 0.9.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.9.36",
3
+ "version": "0.9.37",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",
@@ -26,6 +26,10 @@ export default {
26
26
  mode: {
27
27
  type: String,
28
28
  required: false
29
+ },
30
+ environmentProxy: {
31
+ type: Function,
32
+ required: false
29
33
  }
30
34
  },
31
35
  data() {
@@ -59,9 +63,9 @@ export default {
59
63
 
60
64
  this.iframe = iframe
61
65
  this.embedding = Agent.embed({ id, mode }, iframe)
66
+ this.embedding.on('environment', e => this.environmentProxy ? this.environmentProxy(e) : Agent.environment(e))
62
67
  this.embedding.on('state', e => this.$emit('state', e))
63
68
  this.embedding.on('mutate', e => this.$emit('mutate', e))
64
- this.embedding.on('environment', e => this.$emit('environment', e))
65
69
  this.embedding.on('close', e => this.$emit('close', e))
66
70
  }
67
71
  }