@metadev/daga-react 4.2.8 → 4.2.9

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/index.mjs CHANGED
@@ -927,13 +927,27 @@ class dt extends It {
927
927
  get look() {
928
928
  return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : this.type.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : this.type.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : this.type.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : this.type.defaultLook;
929
929
  }
930
+ /**
931
+ * An alias for the `lookConfig` attribute.
932
+ * @private
933
+ */
934
+ set look(t) {
935
+ this.lookConfig = t;
936
+ }
937
+ /**
938
+ * Look configuration used to derive the current look of this connection.
939
+ * @private
940
+ */
941
+ get lookConfig() {
942
+ return this._lookConfig;
943
+ }
930
944
  /**
931
945
  * Sets the look configuration of the connection to override the one determined by the type.
932
946
  * `undefined` resets it to the one determined by the type.
933
947
  * @private
934
948
  */
935
- set look(t) {
936
- if (t) {
949
+ set lookConfig(t) {
950
+ if (this._lookConfig = t, t) {
937
951
  const e = st(t);
938
952
  this._defaultLook = {
939
953
  ...this._defaultLook,
@@ -958,14 +972,30 @@ class dt extends It {
958
972
  get startMarkerLook() {
959
973
  return this.selected ? this.highlighted ? this._selectedAndHighlightedStartMarkerLook !== void 0 ? this._selectedAndHighlightedStartMarkerLook : this.type.selectedAndHighlightedStartMarkerLook : this._selectedStartMarkerLook !== void 0 ? this._selectedStartMarkerLook : this.type.selectedStartMarkerLook : this.highlighted ? this._highlightedStartMarkerLook !== void 0 ? this._highlightedStartMarkerLook : this.type.highlightedStartMarkerLook : this._defaultStartMarkerLook !== void 0 ? this._defaultStartMarkerLook : this.type.defaultStartMarkerLook;
960
974
  }
975
+ /**
976
+ * An alias for the `lookConfig` attribute.
977
+ * @private
978
+ */
979
+ set startMarkerLook(t) {
980
+ this.startMarkerLookConfig = t;
981
+ }
982
+ /**
983
+ * Look configuration used to derive the current look of the start marker of this connection.
984
+ * @private
985
+ */
986
+ get startMarkerLookConfig() {
987
+ return this._startMarkerLookConfig;
988
+ }
961
989
  /**
962
990
  * Sets the look configuration of the start marker to override the one determined by the type.
963
991
  * `null` stands for no marker and `undefined` resets it to the one determined by the type.
964
992
  * @private
965
993
  */
966
- set startMarkerLook(t) {
967
- if (t) {
968
- const e = st(t);
994
+ set startMarkerLookConfig(t) {
995
+ if (this._startMarkerLookConfig = t, t) {
996
+ const e = st(
997
+ t
998
+ );
969
999
  this._defaultStartMarkerLook = {
970
1000
  ...this._defaultStartMarkerLook,
971
1001
  ...e.defaultLook
@@ -989,13 +1019,27 @@ class dt extends It {
989
1019
  get endMarkerLook() {
990
1020
  return this.selected ? this.highlighted ? this._selectedAndHighlightedEndMarkerLook !== void 0 ? this._selectedAndHighlightedEndMarkerLook : this.type.selectedAndHighlightedEndMarkerLook : this._selectedEndMarkerLook !== void 0 ? this._selectedEndMarkerLook : this.type.selectedEndMarkerLook : this.highlighted ? this._highlightedEndMarkerLook !== void 0 ? this._highlightedEndMarkerLook : this.type.highlightedEndMarkerLook : this._defaultEndMarkerLook !== void 0 ? this._defaultEndMarkerLook : this.type.defaultEndMarkerLook;
991
1021
  }
1022
+ /**
1023
+ * An alias for the `lookConfig` attribute.
1024
+ * @private
1025
+ */
1026
+ set endMarkerLook(t) {
1027
+ this.endMarkerLookConfig = t;
1028
+ }
1029
+ /**
1030
+ * Look configuration used to derive the current look of the end marker of this connection.
1031
+ * @private
1032
+ */
1033
+ get endMarkerLookConfig() {
1034
+ return this._endMarkerLookConfig;
1035
+ }
992
1036
  /**
993
1037
  * Sets the look configuration of the end marker to override the one determined by the type.
994
1038
  * `null` stands for no marker and `undefined` resets it to the one determined by the type.
995
1039
  * @private
996
1040
  */
997
- set endMarkerLook(t) {
998
- if (t) {
1041
+ set endMarkerLookConfig(t) {
1042
+ if (this._endMarkerLookConfig = t, t) {
999
1043
  const e = st(t);
1000
1044
  this._defaultEndMarkerLook = {
1001
1045
  ...this._defaultEndMarkerLook,
@@ -1293,13 +1337,27 @@ class D extends It {
1293
1337
  get look() {
1294
1338
  return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : this.type?.selectedAndHighlightedLook || this.node?.look : this._selectedLook !== void 0 ? this._selectedLook : this.type?.selectedLook || this.node?.look : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : this.type?.highlightedLook || this.node?.look : this._defaultLook !== void 0 ? this._defaultLook : this.type?.defaultLook || this.node?.look;
1295
1339
  }
1340
+ /**
1341
+ * An alias for the `lookConfig` attribute.
1342
+ * @private
1343
+ */
1344
+ set look(t) {
1345
+ this.lookConfig = t;
1346
+ }
1347
+ /**
1348
+ * Look configuration used to derive the current look of this section.
1349
+ * @private
1350
+ */
1351
+ get lookConfig() {
1352
+ return this._lookConfig;
1353
+ }
1296
1354
  /**
1297
1355
  * Sets the look configuration of the look to override the one determined by the type.
1298
1356
  * `undefined` resets it to the one determined by the type.
1299
1357
  * @private
1300
1358
  */
1301
- set look(t) {
1302
- if (t) {
1359
+ set lookConfig(t) {
1360
+ if (this._lookConfig = t, t) {
1303
1361
  const e = st(t);
1304
1362
  this._defaultLook = {
1305
1363
  ...this._defaultLook,
@@ -1719,13 +1777,27 @@ class z extends It {
1719
1777
  get look() {
1720
1778
  return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : this.type.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : this.type.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : this.type.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : this.type.defaultLook;
1721
1779
  }
1780
+ /**
1781
+ * An alias for the `lookConfig` attribute.
1782
+ * @private
1783
+ */
1784
+ set look(t) {
1785
+ this.lookConfig = t;
1786
+ }
1787
+ /**
1788
+ * Look configuration used to derive the current look of this node.
1789
+ * @private
1790
+ */
1791
+ get lookConfig() {
1792
+ return this._lookConfig;
1793
+ }
1722
1794
  /**
1723
1795
  * Sets the look configuration of the look to override the one determined by the type.
1724
1796
  * `undefined` resets it to the one determined by the type.
1725
1797
  * @private
1726
1798
  */
1727
- set look(t) {
1728
- if (t) {
1799
+ set lookConfig(t) {
1800
+ if (this._lookConfig = t, t) {
1729
1801
  const e = st(t);
1730
1802
  this._defaultLook = {
1731
1803
  ...this._defaultLook,
@@ -2489,13 +2561,27 @@ class bt extends It {
2489
2561
  get look() {
2490
2562
  return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (this.type || Xt)?.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : (this.type || Xt)?.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : (this.type || Xt)?.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : (this.type || Xt)?.defaultLook;
2491
2563
  }
2564
+ /**
2565
+ * An alias for the `lookConfig` attribute.
2566
+ * @private
2567
+ */
2568
+ set look(t) {
2569
+ this.lookConfig = t;
2570
+ }
2571
+ /**
2572
+ * Look configuration used to derive the current look of this port.
2573
+ * @private
2574
+ */
2575
+ get lookConfig() {
2576
+ return this._lookConfig;
2577
+ }
2492
2578
  /**
2493
2579
  * Sets the look configuration of the look to override the one determined by the type.
2494
2580
  * `undefined` resets it to the one determined by the type.
2495
2581
  * @private
2496
2582
  */
2497
- set look(t) {
2498
- if (t) {
2583
+ set lookConfig(t) {
2584
+ if (this._lookConfig = t, t) {
2499
2585
  const e = st(
2500
2586
  t
2501
2587
  );
@@ -4462,10 +4548,10 @@ class ri extends ft {
4462
4548
  * @public
4463
4549
  * @param canvas A canvas.
4464
4550
  */
4465
- constructor(t) {
4551
+ constructor(t, e) {
4466
4552
  super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(ro(2e3)).subscribe(() => {
4467
4553
  this.makeUpdateValuesAction();
4468
- });
4554
+ }), console.log(e), this.diagramPropertiesText = e !== void 0 ? e : ni;
4469
4555
  }
4470
4556
  add(t) {
4471
4557
  if (!this.contains(t.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (t instanceof z || t instanceof dt) ? this.openInPropertyEditor(t) : this.propertyEditorSelection === void 0 && t instanceof D ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof z && t.sections))
@@ -4582,7 +4668,7 @@ class ri extends ft {
4582
4668
  const l = t?.valueSet;
4583
4669
  l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = structuredClone(
4584
4670
  l.getValues()
4585
- )), a && (t instanceof z || t instanceof dt ? (t instanceof z ? t.name ? a.title = `${t.type.name}: ${t.name}` : a.title = t.type.name : t instanceof dt && (a.title = t.type.name), a.valueSet = void 0, a.valueSet = l) : (a.title = ni, a.valueSet = void 0, a.valueSet = l))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, a && (a.title = "", a.valueSet = void 0));
4671
+ )), a && (t instanceof z || t instanceof dt ? (t instanceof z ? t.name ? a.title = `${t.type.name}: ${t.name}` : a.title = t.type.name : t instanceof dt && (a.title = t.type.name), a.valueSet = void 0, a.valueSet = l) : (a.title = this.diagramPropertiesText, a.valueSet = void 0, a.valueSet = l))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, a && (a.title = "", a.valueSet = void 0));
4586
4672
  }
4587
4673
  makeUpdateValuesAction() {
4588
4674
  if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
@@ -4626,7 +4712,10 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
4626
4712
  "",
4627
4713
  e.type || "",
4628
4714
  e.properties || []
4629
- ), this.userSelection = new ri(this), this.userHighlight = new ii(
4715
+ ), this.userSelection = new ri(
4716
+ this,
4717
+ e.components?.propertyEditor?.title
4718
+ ), this.userHighlight = new ii(
4630
4719
  this,
4631
4720
  e.canvas?.highlightSections !== !1
4632
4721
  ), this.contextMenu = new oi(this, e.canvas?.contextMenu), this.backgroundColor = e.canvas?.backgroundColor || "#FFFFFF", this.gridStyle = e.canvas?.grid?.style ?? zt.style, this.gridSize = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? 0 : Math.abs(e.canvas?.grid?.spacing || zt.spacing), this.gridThickness = Math.abs(
@@ -4766,8 +4855,9 @@ const ai = (s) => s * Math.PI / 180, Pe = (s, t, e) => {
4766
4855
  const l = this.userSelection.all();
4767
4856
  this.userSelection.clear(), this.diagramEvent$.next(
4768
4857
  new G(l, !1)
4769
- ), this.userSelection.openInPropertyEditor(this.model);
4858
+ );
4770
4859
  }
4860
+ this.userSelection.openInPropertyEditor(this.model);
4771
4861
  }).call(
4772
4862
  x.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(I.Start, (l) => {
4773
4863
  this.startMultipleSelection(l);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metadev/daga-react",
3
- "version": "4.2.8",
3
+ "version": "4.2.9",
4
4
  "main": "./index.js",
5
5
  "module": "./index.mjs",
6
6
  "style": "./style.css",
@@ -20,7 +20,7 @@
20
20
  "peerDependencies": {
21
21
  "react": "*",
22
22
  "react-dom": "*",
23
- "@metadev/daga": "^4.2.8",
23
+ "@metadev/daga": "^4.2.9",
24
24
  "d3": "^7.9.0",
25
25
  "rxjs": "~7.8.1"
26
26
  },