mftsccs-browser 2.0.2-beta → 2.0.4-beta

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.
@@ -17371,6 +17371,7 @@ function publishMessage(topic, message) {
17371
17371
  __webpack_require__.r(__webpack_exports__);
17372
17372
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17373
17373
  /* harmony export */ FormatFromConnectionsAlteredArrayExternal: () => (/* binding */ FormatFromConnectionsAlteredArrayExternal),
17374
+ /* harmony export */ FormatFunctionData: () => (/* binding */ FormatFunctionData),
17374
17375
  /* harmony export */ FormatFunctionDataForData: () => (/* binding */ FormatFunctionDataForData)
17375
17376
  /* harmony export */ });
17376
17377
  /* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../app */ "./src/app.ts");
@@ -17481,10 +17482,12 @@ function FormatFunctionDataForData(connections_1, compositionData_1) {
17481
17482
  let mytype = (_h = (_g = toTheConcept === null || toTheConcept === void 0 ? void 0 : toTheConcept.type) === null || _g === void 0 ? void 0 : _g.characterValue) !== null && _h !== void 0 ? _h : "none";
17482
17483
  let value = toTheConcept.characterValue;
17483
17484
  let dataCharacter = linkerConcept.characterValue;
17485
+ let isComp = false;
17484
17486
  // if there is not connection type defined then put the type of the destination concept.
17485
17487
  if (dataCharacter == "") {
17486
17488
  dataCharacter = mytype;
17487
17489
  dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);
17490
+ isComp = true;
17488
17491
  }
17489
17492
  let data = {
17490
17493
  "id": toTheConcept.id,
@@ -17492,14 +17495,19 @@ function FormatFunctionDataForData(connections_1, compositionData_1) {
17492
17495
  [mytype]: value
17493
17496
  }
17494
17497
  };
17495
- if (dataCharacter.includes("_s_")) {
17496
- // do nothing
17498
+ if (isNaN(Number(dataCharacter))) {
17499
+ if (dataCharacter.includes("_s_")) {
17500
+ // do nothing
17501
+ }
17502
+ else {
17503
+ if (typeof newData[key] == "string") {
17504
+ newData[key] = {};
17505
+ }
17506
+ newData[key][dataCharacter] = data;
17507
+ }
17497
17508
  }
17498
17509
  else {
17499
- if (typeof newData[key] == "string") {
17500
- newData[key] = {};
17501
- }
17502
- newData[key][dataCharacter] = data;
17510
+ newData[key] = [];
17503
17511
  }
17504
17512
  }
