@live-change/vue3-components 0.8.81 → 0.8.83

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.
@@ -14,7 +14,7 @@
14
14
  </template>
15
15
 
16
16
  <script>
17
- import analytics from '../logic/analytics.js'
17
+ import analytics from '../logic/analytics.js'
18
18
  import debugLib from 'debug'
19
19
 
20
20
  const info = debugLib('working:info')
@@ -43,14 +43,14 @@ import analytics from '../logic/analytics.js'
43
43
  },
44
44
  methods: {
45
45
  workingStarted(task) {
46
- if(this.working.length == 0) {
46
+ if(this.working.length === 0) {
47
47
  analytics.emit('workingStarted', { task: task.name })
48
48
 
49
49
  info('WORKING STARTED!')
50
50
 
51
51
  const workingBlockId = this.workingBlockId
52
52
  this.loagindTimeout = setTimeout(() => {
53
- if(workingBlockId == this.workingBlockId && this.working.length > 0) {
53
+ if(workingBlockId === this.workingBlockId && this.working.length > 0) {
54
54
  this.connectionProblem = true
55
55
  analytics.emit('workingError', {
56
56
  task: "View working", reason: "connection problem",
@@ -67,12 +67,12 @@ import analytics from '../logic/analytics.js'
67
67
  workingFinished(task) {
68
68
  let id = this.working.indexOf(task)
69
69
  debug(`task finished ${task.name}`)
70
- if(id == -1) throw new Error("Task not found")
70
+ if(id === -1) throw new Error("Task not found")
71
71
  this.working.splice(id, 1)
72
72
 
73
73
  if(this.$allWorkingTasks)
74
74
  this.$allWorkingTasks.splice(this.$allWorkingTasks.indexOf(task), 1)
75
- if(this.working.length == 0) {
75
+ if(this.working.length === 0) {
76
76
  this.workingBlockId++
77
77
  clearTimeout(this.workingTimeout)
78
78
  analytics.emit('workingDone', { task: task.name })
@@ -88,7 +88,7 @@ import analytics from '../logic/analytics.js'
88
88
  analytics.emit('workingError', { task: task.name, reason })
89
89
 
90
90
  let id = this.working.indexOf(task)
91
- if(id == -1) {
91
+ if(id === -1) {
92
92
  this.errors.push({ task, reason: "unknown task "+task.name })
93
93
  throw new Error("Task not found")
94
94
  }
@@ -22,21 +22,26 @@ export function injectComponent(request, defaultComponent, factory) {
22
22
  if(!request) throw new Error("injectComponent: request is required")
23
23
  if(typeof request === 'string') request = { name: request }
24
24
 
25
+ console.log("INJECT COMPONENT", request)
26
+
25
27
  const filter = request.filter || (() => true)
26
28
  delete request.filter
27
29
 
28
30
  for(let key in request) {
29
31
  const provideKey = `component:${request.name}:${key}=${request[key]}`
32
+ console.log("INJECT COMPONENT PROVIDE KEY", provideKey)
30
33
  const component = inject(provideKey, null)
34
+ console.log("RESOLVED COMPONENT", component)
31
35
  if(!component) continue
32
36
  let isValid = true
33
- for(let key in component) {
37
+ for(let key in component.description) {
34
38
  const value = request[key]
35
39
  if(Array.isArray(value)) {
36
- if(!value.includes(component[key])) isValid = false
37
- } else if(value !== component[key]) isValid = false
40
+ if(!value.includes(component.description[key])) isValid = false
41
+ } else if(value !== component.description[key]) isValid = false
38
42
  }
39
- if(isValid && filter(component)) return component
43
+ console.log("RESLVED COMPONENT VALID", isValid)
44
+ if(isValid && filter(component)) return component.component
40
45
  }
41
46
  return factory ? defaultComponent() : defaultComponent
42
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/vue3-components",
3
- "version": "0.8.81",
3
+ "version": "0.8.83",
4
4
  "description": "Live Change Framework - vue components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,10 +21,10 @@
21
21
  },
22
22
  "homepage": "https://github.com/live-change/live-change-stack",
23
23
  "dependencies": {
24
- "@live-change/vue3-ssr": "^0.8.81",
24
+ "@live-change/vue3-ssr": "^0.8.83",
25
25
  "debug": "^4.3.4",
26
26
  "mitt": "3.0.1",
27
27
  "vue": "^3.4.29"
28
28
  },
29
- "gitHead": "bbc862b339eae9c68cb4b06cad0abdbb0405b409"
29
+ "gitHead": "a3c85f0869b4c65c2bdd6f181bdfcbe2d6f2bde5"
30
30
  }