@plurid/plurid-engine 0.0.0-17 → 0.0.0-18

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.
@@ -2108,7 +2108,7 @@ var index$5 = Object.freeze({
2108
2108
  computeZigZagLayout: computeZigZagLayout
2109
2109
  });
2110
2110
 
2111
- const resolveViewItem = (planes, view, configuration, origin = "origin") => {
2111
+ const resolveViewItem = (planes, view, configuration, origin = "origin", getCount) => {
2112
2112
  const {protocol: protocol, host: host} = configuration.network;
2113
2113
  const viewData = typeof view === "string" ? view : view.plane;
2114
2114
  const viewAddress = computePlaneAddress(viewData, undefined, origin);
@@ -2127,9 +2127,11 @@ const resolveViewItem = (planes, view, configuration, origin = "origin") => {
2127
2127
  const match = isoMatcher.match(viewData);
2128
2128
  if (match) {
2129
2129
  const route = match.match.value;
2130
+ const count = getCount ? getCount() : uuid.generate();
2131
+ const planeID = route + "@" + count;
2130
2132
  const treePlane = {
2131
2133
  sourceID: route,
2132
- planeID: uuid.generate(),
2134
+ planeID: planeID,
2133
2135
  route: viewAddress,
2134
2136
  routeDivisions: {
2135
2137
  protocol: {
@@ -2187,14 +2189,26 @@ const resolveViewItem = (planes, view, configuration, origin = "origin") => {
2187
2189
  return;
2188
2190
  };
2189
2191
 
2190
- const computeSpaceTree = (planes, view, configuration, origin = "origin") => {
2192
+ const computeSpaceTree = (planes, view, configuration, layout, origin = "origin", getCount) => {
2191
2193
  const treePlanes = [];
2192
2194
  for (const viewItem of view) {
2193
- const treePlane = resolveViewItem(planes, viewItem, configuration, origin);
2195
+ const treePlane = resolveViewItem(planes, viewItem, configuration, origin, getCount);
2194
2196
  if (treePlane) {
2195
2197
  treePlanes.push(treePlane);
2196
2198
  }
2197
2199
  }
2200
+ if (!layout) {
2201
+ const layoutlessTreePlanes = treePlanes.map((plane => Object.assign(Object.assign({}, plane), {
2202
+ location: {
2203
+ rotateX: 0,
2204
+ rotateY: 0,
2205
+ translateX: 0,
2206
+ translateY: 0,
2207
+ translateZ: 0
2208
+ }
2209
+ })));
2210
+ return layoutlessTreePlanes;
2211
+ }
2198
2212
  switch (configuration.space.layout.type) {
2199
2213
  case LAYOUT_TYPES.COLUMNS:
2200
2214
  {
@@ -2570,12 +2584,16 @@ var logic = Object.freeze({
2570
2584
 
2571
2585
  class Tree {
2572
2586
  constructor(data, origin = "origin") {
2587
+ this.count = 0;
2573
2588
  this.data = data;
2574
2589
  this.origin = origin;
2575
2590
  }
2576
2591
  compute() {
2577
- const {planes: planes, view: view, configuration: configuration} = this.data;
2578
- return computeSpaceTree(planes, view, configuration, this.origin);
2592
+ const {planes: planes, view: view, configuration: configuration, layout: layout} = this.data;
2593
+ return computeSpaceTree(planes, view, configuration, layout, this.origin, this.getCount.bind(this));
2594
+ }
2595
+ getCount() {
2596
+ return this.count++;
2579
2597
  }
2580
2598
  }
2581
2599
 
@@ -2653,6 +2671,7 @@ const resolveSpace = (view, configuration, planesRegistrar, currentState, localS
2653
2671
  const computedTree = spaceTree.compute();
2654
2672
  const stateSpace = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
2655
2673
  loading: true,
2674
+ resolvedLayout: false,
2656
2675
  animatedTransform: false,
2657
2676
  transformTime: 450,
2658
2677
  scale: 1,