17505
17513
  catch (ex) {
@@ -17523,7 +17531,7 @@ function FormatFunctionDataForData(connections_1, compositionData_1) {
17523
17531
  */
17524
17532
  function FormatFromConnectionsAlteredArrayExternal(connections_1, compositionData_1, newCompositionData_1, mainComposition_1) {
17525
17533
  return __awaiter(this, arguments, void 0, function* (connections, compositionData, newCompositionData, mainComposition, reverse = []) {
17526
- var _a, _b, _c, _d;
17534
+ var _a, _b, _c, _d, _e, _f, _g;
17527
17535
  let startTime = new Date().getTime();
17528
17536
  let mainData = [];
17529
17537
  let myConcepts = [];
@@ -17614,23 +17622,43 @@ function FormatFromConnectionsAlteredArrayExternal(connections_1, compositionDat
17614
17622
  newData[key] = {};
17615
17623
  compositionData[connections[i].ofTheConceptId] = newData;
17616
17624
  }
17625
+ let isComp = true;
17626
+ let linkerConceptValue = linkerConcept.characterValue;
17627
+ if (linkerConceptValue == "") {
17628
+ linkerConceptValue = toTheConcept.characterValue;
17629
+ isComp = true;
17630
+ }
17631
+ if (linkerConceptValue == "") {
17632
+ linkerConceptValue = (_e = toTheConcept === null || toTheConcept === void 0 ? void 0 : toTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue;
17633
+ }
17617
17634
  try {
17618
- let isComp = compositionData[connections[i].toTheConceptId];
17619
- if (isComp) {
17635
+ let mytype = (_g = (_f = toTheConcept === null || toTheConcept === void 0 ? void 0 : toTheConcept.type) === null || _f === void 0 ? void 0 : _f.characterValue) !== null && _g !== void 0 ? _g : "none";
17636
+ let myData = compositionData[connections[i].toTheConceptId];
17637
+ if (myData) {
17620
17638
  let data = {
17621
17639
  "id": toTheConcept.id,
17622
17640
  "data": compositionData[connections[i].toTheConceptId]
17623
17641
  };
17624
- if (Array.isArray(newData[key][linkerConcept.characterValue])) {
17625
- newData[key][linkerConcept.characterValue].push(data);
17642
+ if (Array.isArray(newData[key])) {
17643
+ if (isComp) {
17644
+ newData[key].push(myData);
17645
+ }
17646
+ else {
17647
+ newData[key].push(myData);
17648
+ }
17626
17649
  }
17627
17650
  else {
17628
- if (linkerConcept.characterValue.includes("_s_")) {
17629
- newData[key][linkerConcept.characterValue] = [];
17651
+ if (Array.isArray(newData[key][linkerConceptValue])) {
17630
17652
  newData[key][linkerConcept.characterValue].push(data);
17631
17653
  }
17632
17654
  else {
17633
- newData[key][linkerConcept.characterValue] = data;
17655
+ if (linkerConceptValue.includes("_s_")) {
17656
+ newData[key][linkerConceptValue] = [];
17657
+ newData[key][linkerConceptValue].push(data);
17658
+ }
17659
+ else {
17660
+ newData[key][linkerConceptValue] = data;
17661
+ }
17634
17662
  }
17635
17663
  }
17636
17664
  }
@@ -17651,6 +17679,97 @@ function FormatFromConnectionsAlteredArrayExternal(connections_1, compositionDat
17651
17679
  return mainData;
17652
17680
  });
17653
17681
  }
17682
+ /**
17683
+ * ## Format DATA-ID ##
17684
+ * this function takes in connections and creates a single level objects so that all the data are added to its object/ array.
17685
+ * This is then passed on further for stiching.
17686
+ * @param connections
17687
+ * @param compositionData
17688
+ * @param reverse
17689
+ * @returns
17690
+ */
17691
+ function FormatFunctionData(connections_1, compositionData_1) {
17692
+ return __awaiter(this, arguments, void 0, function* (connections, compositionData, reverse = []) {
17693
+ var _a, _b, _c, _d, _e, _f, _g, _h;
17694
+ let myConcepts = [];
17695
+ for (let i = 0; i < connections.length; i++) {
17696
+ myConcepts.push(connections[i].toTheConceptId);
17697
+ myConcepts.push(connections[i].ofTheConceptId);
17698
+ myConcepts.push(connections[i].typeId);
17699
+ }
17700
+ connections.sort(function (x, y) {
17701
+ return y.id - x.id;
17702
+ });
17703
+ for (let i = 0; i < connections.length; i++) {
17704
+ let reverseFlag = false;
17705
+ let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);
17706
+ let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);
17707
+ if (reverse.includes(connections[i].id)) {
17708
+ reverseFlag = true;
17709
+ }
17710
+ if (reverseFlag == true) {
17711
+ if (ofTheConcept.id != 0 && toTheConcept.id != 0) {
17712
+ let newData;
17713
+ let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);
17714
+ let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : "self";
17715
+ if (connections[i].toTheConceptId in compositionData) {
17716
+ newData = compositionData[connections[i].toTheConceptId];
17717
+ }
17718
+ else {
17719
+ newData = {};
17720
+ newData[key] = {};
17721
+ compositionData[connections[i].toTheConceptId] = newData;
17722
+ }
17723
+ try {
17724
+ let mytype = (_d = (_c = ofTheConcept === null || ofTheConcept === void 0 ? void 0 : ofTheConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : "none";
17725
+ let value = ofTheConcept.characterValue;
17726
+ let reverseCharater = linkerConcept.characterValue + "_reverse";
17727
+ if (reverseCharater.includes("_s_")) {
17728
+ if (!(ofTheConcept.id in compositionData)) {
17729
+ compositionData[ofTheConcept.id] = {};
17730
+ }
17731
+ compositionData[ofTheConcept.id][mytype] = value;
17732
+ }
17733
+ compositionData[toTheConcept.id] = {};
17734
+ }
17735
+ catch (ex) {
17736
+ console.log("this is error", ex);
17737
+ }
17738
+ }
17739
+ }
17740
+ else {
17741
+ if (ofTheConcept.id != 0 && toTheConcept.id != 0) {
17742
+ let newData;
17743
+ let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);
17744
+ let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : "self";
17745
+ if (connections[i].ofTheConceptId in compositionData) {
17746
+ newData = compositionData[connections[i].ofTheConceptId];
17747
+ }
17748
+ else {
17749
+ newData = {};
17750
+ newData[key] = {};
17751
+ compositionData[connections[i].ofTheConceptId] = newData;
17752
+ }
17753
+ try {
17754
+ let mytype = (_h = (_g = toTheConcept === null || toTheConcept === void 0 ? void 0 : toTheConcept.type) === null || _g === void 0 ? void 0 : _g.characterValue) !== null && _h !== void 0 ? _h : "none";
17755
+ let value = toTheConcept.characterValue;
17756
+ if (linkerConcept.characterValue.includes("_s_")) {
17757
+ if (!(toTheConcept.id in compositionData)) {
17758
+ compositionData[toTheConcept.id] = {};
17759
+ }
17760
+ compositionData[toTheConcept.id][mytype] = value;
17761
+ }
17762
+ compositionData[ofTheConcept.id] = {};
17763
+ }
17764
+ catch (ex) {
17765
+ console.log("this is error", ex);
17766
+ }
17767
+ }
17768
+ }
17769
+ }
17770
+ return compositionData;
17771
+ });
17772
+ }
17654
17773
 
17655
17774
 
17656
17775
  /***/ }),
@@ -19205,8 +19324,9 @@ function formatConnectionsDataId(linkers, conceptIds, mainCompositionIds, revers
19205
19324
  let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);
19206
19325
  let compositionData = [];
19207
19326
  let newCompositionData = [];
19208
- compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.FormatFunctionData)(prefetchConnections, compositionData, reverse);
19327
+ compositionData = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFunctionData)(prefetchConnections, compositionData, reverse);
19209
19328
  compositionData = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFunctionDataForData)(prefetchConnections, compositionData, reverse);
19329
+ console.log("this is the composition data", compositionData);
19210
19330
  let output = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFromConnectionsAlteredArrayExternal)(prefetchConnections, compositionData, newCompositionData, mainCompositionIds, reverse);
