theprogrammablemind_4wp 9.3.0-beta.37 → 9.3.0-beta.39

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
@@ -69,6 +69,6 @@
69
69
  "sort-json": "^2.0.0",
70
70
  "uuid": "^8.3.2"
71
71
  },
72
- "version": "9.3.0-beta.37",
72
+ "version": "9.3.0-beta.39",
73
73
  "license": "UNLICENSED"
74
74
  }
package/src/config.js CHANGED
@@ -3185,6 +3185,12 @@ class Config {
3185
3185
  more.generators.map( (g) => g.km = km )
3186
3186
  }
3187
3187
  }
3188
+ const normalizeIsA = (edge) => {
3189
+ if (edge.length == 3 || edge.parent || edge.child) {
3190
+ return edge
3191
+ }
3192
+ return [...edge, false]
3193
+ }
3188
3194
  for (const key of Object.keys(more)) {
3189
3195
  const value = more[key]
3190
3196
  // TODO remove name and description on the config bag
@@ -3228,9 +3234,9 @@ class Config {
3228
3234
  const hierarchy = this.config.words.hierarchy
3229
3235
  const moreHierarchy = more.words.hierarchy
3230
3236
  if (addFirst) {
3231
- this.config.words.hierarchy = moreHierarchy.concat(hierarchy)
3237
+ this.config.words.hierarchy = moreHierarchy.concat(hierarchy.map(normalizeIsA))
3232
3238
  } else {
3233
- this.config.words.hierarchy = hierarchy.concat(moreHierarchy)
3239
+ this.config.words.hierarchy = hierarchy.concat(moreHierarchy.map(normalizeIsA))
3234
3240
  }
3235
3241
  }
3236
3242
  } else if (key === 'name') {
@@ -3302,7 +3308,9 @@ class Config {
3302
3308
  // console.log('more', JSON.stringify(more, null, 2))
3303
3309
  // hierarchy must update in place and does not care about the list order
3304
3310
  if (key === 'hierarchy') {
3305
- this.config[key].push(...more[key])
3311
+ const moreEdges = more[key].map(normalizeIsA)
3312
+ this.config[key].push(...moreEdges)
3313
+ this.hierarchy.addEdges(moreEdges)
3306
3314
  } else {
3307
3315
  if (addFirst) {
3308
3316
  this.config[key] = more[key].concat(this.config[key])
@@ -257,18 +257,18 @@ const setupProcessB = ({ config, initializer, allowDelta = false, rebuildingTemp
257
257
  const setupContexts = (rawContexts) => {
258
258
  let first = true
259
259
  const contexts = []
260
- contexts.push({ marker: 'controlStart', controlRemove: true })
260
+ contexts.push({ marker: 'controlStart', controlRemove: true, isControl: true })
261
261
  let previous
262
262
  for (const context of rawContexts) {
263
263
  if (first) {
264
264
  first = false
265
265
  } else {
266
- contexts.push({ marker: 'controlBetween', controlRemove: true, previous })
266
+ contexts.push({ marker: 'controlBetween', controlRemove: true, isControl: true, previous })
267
267
  }
268
268
  contexts.push(context)
269
269
  previous = context
270
270
  }
271
- contexts.push({ marker: 'controlEnd', controlRemove: true, previous })
271
+ contexts.push({ marker: 'controlEnd', controlRemove: true, isControl: true, previous })
272
272
 
273
273
  let _index = 0
274
274
  const id = (context) => {
@@ -441,8 +441,8 @@ const loadInstance = async (config, instance) => {
441
441
  */
442
442
 
443
443
  // const { /* data, generators, semantics, */ hierarchy } = setupProcessB({ config })
444
- const hierarchy = config.hierarchy
445
444
  for (const i in (instance.resultss || [])) {
445
+ const hierarchy = config.hierarchy
446
446
  const results = instance.resultss[i]
447
447
  if (results.extraConfig) {
448
448
  // config.addInternal(results, useOldVersion = true, skipObjects = false, includeNamespaces = true, allowNameToBeNull = false)
package/src/debug.js CHANGED
@@ -31,12 +31,12 @@ const wasHit = (name) => {
31
31
  return hits[name]
32
32
  }
33
33
 
34
- const counter = (name, breakAt = [], debugBreak = true) => {
34
+ const counter = (name, { breakAt=[], debugBreak=true, tag='' } = {}) => {
35
35
  if (!counters[name]) {
36
36
  counters[name] = 0
37
37
  }
38
38
  counters[name] += 1
39
- console.log(`counters[${name}] = ${counters[name]}`)
39
+ console.log(`counters[${name}] = ${counters[name]} ${tag}`)
40
40
  unhit(name)
41
41
  if (Array.isArray(breakAt) && breakAt.includes(counters[name])) {
42
42
  if (debugBreak) {