@crystaldesign/web-planner-logic 26.13.0-rc.4 → 26.13.0-rc.6

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.
Files changed (44) hide show
  1. package/build/cjs/{DivaBoxPlanner-15e3b967.js → DivaBoxPlanner-d2bed074.js} +2 -2
  2. package/build/cjs/{DivaStandardPlanner-4d6c9460.js → DivaStandardPlanner-14e46bd6.js} +66 -11
  3. package/build/cjs/{DoorPlanner-2301d76d.js → DoorPlanner-d54cecbc.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-68cfd444.js → Host3DSignalR-afe1c347.js} +1 -1
  5. package/build/cjs/{LiviqueWWSHandler-7fc6cc80.js → LiviqueWWSHandler-0dbefe66.js} +1 -1
  6. package/build/cjs/{PfisterWWSHandler-d2952617.js → PfisterWWSHandler-a8b5f4e9.js} +1 -1
  7. package/build/cjs/{PlannerHandler2D-3e8e2291.js → PlannerHandler2D-18fa0971.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-bad49d7f.js → SeriousBasketHandler-3c48950e.js} +1 -1
  9. package/build/cjs/{ShelfPlanner-fcced9be.js → ShelfPlanner-9a9614b6.js} +1 -1
  10. package/build/cjs/{StandardWWSHandler-e02c32b3.js → StandardWWSHandler-0e684910.js} +1 -1
  11. package/build/cjs/{index-8a37b5a7.js → index-70f52508.js} +51 -20
  12. package/build/cjs/index.js +1 -1
  13. package/build/esm/{DivaBoxPlanner-59b569bc.js → DivaBoxPlanner-aac3cf32.js} +2 -2
  14. package/build/esm/{DivaStandardPlanner-1f3f1c38.js → DivaStandardPlanner-e6a798d6.js} +66 -11
  15. package/build/esm/{DoorPlanner-0d300e2c.js → DoorPlanner-edf1954c.js} +1 -1
  16. package/build/esm/{Host3DSignalR-544381ed.js → Host3DSignalR-63710e3d.js} +1 -1
  17. package/build/esm/{LiviqueWWSHandler-57ec4811.js → LiviqueWWSHandler-fe5d4d89.js} +1 -1
  18. package/build/esm/{PfisterWWSHandler-78928e8f.js → PfisterWWSHandler-17267695.js} +1 -1
  19. package/build/esm/{PlannerHandler2D-c0380cdc.js → PlannerHandler2D-e43996e4.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-708b8e6d.js → SeriousBasketHandler-cff3256c.js} +1 -1
  21. package/build/esm/{ShelfPlanner-5b9604ad.js → ShelfPlanner-83c49609.js} +1 -1
  22. package/build/esm/{StandardWWSHandler-d693dc6d.js → StandardWWSHandler-743d6bc0.js} +1 -1
  23. package/build/esm/{index-bae4b8e4.js → index-102cd67d.js} +51 -20
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +1 -0
  26. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts +4 -0
  28. package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts.map +1 -1
  30. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlannerGrid.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts +8 -0
  32. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +5 -0
  34. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts +2 -0
  36. package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts.map +1 -1
  38. package/build/types/web-planner-logic/src/test/dragKeepsDockingRules.test.d.ts +2 -0
  39. package/build/types/web-planner-logic/src/test/dragKeepsDockingRules.test.d.ts.map +1 -0
  40. package/build/types/web-planner-logic/src/test/dragTransOrder.test.d.ts +3 -0
  41. package/build/types/web-planner-logic/src/test/dragTransOrder.test.d.ts.map +1 -0
  42. package/build/types/web-planner-logic/src/test/shelfPlannerGroup.test.d.ts +2 -0
  43. package/build/types/web-planner-logic/src/test/shelfPlannerGroup.test.d.ts.map +1 -0
  44. package/package.json +3 -3
@@ -5,11 +5,11 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
5
5
  var _createClass = require('@babel/runtime/helpers/createClass');
6
6
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
7
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
8
- var index = require('./index-8a37b5a7.js');
8
+ var index = require('./index-70f52508.js');
9
9
  var DivaUtils = require('@crystaldesign/diva-utils');
10
10
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
11
11
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
12
- var PlannerHandler2D = require('./PlannerHandler2D-3e8e2291.js');
12
+ var PlannerHandler2D = require('./PlannerHandler2D-18fa0971.js');
13
13
  require('@babel/runtime/helpers/objectWithoutProperties');
14
14
  require('axios');
15
15
  require('@babel/runtime/helpers/typeof');
@@ -7,10 +7,10 @@ var _createClass = require('@babel/runtime/helpers/createClass');
7
7
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
8
8
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
9
9
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
10
- var index = require('./index-8a37b5a7.js');
10
+ var index = require('./index-70f52508.js');
11
11
  var DivaUtils = require('@crystaldesign/diva-utils');
12
12
  var plannerCore = require('@crystaldesign/planner-core');
13
- var PlannerHandler2D = require('./PlannerHandler2D-3e8e2291.js');
13
+ var PlannerHandler2D = require('./PlannerHandler2D-18fa0971.js');
14
14
  require('@babel/runtime/helpers/objectWithoutProperties');
15
15
  require('axios');
16
16
  require('@babel/runtime/helpers/typeof');
@@ -83,6 +83,15 @@ var PATH_STEP = 2;
83
83
  var DEPTH_NOISE = 1e-6;
84
84
  /** cm within which a dragged guest snaps into a free place of a slot that takes it. */
