@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.
@@ -2122,7 +2122,7 @@ var index$5 = Object.freeze({
2122
2122
  computeZigZagLayout: computeZigZagLayout
2123
2123
  });
2124
2124
 
2125
- const resolveViewItem = (planes, view, configuration, origin = "origin") => {
2125
+ const resolveViewItem = (planes, view, configuration, origin = "origin", getCount) => {
2126
2126
  const {protocol: protocol, host: host} = configuration.network;
2127
2127
  const viewData = typeof view === "string" ? view : view.plane;
2128
2128
  const viewAddress = computePlaneAddress(viewData, undefined, origin);
@@ -2141,9 +2141,11 @@ const resolveViewItem = (planes, view, configuration, origin = "origin") => {
2141
2141
  const match = isoMatcher.match(viewData);
2142
2142
  if (match) {
2143
2143
  const route = match.match.value;
2144
+ const count = getCount ? getCount() : pluridFunctions.uuid.generate();
2145
+ const planeID = route + "@" + count;
2144
2146
  const treePlane = {
2145
2147
  sourceID: route,
2146
- planeID: pluridFunctions.uuid.generate(),
2148
+ planeID: planeID,
2147
2149
  route: viewAddress,
2148
2150
  routeDivisions: {
2149
2151
  protocol: {
@@ -2201,14 +2203,26 @@ const resolveViewItem = (planes, view, configuration, origin = "origin") => {
2201
2203
  return;
2202
2204
  };
2203
2205
 
2204
- const computeSpaceTree = (planes, view, configuration, origin = "origin") => {
2206
+ const computeSpaceTree = (planes, view, configuration, layout, origin = "origin", getCount) => {
2205
2207
  const treePlanes = [];
2206
2208
  for (const viewItem of view) {
2207
- const treePlane = resolveViewItem(planes, viewItem, configuration, origin);
2209
+ const treePlane = resolveViewItem(planes, viewItem, configuration, origin, getCount);
2208
2210
  if (treePlane) {
2209
2211
  treePlanes.push(treePlane);
2210
2212
  }
2211
2213
  }
2214
+ if (!layout) {
2215
+ const layoutlessTreePlanes = treePlanes.map((plane => Object.assign(Object.assign({}, plane), {
2216
+ location: {
2217
+ rotateX: 0,
2218
+ rotateY: 0,
2219
+ translateX: 0,
2220
+ translateY: 0,
2221
+ translateZ: 0
2222
+ }
2223
+ })));
2224
+ return layoutlessTreePlanes;
2225
+ }
2212
2226
  switch (configuration.space.layout.type) {
2213
2227
  case pluridData.LAYOUT_TYPES.COLUMNS:
2214
2228
  {
@@ -2584,12 +2598,16 @@ var logic = Object.freeze({
2584
2598
 
2585
2599
  class Tree {
2586
2600
  constructor(data, origin = "origin") {
2601
+ this.count = 0;
2587
2602
  this.data = data;
2588
2603
  this.origin = origin;
2589
2604
  }
2590
2605
  compute() {
2591
- const {planes: planes, view: view, configuration: configuration} = this.data;
2592
- return computeSpaceTree(planes, view, configuration, this.origin);
2606
+ const {planes: planes, view: view, configuration: configuration, layout: layout} = this.data;
2607
+ return computeSpaceTree(planes, view, configuration, layout, this.origin, this.getCount.bind(this));
2608
+ }
2609
+ getCount() {
2610
+ return this.count++;
2593
2611
  }
2594
2612
  }
2595
2613
 
@@ -2667,6 +2685,7 @@ const resolveSpace = (view, configuration, planesRegistrar, currentState, localS
2667
2685
  const computedTree = spaceTree.compute();
2668
2686
  const stateSpace = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
2669
2687
  loading: true,
2688
+ resolvedLayout: false,
2670
2689
  animatedTransform: false,
2671
2690
  transformTime: 450,
2672
2691
  scale: 1,