19211
19331
  return output;
19212
19332
  });
@@ -20393,7 +20513,7 @@ class BuilderStatefulWidget extends _StatefulWidget__WEBPACK_IMPORTED_MODULE_0__
20393
20513
  this.elementIdentifier = Math.random() * 10000;
20394
20514
  return this.elementIdentifier;
20395
20515
  }
20396
- child_mount() {
20516
+ mount_child() {
20397
20517
  return __awaiter(this, void 0, void 0, function* () {
20398
20518
  const dynamicAsyncFunction = new Function("tsccs", `
20399
20519
  return (async function() {
@@ -20442,7 +20562,7 @@ class BuilderStatefulWidget extends _StatefulWidget__WEBPACK_IMPORTED_MODULE_0__
20442
20562
  if (this.componentMounted == false || this.widgetMounted == false) {
20443
20563
  // Simulate componentDidMount by calling it after the component is inserted into the DOM
20444
20564
  this.before_render();
20445
- this.child_mount();
20565
+ this.mount_child();
20446
20566
  this.widgetMounted = true;
20447
20567
  this.componentMounted = true;
20448
20568
  }
@@ -20679,7 +20799,7 @@ class StatefulWidget extends _BaseWidget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget
20679
20799
  /**
20680
20800
  * This is the function that needs to be called.
20681
20801
  */
20682
- child_mount() {
20802
+ mount_child() {
20683
20803
  }
20684
20804
  /**
20685
20805
  *
@@ -20706,7 +20826,7 @@ class StatefulWidget extends _BaseWidget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget
20706
20826
  this.before_render();
20707
20827
  // since this is the first time the widget is being created. then all the child widgets are being mounted
20708
20828
  // as well here.
20709
- this.child_mount();
20829
+ this.mount_child();
20710
20830
  // after the widget has been mounted for the first time then the widget has been updated.
20711
20831
  this.widgetMounted = true;
20712
20832
  }
@@ -20761,7 +20881,7 @@ class WidgetTree {
20761
20881
  this.after_render = "";
20762
20882
  this.before_render = "";
20763
20883
  this.update = "";
20764
- this.child_mount = "";
20884
+ this.mount_child = "";
20765
20885
  this.children = [];
20766
20886
  this.wrapper = 0;
20767
20887
  this.widget = new _BuilderStatefulWidget__WEBPACK_IMPORTED_MODULE_0__.BuilderStatefulWidget();