85
85
  var SLOT_SNAP_DISTANCE = 20;
86
+ /**
87
+ * cm within which a group dragged in a room docks (between the docking points), at least the viewer's own docking
88
+ * distance: as far as a slot snap reaches. The bodies block the drag at contact and a pointer moves several cm per event,
89
+ * so the group is mostly pushed into the element it docks to; it has to dock from such a pose, not only from the few cm
90
+ * before contact.
91
+ */
92
+ var ROOM_DOCK_SNAP_DISTANCE = SLOT_SNAP_DISTANCE;
93
+ /** cm between two docking points that meet at a dock pose (the float noise of the docked transform). */
94
+ var DOCK_CONTACT_DISTANCE = 0.1;
86
95
  /** cm within which a drag counts as back at its start (the float noise of the summed moves). */
87
96
  var START_NOISE = 1e-6;
88
97
  var toFloorRect = function toFloorRect(block, pose) {
@@ -1694,13 +1703,14 @@ var DivaStandardPlanner = /*#__PURE__*/function () {
1694
1703
  };
1695
1704
  }
1696
1705
 
1697
- // The group follows the grabbed element rigidly to the wall or inside-room pose of the raw centre, also where it runs
1698
- // into an obstacle: what it runs into there is kept as `blockedBy` (the viewer shows the drag blocked, a release there
1699
- // goes back to the start). A forced group that fits on no wall is kept inside the room like a free one. Back at the
1700
- // start (a cancel, a blocked release) it stands exactly where it started, nothing snaps.
1706
+ // The group follows the grabbed element rigidly to the wall or inside-room pose of the raw centre, and from there onto
1707
+ // a dock within ROOM_DOCK_SNAP_DISTANCE, also where it runs into an obstacle: what it runs into there is kept as
1708
+ // `blockedBy` (the viewer shows the drag blocked, a release there goes back to the start). A forced group that fits on
1709
+ // no wall is kept inside the room like a free one. Back at the start (a cancel, a blocked release) it stands exactly
1710
+ // where it started, nothing snaps.
1701
1711
  }, {
1702
1712
  key: "updateRoomDrag",
1703
- value: function updateRoomDrag(room, drag, deltaMove) {
1713
+ value: function updateRoomDrag(room, drag, deltaMove, autoDockingDistance) {
1704
1714
  drag.dx += deltaMove.x;
1705
1715
  drag.dz += deltaMove.z;
1706
1716
  var _drag$start2 = drag.start,
@@ -1719,12 +1729,19 @@ var DivaStandardPlanner = /*#__PURE__*/function () {
1719
1729
  center: drag.start.center,
1720
1730
  rotDeg: rotDeg
1721
1731
  };
1722
- var wanted = atStart ? startPose : slotPose !== null && slotPose !== void 0 ? slotPose : wallPose && (drag.wallMode === 'forced' || snapsToWall) ? wallPose : insidePose(block, {
1732
+ var placed = atStart ? startPose : slotPose !== null && slotPose !== void 0 ? slotPose : wallPose && (drag.wallMode === 'forced' || snapsToWall) ? wallPose : insidePose(block, {
1723
1733
  center: rawCenter,
1724
1734
  rotDeg: rotDeg
1725
1735
  }, room);
1726
- drag.blockedBy = this.blockersAt(drag, wanted);
1727
- index.moveGroupRigidly([].concat(_toConsumableArray__default["default"](drag.members), _toConsumableArray__default["default"](drag.followers)), drag.current, wanted);
1736
+ var group = [].concat(_toConsumableArray__default["default"](drag.members), _toConsumableArray__default["default"](drag.followers));
1737
+ index.moveGroupRigidly(group, drag.current, placed);
1738
+ // Pushed against the element it docks to, the group touches it docked instead of standing blocked in it, so the
1739
+ // release docks it (see snapToDock).
1740
+ var reach = autoDockingDistance === 0 ? 0 : Math.max(autoDockingDistance, ROOM_DOCK_SNAP_DISTANCE);
1741
+ var dock = atStart || slotPose ? undefined : this.getDockSnapPose(drag, placed, reach);
1742
+ var wanted = dock !== null && dock !== void 0 ? dock : placed;
1743
+ index.moveGroupRigidly(group, placed, wanted);
1744
+ drag.blockedBy = dock ? [] : this.blockersAt(drag, wanted);
1728
1745
  drag.current = wanted;
1729
1746
  drag.slotSnapped = !!slotPose;
1730
1747
  // A pair that overlapped at the start may only come apart, never go back in.
@@ -1737,6 +1754,44 @@ var DivaStandardPlanner = /*#__PURE__*/function () {
1737
1754
  });
1738
1755
  }
1739
1756
 
1757
+ /**
1758
+ * The pose of the group, standing at `pose`, where the grabbed element docks onto the nearest dock outside the group and
1759
+ * its guests (see findDockSnap), where nothing blocks it; undefined when no dock is that near, or the room rule would
1760
+ * move the docked group or something blocks it there that it does not dock to: then the group stays where the pointer
1761
+ * has it. Docked elements may reach into each other as members of a group do (a side panel standing out of the
1762
+ * outline), so every element the group docks to at that pose (both neighbours of a gap it fills) does not block.
1763
+ */
1764
+ }, {
1765
+ key: "getDockSnapPose",
1766
+ value: function getDockSnapPose(drag, pose, autoDockingDistance) {
1767
+ var element = this.plannerElements.get(drag.elementId);
1768
+ var group = [].concat(_toConsumableArray__default["default"](drag.members), _toConsumableArray__default["default"](drag.followers));
1769
+ var unitIds = group.map(function (member) {
1770
+ return member.ElementId;
1771
+ });
1772
+ var snap = element && this.findDockSnap(element, autoDockingDistance, unitIds);
1773
+ if (!element || !snap) return undefined;
1774
+ var _this$snapMove = this.snapMove(element, snap),
1775
+ from = _this$snapMove.from,
1776
+ to = _this$snapMove.to;
1777
+ var docked = movePose(pose, from, to);
1778
+ if (!this.getKeptPose(drag, docked)) return undefined;
1779
+ index.moveGroupRigidly(group, pose, docked);
1780
+ var others = this.getAllPlannerElements().filter(function (other) {
1781
+ return !unitIds.includes(other.ElementId);
1782
+ });
1783
+ var dockedTo = new Set(group.flatMap(function (member) {
1784
+ return _toConsumableArray__default["default"](PlannerHandler2D.dockingPointHandlerInst.searchDockableElementsInArea(member, others, DOCK_CONTACT_DISTANCE).values()).map(function (pair) {
1785
+ return pair.targetDP.ElementId;
1786
+ });
1787
+ }));
1788
+ index.moveGroupRigidly(group, docked, pose);
1789
+ var docksTo = function docksTo(obstacle) {
1790
+ return obstacle.setId === undefined && obstacle.elementId !== undefined && dockedTo.has(obstacle.elementId);
1791
+ };
1792
+ return this.blockersAt(drag, docked).every(docksTo) ? docked : undefined;
1793
+ }
1794
+
1740
1795
  // The unit moved rigidly onto the nearest dock of `element` outside it (see findDockSnap), else with `slots` into the
1741
1796
  // nearest free slot place (see findSlotSnap).
1742
1797
  }, {
@@ -3491,7 +3546,7 @@ var DivaStandardPlanner = /*#__PURE__*/function () {
3491
3546
  if (room && roomDrag && !roomDrag.rotating && transState == 'UPDATE' && roomDrag.members.some(function (member) {
3492
3547
  return member.ElementId == elementId;
3493
3548
  })) {
3494
- if (elementId == roomDrag.elementId) this.updateRoomDrag(room, roomDrag, deltaMove);
3549
+ if (elementId == roomDrag.elementId) this.updateRoomDrag(room, roomDrag, deltaMove, autoDockingDistance);
3495
3550
  return false;
3496
3551
  }
3497
3552
  if (this.plannerElements.has(elementId)) {
@@ -3,7 +3,7 @@
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
5
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
- require('./index-8a37b5a7.js');
6
+ require('./index-70f52508.js');
7
7
  var DivaUtils = require('@crystaldesign/diva-utils');
8
8
  require('@babel/runtime/helpers/slicedToArray');
9
9
  require('@babel/runtime/helpers/asyncToGenerator');
@@ -5,7 +5,7 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
5
5
  var _createClass = require('@babel/runtime/helpers/createClass');
6
6
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
7
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
8
- var index = require('./index-8a37b5a7.js');
8
+ var index = require('./index-70f52508.js');
9
9
  var DivaUtils = require('@crystaldesign/diva-utils');
10
10
  var signalr = require('@microsoft/signalr');
11
11
  var io = require('socket.io-client');
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
- require('./index-8a37b5a7.js');
5
+ require('./index-70f52508.js');
6
6
  require('@babel/runtime/helpers/slicedToArray');
7
7
  require('@babel/runtime/helpers/asyncToGenerator');
8
8
  require('@babel/runtime/helpers/defineProperty');
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
- var index = require('./index-8a37b5a7.js');
5
+ var index = require('./index-70f52508.js');
6
6
  var basketModel = require('@crystaldesign/basket-model');
7
7
  var DivaUtils = require('@crystaldesign/diva-utils');
8
8
  require('@babel/runtime/helpers/slicedToArray');
@@ -5,7 +5,7 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
5
5
  var _createClass = require('@babel/runtime/helpers/createClass');
6
6
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
7
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
8
- var index = require('./index-8a37b5a7.js');
8
+ var index = require('./index-70f52508.js');
9
9
  var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn');
10
10
  var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
11
11
  var _get = require('@babel/runtime/helpers/get');
@@ -3,7 +3,7 @@
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
5
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
- var index = require('./index-8a37b5a7.js');
6
+ var index = require('./index-70f52508.js');
7
7
  var DivaUtils = require('@crystaldesign/diva-utils');
8
8
  require('@babel/runtime/helpers/slicedToArray');
9
9
  require('@babel/runtime/helpers/asyncToGenerator');
@@ -6,7 +6,7 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
6
6
  var _createClass = require('@babel/runtime/helpers/createClass');
7
7
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
8
8
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
9
- var index = require('./index-8a37b5a7.js');
9
+ var index = require('./index-70f52508.js');
10
10
  var DivaUtils = require('@crystaldesign/diva-utils');
11
11
  require('@babel/runtime/helpers/slicedToArray');
12
12
  require('@babel/runtime/helpers/objectWithoutProperties');
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
- require('./index-8a37b5a7.js');
5
+ require('./index-70f52508.js');
6
6
  require('@babel/runtime/helpers/slicedToArray');
7
7
  require('@babel/runtime/helpers/asyncToGenerator');
8
8
  require('@babel/runtime/helpers/defineProperty');
@@ -2133,6 +2133,7 @@ var CATALOG_PROPERTIES = {
2133
2133
  RECONFIG_AFTER_ARTICLE_DOCKED: 'boolean:1',
2134
2134
  REPAIR_VARIANT_VALUES: 'shape',
2135
2135
  RTV_PRESET: 'json',
2136
+ SHELFPLANNER_GROUP: 'string',
2136
2137
  SHOWACCESSOIREONLASTTAB: 'boolean:1',
2137
2138
  SHOWACCONDPONLY: 'boolean:1',
2138
2139
  SHOWTYPENRINPLANNER: 'boolean:1',
@@ -24727,6 +24728,12 @@ var DivaCatalogData = /*#__PURE__*/function () {
24727
24728
  get: function get() {
24728
24729
  return this.catalogProps.dontShowBasePrice;
24729
24730
  }
24731
+ /** Shelf-planner `Group` of every grid that names none (`SHELFPLANNER_GROUP`): its grids share one config step. */
24732
+ }, {
24733
+ key: "shelfPlannerGroup",
24734
+ get: function get() {
24735
+ return this.catalogProps.shelfPlannerGroup;
24736
+ }
24730
24737
  }, {
24731
24738
  key: "getOption",
24732
24739
  value: function getOption(opt) {
@@ -25120,6 +25127,9 @@ var DivaCatalogData = /*#__PURE__*/function () {
25120
25127
  case 'DIVA3D_USE_RTV_NEXT':
25121
25128
  _this2.catalogProps.divaUseRtvNext = item.Value === true;
25122
25129
  break;
25130
+ case 'SHELFPLANNER_GROUP':
25131
+ _this2.catalogProps.shelfPlannerGroup = textOf(item.Value) || undefined;
25132
+ break;
25123
25133
  case 'HEADER_DIMENSION_IDS':
25124
25134
  _this2.catalogProps.headerDimensionIds = listOf(item.Value);
25125
25135
  break;
@@ -34355,7 +34365,7 @@ var DivaArticle = /*#__PURE__*/function () {
34355
34365
  break;
34356
34366
  }
34357
34367
  _context.next = 4;
34358
- return Promise.resolve().then(function () { return require('./ShelfPlanner-fcced9be.js'); });
34368
+ return Promise.resolve().then(function () { return require('./ShelfPlanner-9a9614b6.js'); });
34359
34369
  case 4:
34360
34370
  _yield$import = _context.sent;
34361
34371
  ShelfPlanner = _yield$import["default"];
@@ -40781,6 +40791,8 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
40781
40791
  if ((_grid$ArticleRelation = grid.ArticleRelationsForOtherGroups) !== null && _grid$ArticleRelation !== void 0 && _grid$ArticleRelation.length) {
40782
40792
  var _loop2 = function _loop2() {
40783
40793
  var group = grid.ArticleRelationsForOtherGroups[i];
40794
+ // Already in this step as its own group.
40795
+ if (group.Group === gridGroupOrId) return 1; // continue
40784
40796
  var index = groupedGrids.findIndex(function (g) {
40785
40797
  return g.groupName === group.Group;
40786
40798
  });
@@ -40797,7 +40809,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
40797
40809
  }
40798
40810
  };
40799
40811
  for (var i = 0; i < grid.ArticleRelationsForOtherGroups.length; i++) {
40800
- _loop2();
40812
+ if (_loop2()) continue;
40801
40813
  }
40802
40814
  }
40803
40815
  };
@@ -43200,7 +43212,7 @@ var DivaSet = /*#__PURE__*/function () {
43200
43212
  break;
43201
43213
  }
43202
43214
  _context5.next = 3;
43203
- return Promise.resolve().then(function () { return require('./DoorPlanner-2301d76d.js'); });
43215
+ return Promise.resolve().then(function () { return require('./DoorPlanner-d54cecbc.js'); });
43204
43216
  case 3:
43205
43217
  _yield$import = _context5.sent;
43206
43218
  DoorPlanner = _yield$import["default"];
@@ -44006,7 +44018,9 @@ var Grid = /*#__PURE__*/function () {
44006
44018
  this.excludeAccessoiresByAccessoiresInGrid = grid.ExcludeAccessoiresByAccessoiresInGrid;
44007
44019
  this.influencedByNeighborGrids = grid.InfluencedByNeighborGrids;
44008
44020
  this.influencedByOverlappingGrids = grid.InfluencedByOverlappingGrids;
44009
- this._group = grid.Group;
44021
+
44022
+ // The grid's own Group wins, even an empty one: that keeps the grid in a step of its own under a catalog default.
44023
+ this._group = 'Group' in grid ? grid.Group : article.CatalogData.shelfPlannerGroup;
44010
44024
  this.articleRelations = grid.ArticleRelations;
44011
44025
  this.initAccArr = grid.initAccArr;
44012
44026
  this.articleRelationsForOtherGroups = grid.ArticleRelationsForOtherGroups;
@@ -45068,16 +45082,18 @@ var Grid = /*#__PURE__*/function () {
45068
45082
  }, {
45069
45083
  key: "getArticleRelationsById",
45070
45084
  value: function getArticleRelationsById(id) {
45071
- var _this$ArticleRelation2;
45085
+ var _this$ArticleRelation2, _own;
45072
45086
  var alternative = (_this$ArticleRelation2 = this.ArticleRelationsForOtherGroups) === null || _this$ArticleRelation2 === void 0 ? void 0 : _this$ArticleRelation2.find(function (g) {
45073
45087
  return g.Group == id;
45074
45088
  });
45075
- if (alternative) return alternative.ArticleRelations;
45089
+ // The grid's own group can be one of its other groups too (e.g. by SHELFPLANNER_GROUP): that step offers both.
45090
+ if (alternative && id !== this.group) return alternative.ArticleRelations;
45091
+ var own = this.articleRelations;
45076
45092
  if (this.heightGridCellCountOnRule && this.currentLoadedRuleIndex !== false) {
45077
45093
  var curGrid = this.heightGridCellCountOnRule[this.currentLoadedRuleIndex];
45078
- if (curGrid.ArticleRelations) return curGrid.ArticleRelations;
45094
+ if (curGrid.ArticleRelations) own = curGrid.ArticleRelations;
45079
45095
  }
45080
- return this.articleRelations;
45096
+ return alternative ? [].concat(_toConsumableArray__default["default"]((_own = own) !== null && _own !== void 0 ? _own : []), _toConsumableArray__default["default"](alternative.ArticleRelations)) : own;
45081
45097
  }
45082
45098
  }, {
45083
45099
  key: "getGridIdByArticleCodex",
@@ -45659,6 +45675,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
45659
45675
  var article = set.getArticleByBasketId(movedDoor.BasketId);
45660
45676
  article === null || article === void 0 || (_article$doorPlanner = article.doorPlanner) === null || _article$doorPlanner === void 0 || _article$doorPlanner.onChange(movedDoor, targetDoor);
45661
45677
  });
45678
+ /**
45679
+ * The sets whose running drag changed the docking at START: the planner undocks the grabbed element there, also from
45680
+ * the group members that move along with it, and docks it again at END.
45681
+ */
45682
+ _defineProperty__default["default"](this, "undockedByDragStart", new WeakSet());
45662
45683
  }
45663
45684
  return _createClass__default["default"](DivaSetHandler, [{
45664
45685
  key: "isDryRunArticle",
@@ -47794,18 +47815,28 @@ var DivaSetHandler = /*#__PURE__*/function () {
47794
47815
  key: "updatePlannerTrans",
47795
47816
  value: function () {
47796
47817
  var _updatePlannerTrans = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee27(set, plannerElementID, deltaMove, deltaAngleDeg, rotCorrection, transState, autoDockingDistance, turningPoint) {
47797
- var updateConfig;
47818
+ var updateConfig, undockedAtStart;
47798
47819
  return _regeneratorRuntime__default["default"].wrap(function _callee27$(_context29) {
47799
47820
  while (1) switch (_context29.prev = _context29.next) {
47800
47821
  case 0:
47801
- updateConfig = set.plannerHandler.updatePlannerTrans(set.getSetId(), plannerElementID, deltaMove, deltaAngleDeg, rotCorrection, transState, autoDockingDistance, turningPoint);
47802
- if (!updateConfig) {
47822
+ updateConfig = set.plannerHandler.updatePlannerTrans(set.getSetId(), plannerElementID, deltaMove, deltaAngleDeg, rotCorrection, transState, autoDockingDistance, turningPoint); // The configuration follows the docking the drag is released with. Reconfigured after START, the docking dependent
47823
+ // rules see the grabbed element apart from its group (a 50 cm cabinet allowed only beside a 100 cm one) and drop
47824
+ // the values they hide; the sizes that changed with them then keep END from docking the group again.
47825
+ if (!(transState == 'START')) {
47803
47826
  _context29.next = 4;
47804
47827
  break;
47805
47828
  }
47806
- _context29.next = 4;
47807
- return this.reconfigureSetAfterDockingChange(set, true, 'initializingAfterTrans');
47829
+ if (updateConfig) this.undockedByDragStart.add(set);
47830
+ return _context29.abrupt("return");
47808
47831
  case 4:
47832
+ undockedAtStart = transState == 'END' && this.undockedByDragStart["delete"](set);
47833
+ if (!(updateConfig || undockedAtStart)) {
47834
+ _context29.next = 8;
47835
+ break;
47836
+ }
47837
+ _context29.next = 8;
47838
+ return this.reconfigureSetAfterDockingChange(set, true, 'initializingAfterTrans');
47839
+ case 8:
47809
47840
  case "end":
47810
47841
  return _context29.stop();
47811
47842
  }
@@ -51491,7 +51522,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
51491
51522
  break;
51492
51523
  case 3:
51493
51524
  _context13.next = 5;
51494
- return Promise.resolve().then(function () { return require('./PfisterWWSHandler-d2952617.js'); });
51525
+ return Promise.resolve().then(function () { return require('./PfisterWWSHandler-a8b5f4e9.js'); });
51495
51526
  case 5:
51496
51527
  _yield$import = _context13.sent;
51497
51528
  PfisterWWSHandler = _yield$import["default"];
@@ -51499,7 +51530,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
51499
51530
  return _context13.abrupt("break", 27);
51500
51531
  case 9:
51501
51532
  _context13.next = 11;
51502
- return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-7fc6cc80.js'); });
51533
+ return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-0dbefe66.js'); });
51503
51534
  case 11:
51504
51535
  _yield$import2 = _context13.sent;
51505
51536
  LiviqueWWSHandler = _yield$import2["default"];
@@ -51507,7 +51538,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
51507
51538
  return _context13.abrupt("break", 27);
51508
51539
  case 15:
51509
51540
  _context13.next = 17;
51510
- return Promise.resolve().then(function () { return require('./SeriousBasketHandler-bad49d7f.js'); });
51541
+ return Promise.resolve().then(function () { return require('./SeriousBasketHandler-3c48950e.js'); });
51511
51542
  case 17:
51512
51543
  _yield$import3 = _context13.sent;
51513
51544
  SeriousWWSHandler = _yield$import3["default"];
@@ -51515,7 +51546,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
51515
51546
  return _context13.abrupt("break", 27);
51516
51547
  case 21:
51517
51548
  _context13.next = 23;
51518
- return Promise.resolve().then(function () { return require('./StandardWWSHandler-e02c32b3.js'); });
51549
+ return Promise.resolve().then(function () { return require('./StandardWWSHandler-0e684910.js'); });
51519
51550
  case 23:
51520
51551
  _yield$import4 = _context13.sent;
51521
51552
  StandardWWSHandler = _yield$import4["default"];
@@ -52913,7 +52944,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
52913
52944
  //If we need real time rendering initialize the SignalR and 3D host connection Handler
52914
52945
  bootMark('signalr: chunk import start');
52915
52946
  _context3.next = 3;
52916
- return Promise.resolve().then(function () { return require('./Host3DSignalR-68cfd444.js'); });
52947
+ return Promise.resolve().then(function () { return require('./Host3DSignalR-afe1c347.js'); });
52917
52948
  case 3:
52918
52949
  _yield$import = _context3.sent;
52919
52950
  Host3DSignalR = _yield$import["default"];
@@ -57319,7 +57350,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
57319
57350
  break;
57320
57351
  case 9:
57321
57352
  _context5.next = 11;
57322
- return Promise.resolve().then(function () { return require('./DivaStandardPlanner-4d6c9460.js'); });
57353
+ return Promise.resolve().then(function () { return require('./DivaStandardPlanner-14e46bd6.js'); });
57323
57354
  case 11:
57324
57355
  _yield$import = _context5.sent;
57325
57356
  DivaStandardPlanner = _yield$import["default"];
@@ -57334,7 +57365,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
57334
57365
  return _context5.abrupt("break", 22);
57335
57366
  case 16:
57336
57367
  _context5.next = 18;
57337
- return Promise.resolve().then(function () { return require('./DivaBoxPlanner-15e3b967.js'); });
57368
+ return Promise.resolve().then(function () { return require('./DivaBoxPlanner-d2bed074.js'); });
57338
57369
  case 18:
57339
57370
  _yield$import2 = _context5.sent;
57340
57371
  DivaBoxPlanner = _yield$import2["default"];
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-8a37b5a7.js');
5
+ var index = require('./index-70f52508.js');
6
6
  var plannerCore = require('@crystaldesign/planner-core');
7
7
  require('@babel/runtime/helpers/slicedToArray');
8
8
  require('@babel/runtime/helpers/asyncToGenerator');
@@ -3,11 +3,11 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
3
3
  import _createClass from '@babel/runtime/helpers/createClass';
4
4
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
5
5
  import _regeneratorRuntime from '@babel/runtime/regenerator';
6
- import { u as Vector2, V as Vector3, P as PlannerElementData, J as BoundingBox } from './index-bae4b8e4.js';
6
+ import { u as Vector2, V as Vector3, P as PlannerElementData, J as BoundingBox } from './index-102cd67d.js';
7
7
  import DivaUtils, { DivaError, md5 } from '@crystaldesign/diva-utils';
8
8
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
9
9
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
10
- import { d as dockingPointHandlerInst, h as handler2D } from './PlannerHandler2D-c0380cdc.js';
10
+ import { d as dockingPointHandlerInst, h as handler2D } from './PlannerHandler2D-e43996e4.js';
11
11
  import '@babel/runtime/helpers/objectWithoutProperties';
12
12
  import 'axios';
13
13
  import '@babel/runtime/helpers/typeof';
@@ -5,10 +5,10 @@ import _createClass from '@babel/runtime/helpers/createClass';
5
5
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
6
6
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
7
7
  import _regeneratorRuntime from '@babel/runtime/regenerator';
8
- import { V as Vector3, p as poseOf, g as getSnapPlace, c as getDockingGroups, d as getElementShape, e as getCarrierSlots, h as getSlotPlaces, m as moveGroupRigidly, i as isSamePose, j as getGroupBlock, k as fitsInsideRoom, l as keepInsideRoom, n as bindToWalls, o as sameGeoExtent, q as getCornerEnd, r as getDoorClearanceRects, t as rectCorners, u as Vector2, M as MAX_GUEST_DEPTH, v as slotExempt, w as bodiesOverlap, x as getNearestMember, y as toPlacementOffset, z as getTurnDeg, A as moveSlotMember, B as moveShape, C as layersCollide, D as shapesCollide, P as PlannerElementData, E as parseGuestPlacement, F as saveElementArticleCodex, H as parseSetPlanData, I as isSavePlannerV2, J as BoundingBox, K as movePoints } from './index-bae4b8e4.js';
8
+ import { V as Vector3, p as poseOf, g as getSnapPlace, c as getDockingGroups, d as getElementShape, e as getCarrierSlots, h as getSlotPlaces, m as moveGroupRigidly, i as isSamePose, j as getGroupBlock, k as fitsInsideRoom, l as keepInsideRoom, n as bindToWalls, o as sameGeoExtent, q as getCornerEnd, r as getDoorClearanceRects, t as rectCorners, u as Vector2, M as MAX_GUEST_DEPTH, v as slotExempt, w as bodiesOverlap, x as getNearestMember, y as toPlacementOffset, z as getTurnDeg, A as moveSlotMember, B as moveShape, C as layersCollide, D as shapesCollide, P as PlannerElementData, E as parseGuestPlacement, F as saveElementArticleCodex, H as parseSetPlanData, I as isSavePlannerV2, J as BoundingBox, K as movePoints } from './index-102cd67d.js';
9
9
  import DivaUtils, { DivaError, md5 } from '@crystaldesign/diva-utils';
10
10
  import { computeDockedTransform } from '@crystaldesign/planner-core';
11
- import { d as dockingPointHandlerInst, h as handler2D } from './PlannerHandler2D-c0380cdc.js';
11
+ import { d as dockingPointHandlerInst, h as handler2D } from './PlannerHandler2D-e43996e4.js';
12
12
  import '@babel/runtime/helpers/objectWithoutProperties';
13
13
  import 'axios';
14
14
  import '@babel/runtime/helpers/typeof';
@@ -70,6 +70,15 @@ var PATH_STEP = 2;
70
70
  var DEPTH_NOISE = 1e-6;
71
71
  /** cm within which a dragged guest snaps into a free place of a slot that takes it. */
72
72
  var SLOT_SNAP_DISTANCE = 20;
73
+ /**
74
+ * cm within which a group dragged in a room docks (between the docking points), at least the viewer's own docking
75
+ * distance: as far as a slot snap reaches. The bodies block the drag at contact and a pointer moves several cm per event,
76
+ * so the group is mostly pushed into the element it docks to; it has to dock from such a pose, not only from the few cm
77
+ * before contact.
78
+ */
79
+ var ROOM_DOCK_SNAP_DISTANCE = SLOT_SNAP_DISTANCE;
80
+ /** cm between two docking points that meet at a dock pose (the float noise of the docked transform). */
81
+ var DOCK_CONTACT_DISTANCE = 0.1;
73
82
  /** cm within which a drag counts as back at its start (the float noise of the summed moves). */
74
83
  var START_NOISE = 1e-6;
75
84
  var toFloorRect = function toFloorRect(block, pose) {
@@ -1681,13 +1690,14 @@ var DivaStandardPlanner = /*#__PURE__*/function () {
1681
1690
  };
1682
1691
  }
1683
1692
 
1684
- // The group follows the grabbed element rigidly to the wall or inside-room pose of the raw centre, also where it runs
1685
- // into an obstacle: what it runs into there is kept as `blockedBy` (the viewer shows the drag blocked, a release there
1686
- // goes back to the start). A forced group that fits on no wall is kept inside the room like a free one. Back at the
1687
- // start (a cancel, a blocked release) it stands exactly where it started, nothing snaps.
1693
+ // The group follows the grabbed element rigidly to the wall or inside-room pose of the raw centre, and from there onto
1694
+ // a dock within ROOM_DOCK_SNAP_DISTANCE, also where it runs into an obstacle: what it runs into there is kept as
1695
+ // `blockedBy` (the viewer shows the drag blocked, a release there goes back to the start). A forced group that fits on
1696
+ // no wall is kept inside the room like a free one. Back at the start (a cancel, a blocked release) it stands exactly
1697
+ // where it started, nothing snaps.
1688
1698
  }, {
1689
1699
  key: "updateRoomDrag",
1690
- value: function updateRoomDrag(room, drag, deltaMove) {
1700
+ value: function updateRoomDrag(room, drag, deltaMove, autoDockingDistance) {
1691
1701
  drag.dx += deltaMove.x;
1692
1702
  drag.dz += deltaMove.z;
1693
1703
  var _drag$start2 = drag.start,
@@ -1706,12 +1716,19 @@ var DivaStandardPlanner = /*#__PURE__*/function () {
1706
1716
  center: drag.start.center,
1707
1717
  rotDeg: rotDeg
1708
1718
  };
1709
- var wanted = atStart ? startPose : slotPose !== null && slotPose !== void 0 ? slotPose : wallPose && (drag.wallMode === 'forced' || snapsToWall) ? wallPose : insidePose(block, {
1719
+ var placed = atStart ? startPose : slotPose !== null && slotPose !== void 0 ? slotPose : wallPose && (drag.wallMode === 'forced' || snapsToWall) ? wallPose : insidePose(block, {
1710
1720
  center: rawCenter,
1711
1721
  rotDeg: rotDeg
1712
1722
  }, room);
1713
- drag.blockedBy = this.blockersAt(drag, wanted);
1714
- moveGroupRigidly([].concat(_toConsumableArray(drag.members), _toConsumableArray(drag.followers)), drag.current, wanted);
1723
+ var group = [].concat(_toConsumableArray(drag.members), _toConsumableArray(drag.followers));
1724
+ moveGroupRigidly(group, drag.current, placed);
1725
+ // Pushed against the element it docks to, the group touches it docked instead of standing blocked in it, so the
1726
+ // release docks it (see snapToDock).
1727
+ var reach = autoDockingDistance === 0 ? 0 : Math.max(autoDockingDistance, ROOM_DOCK_SNAP_DISTANCE);
1728
+ var dock = atStart || slotPose ? undefined : this.getDockSnapPose(drag, placed, reach);
1729
+ var wanted = dock !== null && dock !== void 0 ? dock : placed;
1730
+ moveGroupRigidly(group, placed, wanted);
1731
+ drag.blockedBy = dock ? [] : this.blockersAt(drag, wanted);
1715
1732
  drag.current = wanted;
1716
1733
  drag.slotSnapped = !!slotPose;
1717
1734
  // A pair that overlapped at the start may only come apart, never go back in.
@@ -1724,6 +1741,44 @@ var DivaStandardPlanner = /*#__PURE__*/function () {
1724
1741
  });
1725
1742
  }
1726
1743
 
1744
+ /**
1745
+ * The pose of the group, standing at `pose`, where the grabbed element docks onto the nearest dock outside the group and
1746
+ * its guests (see findDockSnap), where nothing blocks it; undefined when no dock is that near, or the room rule would
1747
+ * move the docked group or something blocks it there that it does not dock to: then the group stays where the pointer
1748
+ * has it. Docked elements may reach into each other as members of a group do (a side panel standing out of the
1749
+ * outline), so every element the group docks to at that pose (both neighbours of a gap it fills) does not block.
1750
+ */
1751
+ }, {
1752
+ key: "getDockSnapPose",
1753
+ value: function getDockSnapPose(drag, pose, autoDockingDistance) {
1754
+ var element = this.plannerElements.get(drag.elementId);
1755
+ var group = [].concat(_toConsumableArray(drag.members), _toConsumableArray(drag.followers));
1756
+ var unitIds = group.map(function (member) {
1757
+ return member.ElementId;
1758
+ });
1759
+ var snap = element && this.findDockSnap(element, autoDockingDistance, unitIds);
1760
+ if (!element || !snap) return undefined;
1761
+ var _this$snapMove = this.snapMove(element, snap),
1762
+ from = _this$snapMove.from,
1763
+ to = _this$snapMove.to;
1764
+ var docked = movePose(pose, from, to);
1765
+ if (!this.getKeptPose(drag, docked)) return undefined;
1766
+ moveGroupRigidly(group, pose, docked);
1767
+ var others = this.getAllPlannerElements().filter(function (other) {
1768
+ return !unitIds.includes(other.ElementId);
1769
+ });
1770
+ var dockedTo = new Set(group.flatMap(function (member) {
1771
+ return _toConsumableArray(dockingPointHandlerInst.searchDockableElementsInArea(member, others, DOCK_CONTACT_DISTANCE).values()).map(function (pair) {
1772
+ return pair.targetDP.ElementId;
1773
+ });
1774
+ }));
1775
+ moveGroupRigidly(group, docked, pose);
1776
+ var docksTo = function docksTo(obstacle) {
1777
+ return obstacle.setId === undefined && obstacle.elementId !== undefined && dockedTo.has(obstacle.elementId);
1778
+ };
1779
+ return this.blockersAt(drag, docked).every(docksTo) ? docked : undefined;
1780
+ }
1781
+
1727
1782
  // The unit moved rigidly onto the nearest dock of `element` outside it (see findDockSnap), else with `slots` into the
1728
1783
  // nearest free slot place (see findSlotSnap).
1729
1784
  }, {
@@ -3478,7 +3533,7 @@ var DivaStandardPlanner = /*#__PURE__*/function () {
3478
3533
  if (room && roomDrag && !roomDrag.rotating && transState == 'UPDATE' && roomDrag.members.some(function (member) {
3479
3534
  return member.ElementId == elementId;
3480
3535
  })) {
3481
- if (elementId == roomDrag.elementId) this.updateRoomDrag(room, roomDrag, deltaMove);
3536
+ if (elementId == roomDrag.elementId) this.updateRoomDrag(room, roomDrag, deltaMove, autoDockingDistance);
3482
3537
  return false;
3483
3538
  }
3484
3539
  if (this.plannerElements.has(elementId)) {
@@ -1,7 +1,7 @@
1
1
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
2
2
  import _createClass from '@babel/runtime/helpers/createClass';
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
- import './index-bae4b8e4.js';
4
+ import './index-102cd67d.js';
5
5
  import DivaUtils from '@crystaldesign/diva-utils';
6
6
  import '@babel/runtime/helpers/slicedToArray';
7
7
  import '@babel/runtime/helpers/asyncToGenerator';
@@ -3,7 +3,7 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
3
3
  import _createClass from '@babel/runtime/helpers/createClass';
4
4
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
5
5
  import _regeneratorRuntime from '@babel/runtime/regenerator';
6
- import { L as bootMark, R as Rendering, N as HQRenderScript } from './index-bae4b8e4.js';
6
+ import { L as bootMark, R as Rendering, N as HQRenderScript } from './index-102cd67d.js';
7
7
  import DivaUtils, { DivaError } from '@crystaldesign/diva-utils';
8
8
  import { HubConnectionBuilder, LogLevel } from '@microsoft/signalr';
9
9
  import io from 'socket.io-client';
@@ -1,6 +1,6 @@
1
1
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
2
2
  import _createClass from '@babel/runtime/helpers/createClass';
3
- import './index-bae4b8e4.js';
3
+ import './index-102cd67d.js';
4
4
  import '@babel/runtime/helpers/slicedToArray';
5
5
  import '@babel/runtime/helpers/asyncToGenerator';
6
6
  import '@babel/runtime/helpers/defineProperty';
@@ -1,6 +1,6 @@
1
1
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
2
2
  import _createClass from '@babel/runtime/helpers/createClass';
3
- import { a as articleHandlerInstance } from './index-bae4b8e4.js';
3
+ import { a as articleHandlerInstance } from './index-102cd67d.js';
4
4
  import { SAPOrderLineData } from '@crystaldesign/basket-model';
5
5
  import DivaUtils, { DivaError } from '@crystaldesign/diva-utils';
6
6
  import '@babel/runtime/helpers/slicedToArray';