@lv-x-software-house/x_view 1.2.8-dev.16 → 1.2.8-dev.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.
package/dist/index.js CHANGED
@@ -16211,51 +16211,33 @@ function XViewScene({
16211
16211
  return null;
16212
16212
  };
16213
16213
  Object.values(nodeObjects).forEach((mesh) => {
16214
- const dateProp = mesh.userData.Date;
16214
+ var _a2;
16215
+ const dateProp = mesh.userData.Date || ((_a2 = (mesh.userData.properties || []).find(
16216
+ (p) => {
16217
+ var _a3;
16218
+ return ((_a3 = p.name) == null ? void 0 : _a3.toLowerCase()) === "data";
16219
+ }
16220
+ )) == null ? void 0 : _a2.value);
16215
16221
  let nodeInfo = { mesh, type: "point", label: "", isUndated: true };
16216
16222
  if (dateProp) {
16217
- if (dateProp.date) {
16218
- const date = parseDate2(dateProp.date);
16219
- if (date) {
16220
- nodeInfo.startDate = date;
16221
- nodeInfo.endDate = date;
16222
- nodeInfo.label = dateProp.date;
16223
- nodeInfo.isUndated = false;
16224
- allTimePoints.add(date.getTime());
16225
- }
16226
- } else if (dateProp.year) {
16227
- const year = parseInt(dateProp.year, 10);
16228
- if (!isNaN(year)) {
16229
- const date = new Date(year, 0, 1);
16230
- nodeInfo.startDate = date;
16231
- nodeInfo.endDate = date;
16232
- nodeInfo.label = String(year);
16233
- nodeInfo.isUndated = false;
16234
- allTimePoints.add(date.getTime());
16235
- }
16236
- } else if (dateProp.date_interval && dateProp.date_interval.start) {
16237
- const startYear = parseInt(dateProp.date_interval.start, 10);
16238
- const endYear = parseInt(dateProp.date_interval.end, 10) || startYear;
16239
- if (!isNaN(startYear)) {
16240
- const startDate = new Date(startYear, 0, 1);
16241
- const endDate = new Date(endYear, 11, 31);
16242
- nodeInfo.type = "interval";
16243
- nodeInfo.startDate = startDate;
16244
- nodeInfo.endDate = endDate;
16245
- nodeInfo.label = `${startYear} - ${endYear}`;
16246
- nodeInfo.isUndated = false;
16247
- allTimePoints.add(startDate.getTime());
16248
- allTimePoints.add(endDate.getTime());
16249
- }
16223
+ const info = parseDateProp(dateProp);
16224
+ if (!info.isUndated) {
16225
+ nodeInfo.startDate = info.startDate;
16226
+ nodeInfo.endDate = info.endDate;
16227
+ nodeInfo.label = info.label;
16228
+ nodeInfo.type = info.type;
16229
+ nodeInfo.isUndated = false;
16230
+ allTimePoints.add(info.startDate.getTime());
16231
+ if (info.endDate) allTimePoints.add(info.endDate.getTime());
16250
16232
  }
16251
16233
  }
16252
16234
  timelineNodes.push(nodeInfo);
16253
16235
  });
16254
16236
  if (timelineNodes.length === 0) return;
16255
- const sortedTimePoints = Array.from(allTimePoints).sort((a, b) => a - b);
16256
- const maxTimeIndex = sortedTimePoints.length - 1;
16237
+ const sortedTimePoints2 = Array.from(allTimePoints).sort((a, b) => a - b);
16238
+ const maxTimeIndex = sortedTimePoints2.length - 1;
16257
16239
  const timeToYMap = new Map(
16258
- sortedTimePoints.map((time, index) => [
16240
+ sortedTimePoints2.map((time, index) => [
16259
16241
  time,
16260
16242
  (index - maxTimeIndex) * TIMELINE_LAYER_SPACING_Y
16261
16243
  ])
@@ -16374,50 +16356,34 @@ function XViewScene({
16374
16356
  return null;
16375
16357
  };
16376
16358
  versionMeshes.forEach((mesh) => {
16377
- const dateProp = mesh.userData.Date;
16378
- if (!dateProp) return;
16379
- let nodeInfo = { mesh, type: "point", label: "" };
16380
- if (dateProp.date) {
16381
- const date = parseDate2(dateProp.date);
16382
- if (date) {
16383
- nodeInfo.startDate = date;
16384
- nodeInfo.endDate = date;
16385
- nodeInfo.label = dateProp.date;
16386
- allTimePoints.add(date.getTime());
16387
- timelineNodes.push(nodeInfo);
16388
- }
16389
- } else if (dateProp.year) {
16390
- const year = parseInt(dateProp.year, 10);
16391
- if (!isNaN(year)) {
16392
- const date = new Date(year, 0, 1);
16393
- nodeInfo.startDate = date;
16394
- nodeInfo.endDate = date;
16395
- nodeInfo.label = String(year);
16396
- allTimePoints.add(date.getTime());
16397
- timelineNodes.push(nodeInfo);
16398
- }
16399
- } else if (dateProp.date_interval && dateProp.date_interval.start) {
16400
- const startYear = parseInt(dateProp.date_interval.start, 10);
16401
- const endYear = parseInt(dateProp.date_interval.end, 10) || startYear;
16402
- if (!isNaN(startYear)) {
16403
- const startDate = new Date(startYear, 0, 1);
16404
- const endDate = new Date(endYear, 11, 31);
16405
- nodeInfo.type = "interval";
16406
- nodeInfo.startDate = startDate;
16407
- nodeInfo.endDate = endDate;
16408
- nodeInfo.label = `${startYear} - ${endYear}`;
16409
- allTimePoints.add(startDate.getTime());
16410
- allTimePoints.add(endDate.getTime());
16411
- timelineNodes.push(nodeInfo);
16359
+ var _a2;
16360
+ const dateProp = mesh.userData.Date || ((_a2 = (mesh.userData.properties || []).find(
16361
+ (p) => {
16362
+ var _a3;
16363
+ return ((_a3 = p.name) == null ? void 0 : _a3.toLowerCase()) === "data";
16412
16364
  }
16365
+ )) == null ? void 0 : _a2.value);
16366
+ if (!dateProp) return;
16367
+ const info = parseDateProp(dateProp);
16368
+ if (!info.isUndated) {
16369
+ const nodeInfo = {
16370
+ mesh,
16371
+ type: info.type,
16372
+ startDate: info.startDate,
16373
+ endDate: info.endDate,
16374
+ label: info.label
16375
+ };
16376
+ allTimePoints.add(info.startDate.getTime());
16377
+ if (info.endDate) allTimePoints.add(info.endDate.getTime());
16378
+ timelineNodes.push(nodeInfo);
16413
16379
  }
16414
16380
  });
16415
16381
  if (timelineNodes.length === 0) return;
16416
- const sortedTimePoints = Array.from(allTimePoints).sort((a, b) => a - b);
16382
+ const maxTimeIndex = sortedTimePoints.length - 1;
16417
16383
  const timeToYMap = new Map(
16418
16384
  sortedTimePoints.map((time, index) => [
16419
16385
  time,
16420
- index * TIMELINE_LAYER_SPACING_Y
16386
+ (index - maxTimeIndex) * TIMELINE_LAYER_SPACING_Y
16421
16387
  ])
16422
16388
  );
16423
16389
  timelineNodes.sort(
@@ -16425,11 +16391,27 @@ function XViewScene({
16425
16391
  );
16426
16392
  const baseX = sourceMesh.position.x + TIMELINE_NODE_SPACING_X;
16427
16393
  const baseY = sourceMesh.position.y;
16428
- const maxNodeIndex = timelineNodes.length - 1;
16429
- timelineNodes.forEach((node, index) => {
16394
+ const columns = [];
16395
+ timelineNodes.forEach((node) => {
16430
16396
  const { mesh, type, startDate, endDate, label } = node;
16431
- const y = baseY + (index - maxNodeIndex) * TIMELINE_LAYER_SPACING_Y;
16432
- const versionTween = new import_tween2.Tween(mesh.position).to({ x: baseX, y, z: 0 }, 1500).easing(import_tween2.Easing.Cubic.InOut);
16397
+ const startY = timeToYMap.get(startDate.getTime());
16398
+ const endY = timeToYMap.get(endDate.getTime()) || startY;
16399
+ let foundColumn = false;
16400
+ for (let i = 0; i < columns.length; i++) {
16401
+ if (columns[i].endY < startY) {
16402
+ node.columnIndex = i;
16403
+ columns[i].endY = endY;
16404
+ foundColumn = true;
16405
+ break;
16406
+ }
16407
+ }
16408
+ if (!foundColumn) {
16409
+ node.columnIndex = columns.length;
16410
+ columns.push({ endY });
16411
+ }
16412
+ const x = baseX + node.columnIndex * TIMELINE_NODE_SPACING_X;
16413
+ const y = baseY + startY;
16414
+ const versionTween = new import_tween2.Tween(mesh.position).to({ x, y, z: 0 }, 1500).easing(import_tween2.Easing.Cubic.InOut);
16433
16415
  tweenGroup.add(versionTween);
16434
16416
  versionTween.start();
16435
16417
  if (!mesh.getObjectByName("questDateLabel")) {
@@ -16797,11 +16779,11 @@ function XViewScene({
16797
16779
  }
16798
16780
  }
16799
16781
  });
16800
- const sortedTimePoints = Array.from(allActiveTimePoints).sort(
16782
+ const sortedTimePoints2 = Array.from(allActiveTimePoints).sort(
16801
16783
  (a, b) => a - b
16802
16784
  );
16803
16785
  const timeToYMap = /* @__PURE__ */ new Map();
16804
- sortedTimePoints.forEach((ms, idx) => {
16786
+ sortedTimePoints2.forEach((ms, idx) => {
16805
16787
  timeToYMap.set(ms, idx * TIMELINE_LAYER_SPACING_Y);
16806
16788
  });
16807
16789
  const startX = -((QUEST_STATUS_ORDER.length - 1) * QUEST_LENS_COLUMN_SPACING) / 2;
@@ -16820,7 +16802,7 @@ function XViewScene({
16820
16802
  if (!timeInfo.isUndated) {
16821
16803
  nodeY = timeToYMap.get(timeInfo.startDate.getTime());
16822
16804
  } else {
16823
- const undatedOffset = sortedTimePoints.length > 0 ? sortedTimePoints.length * 5 : 0;
16805
+ const undatedOffset = sortedTimePoints2.length > 0 ? sortedTimePoints2.length * 5 : 0;
16824
16806
  nodeY = -40 - rowIndex * QUEST_LENS_ROW_SPACING - undatedOffset;
16825
16807
  }
16826
16808
  const posKey = `${statusName}_${nodeY}`;
@@ -16903,7 +16885,7 @@ function XViewScene({
16903
16885
  if (!timeInfo.isUndated) {
16904
16886
  targetY = timeToYMap.get(timeInfo.startDate.getTime());
16905
16887
  } else {
16906
- const undatedOffset = sortedTimePoints.length > 0 ? sortedTimePoints.length * 5 : 0;
16888
+ const undatedOffset = sortedTimePoints2.length > 0 ? sortedTimePoints2.length * 5 : 0;
16907
16889
  targetY = -40 - rowIndex * QUEST_LENS_ROW_SPACING - undatedOffset;
16908
16890
  }
16909
16891
  const posKey = `${statusName}_${targetY}`;
package/dist/index.mjs CHANGED
@@ -16274,51 +16274,33 @@ function XViewScene({
16274
16274
  return null;
16275
16275
  };
16276
16276
  Object.values(nodeObjects).forEach((mesh) => {
16277
- const dateProp = mesh.userData.Date;
16277
+ var _a2;
16278
+ const dateProp = mesh.userData.Date || ((_a2 = (mesh.userData.properties || []).find(
16279
+ (p) => {
16280
+ var _a3;
16281
+ return ((_a3 = p.name) == null ? void 0 : _a3.toLowerCase()) === "data";
16282
+ }
16283
+ )) == null ? void 0 : _a2.value);
16278
16284
  let nodeInfo = { mesh, type: "point", label: "", isUndated: true };
16279
16285
  if (dateProp) {
16280
- if (dateProp.date) {
16281
- const date = parseDate2(dateProp.date);
16282
- if (date) {
16283
- nodeInfo.startDate = date;
16284
- nodeInfo.endDate = date;
16285
- nodeInfo.label = dateProp.date;
16286
- nodeInfo.isUndated = false;
16287
- allTimePoints.add(date.getTime());
16288
- }
16289
- } else if (dateProp.year) {
16290
- const year = parseInt(dateProp.year, 10);
16291
- if (!isNaN(year)) {
16292
- const date = new Date(year, 0, 1);
16293
- nodeInfo.startDate = date;
16294
- nodeInfo.endDate = date;
16295
- nodeInfo.label = String(year);
16296
- nodeInfo.isUndated = false;
16297
- allTimePoints.add(date.getTime());
16298
- }
16299
- } else if (dateProp.date_interval && dateProp.date_interval.start) {
16300
- const startYear = parseInt(dateProp.date_interval.start, 10);
16301
- const endYear = parseInt(dateProp.date_interval.end, 10) || startYear;
16302
- if (!isNaN(startYear)) {
16303
- const startDate = new Date(startYear, 0, 1);
16304
- const endDate = new Date(endYear, 11, 31);
16305
- nodeInfo.type = "interval";
16306
- nodeInfo.startDate = startDate;
16307
- nodeInfo.endDate = endDate;
16308
- nodeInfo.label = `${startYear} - ${endYear}`;
16309
- nodeInfo.isUndated = false;
16310
- allTimePoints.add(startDate.getTime());
16311
- allTimePoints.add(endDate.getTime());
16312
- }
16286
+ const info = parseDateProp(dateProp);
16287
+ if (!info.isUndated) {
16288
+ nodeInfo.startDate = info.startDate;
16289
+ nodeInfo.endDate = info.endDate;
16290
+ nodeInfo.label = info.label;
16291
+ nodeInfo.type = info.type;
16292
+ nodeInfo.isUndated = false;
16293
+ allTimePoints.add(info.startDate.getTime());
16294
+ if (info.endDate) allTimePoints.add(info.endDate.getTime());
16313
16295
  }
16314
16296
  }
16315
16297
  timelineNodes.push(nodeInfo);
16316
16298
  });
16317
16299
  if (timelineNodes.length === 0) return;
16318
- const sortedTimePoints = Array.from(allTimePoints).sort((a, b) => a - b);
16319
- const maxTimeIndex = sortedTimePoints.length - 1;
16300
+ const sortedTimePoints2 = Array.from(allTimePoints).sort((a, b) => a - b);
16301
+ const maxTimeIndex = sortedTimePoints2.length - 1;
16320
16302
  const timeToYMap = new Map(
16321
- sortedTimePoints.map((time, index) => [
16303
+ sortedTimePoints2.map((time, index) => [
16322
16304
  time,
16323
16305
  (index - maxTimeIndex) * TIMELINE_LAYER_SPACING_Y
16324
16306
  ])
@@ -16437,50 +16419,34 @@ function XViewScene({
16437
16419
  return null;
16438
16420
  };
16439
16421
  versionMeshes.forEach((mesh) => {
16440
- const dateProp = mesh.userData.Date;
16441
- if (!dateProp) return;
16442
- let nodeInfo = { mesh, type: "point", label: "" };
16443
- if (dateProp.date) {
16444
- const date = parseDate2(dateProp.date);
16445
- if (date) {
16446
- nodeInfo.startDate = date;
16447
- nodeInfo.endDate = date;
16448
- nodeInfo.label = dateProp.date;
16449
- allTimePoints.add(date.getTime());
16450
- timelineNodes.push(nodeInfo);
16451
- }
16452
- } else if (dateProp.year) {
16453
- const year = parseInt(dateProp.year, 10);
16454
- if (!isNaN(year)) {
16455
- const date = new Date(year, 0, 1);
16456
- nodeInfo.startDate = date;
16457
- nodeInfo.endDate = date;
16458
- nodeInfo.label = String(year);
16459
- allTimePoints.add(date.getTime());
16460
- timelineNodes.push(nodeInfo);
16461
- }
16462
- } else if (dateProp.date_interval && dateProp.date_interval.start) {
16463
- const startYear = parseInt(dateProp.date_interval.start, 10);
16464
- const endYear = parseInt(dateProp.date_interval.end, 10) || startYear;
16465
- if (!isNaN(startYear)) {
16466
- const startDate = new Date(startYear, 0, 1);
16467
- const endDate = new Date(endYear, 11, 31);
16468
- nodeInfo.type = "interval";
16469
- nodeInfo.startDate = startDate;
16470
- nodeInfo.endDate = endDate;
16471
- nodeInfo.label = `${startYear} - ${endYear}`;
16472
- allTimePoints.add(startDate.getTime());
16473
- allTimePoints.add(endDate.getTime());
16474
- timelineNodes.push(nodeInfo);
16422
+ var _a2;
16423
+ const dateProp = mesh.userData.Date || ((_a2 = (mesh.userData.properties || []).find(
16424
+ (p) => {
16425
+ var _a3;
16426
+ return ((_a3 = p.name) == null ? void 0 : _a3.toLowerCase()) === "data";
16475
16427
  }
16428
+ )) == null ? void 0 : _a2.value);
16429
+ if (!dateProp) return;
16430
+ const info = parseDateProp(dateProp);
16431
+ if (!info.isUndated) {
16432
+ const nodeInfo = {
16433
+ mesh,
16434
+ type: info.type,
16435
+ startDate: info.startDate,
16436
+ endDate: info.endDate,
16437
+ label: info.label
16438
+ };
16439
+ allTimePoints.add(info.startDate.getTime());
16440
+ if (info.endDate) allTimePoints.add(info.endDate.getTime());
16441
+ timelineNodes.push(nodeInfo);
16476
16442
  }
16477
16443
  });
16478
16444
  if (timelineNodes.length === 0) return;
16479
- const sortedTimePoints = Array.from(allTimePoints).sort((a, b) => a - b);
16445
+ const maxTimeIndex = sortedTimePoints.length - 1;
16480
16446
  const timeToYMap = new Map(
16481
16447
  sortedTimePoints.map((time, index) => [
16482
16448
  time,
16483
- index * TIMELINE_LAYER_SPACING_Y
16449
+ (index - maxTimeIndex) * TIMELINE_LAYER_SPACING_Y
16484
16450
  ])
16485
16451
  );
16486
16452
  timelineNodes.sort(
@@ -16488,11 +16454,27 @@ function XViewScene({
16488
16454
  );
16489
16455
  const baseX = sourceMesh.position.x + TIMELINE_NODE_SPACING_X;
16490
16456
  const baseY = sourceMesh.position.y;
16491
- const maxNodeIndex = timelineNodes.length - 1;
16492
- timelineNodes.forEach((node, index) => {
16457
+ const columns = [];
16458
+ timelineNodes.forEach((node) => {
16493
16459
  const { mesh, type, startDate, endDate, label } = node;
16494
- const y = baseY + (index - maxNodeIndex) * TIMELINE_LAYER_SPACING_Y;
16495
- const versionTween = new Tween2(mesh.position).to({ x: baseX, y, z: 0 }, 1500).easing(Easing2.Cubic.InOut);
16460
+ const startY = timeToYMap.get(startDate.getTime());
16461
+ const endY = timeToYMap.get(endDate.getTime()) || startY;
16462
+ let foundColumn = false;
16463
+ for (let i = 0; i < columns.length; i++) {
16464
+ if (columns[i].endY < startY) {
16465
+ node.columnIndex = i;
16466
+ columns[i].endY = endY;
16467
+ foundColumn = true;
16468
+ break;
16469
+ }
16470
+ }
16471
+ if (!foundColumn) {
16472
+ node.columnIndex = columns.length;
16473
+ columns.push({ endY });
16474
+ }
16475
+ const x = baseX + node.columnIndex * TIMELINE_NODE_SPACING_X;
16476
+ const y = baseY + startY;
16477
+ const versionTween = new Tween2(mesh.position).to({ x, y, z: 0 }, 1500).easing(Easing2.Cubic.InOut);
16496
16478
  tweenGroup.add(versionTween);
16497
16479
  versionTween.start();
16498
16480
  if (!mesh.getObjectByName("questDateLabel")) {
@@ -16860,11 +16842,11 @@ function XViewScene({
16860
16842
  }
16861
16843
  }
16862
16844
  });
16863
- const sortedTimePoints = Array.from(allActiveTimePoints).sort(
16845
+ const sortedTimePoints2 = Array.from(allActiveTimePoints).sort(
16864
16846
  (a, b) => a - b
16865
16847
  );
16866
16848
  const timeToYMap = /* @__PURE__ */ new Map();
16867
- sortedTimePoints.forEach((ms, idx) => {
16849
+ sortedTimePoints2.forEach((ms, idx) => {
16868
16850
  timeToYMap.set(ms, idx * TIMELINE_LAYER_SPACING_Y);
16869
16851
  });
16870
16852
  const startX = -((QUEST_STATUS_ORDER.length - 1) * QUEST_LENS_COLUMN_SPACING) / 2;
@@ -16883,7 +16865,7 @@ function XViewScene({
16883
16865
  if (!timeInfo.isUndated) {
16884
16866
  nodeY = timeToYMap.get(timeInfo.startDate.getTime());
16885
16867
  } else {
16886
- const undatedOffset = sortedTimePoints.length > 0 ? sortedTimePoints.length * 5 : 0;
16868
+ const undatedOffset = sortedTimePoints2.length > 0 ? sortedTimePoints2.length * 5 : 0;
16887
16869
  nodeY = -40 - rowIndex * QUEST_LENS_ROW_SPACING - undatedOffset;
16888
16870
  }
16889
16871
  const posKey = `${statusName}_${nodeY}`;
@@ -16966,7 +16948,7 @@ function XViewScene({
16966
16948
  if (!timeInfo.isUndated) {
16967
16949
  targetY = timeToYMap.get(timeInfo.startDate.getTime());
16968
16950
  } else {
16969
- const undatedOffset = sortedTimePoints.length > 0 ? sortedTimePoints.length * 5 : 0;
16951
+ const undatedOffset = sortedTimePoints2.length > 0 ? sortedTimePoints2.length * 5 : 0;
16970
16952
  targetY = -40 - rowIndex * QUEST_LENS_ROW_SPACING - undatedOffset;
16971
16953
  }
16972
16954
  const posKey = `${statusName}_${targetY}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.8-dev.16",
3
+ "version": "1.2.8-dev.18",
4
4
  "description": "Pacote privado contendo os componentes e lógica de renderização 3D do X View.",
5
5
  "author": "iv.x - Engenharia de Software - ivxsoftwarehouse@gmail.com",
6
6
  "license": "UNLICENSED",