@lv-x-software-house/x_view 1.2.5-dev.53 → 1.2.5-dev.55

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
@@ -242,7 +242,7 @@ var computeNodeMaterialProps = (colorHex) => {
242
242
  emissive: emissiveColor
243
243
  };
244
244
  };
245
- var createNodeMesh = (nodeData, position, glowTexture) => {
245
+ var createNodeMesh = (nodeData, position, glowTexture, forceShowQuestDate = false) => {
246
246
  let geometry, material, mesh;
247
247
  const colorHex = nodeData.color || "#ffffff";
248
248
  const userIntensity = nodeData.intensity !== void 0 ? Number(nodeData.intensity) : 0;
@@ -325,7 +325,7 @@ var createNodeMesh = (nodeData, position, glowTexture) => {
325
325
  label.name = "label";
326
326
  mesh.userData.labelObject = label;
327
327
  mesh.userData.labelOffset = new THREE.Vector3(0, 3.8, 0);
328
- if (nodeData.is_quest && nodeData.Date) {
328
+ if (nodeData.is_quest && nodeData.Date && forceShowQuestDate) {
329
329
  const timeInfo = parseDateProp(nodeData.Date);
330
330
  if (!timeInfo.isUndated && timeInfo.label) {
331
331
  const dateSprite = createTextSprite(timeInfo.label, 36);
@@ -344,6 +344,7 @@ var updateExistingNodeVisuals = (state, updatedNode) => {
344
344
  const oldLabelOffset = existingMesh.userData.labelOffset;
345
345
  const oldTimelineBar = existingMesh.userData.timelineIntervalBar;
346
346
  const oldTimelineEndLabel = existingMesh.userData.timelineEndLabel;
347
+ const hadQuestDateLabel = !!existingMesh.getObjectByName("questDateLabel");
347
348
  const currentIsImage = existingMesh.userData.useImageAsTexture === true || String(existingMesh.userData.useImageAsTexture) === "true";
348
349
  const newIsImage = updatedNode.useImageAsTexture === true || String(updatedNode.useImageAsTexture) === "true";
349
350
  const urlChanged = existingMesh.userData.textureImageUrl !== updatedNode.textureImageUrl;
@@ -369,7 +370,7 @@ var updateExistingNodeVisuals = (state, updatedNode) => {
369
370
  if (oldLabelObject.material) oldLabelObject.material.dispose();
370
371
  }
371
372
  }
372
- const newMesh = createNodeMesh(updatedNode, position, state.glowTexture);
373
+ const newMesh = createNodeMesh(updatedNode, position, state.glowTexture, hadQuestDateLabel);
373
374
  if (oldTimelineBar) {
374
375
  newMesh.userData.timelineIntervalBar = oldTimelineBar;
375
376
  }
@@ -918,10 +919,10 @@ var removeNodeFromScene = (state, nodeId) => {
918
919
  });
919
920
  }
920
921
  };
921
- var addStandaloneNodeToScene = (state, nodeData, position) => {
922
+ var addStandaloneNodeToScene = (state, nodeData, position, forceShowQuestDate = false) => {
922
923
  const { graphGroup, nodeObjects, clickableNodes, glowTexture } = state;
923
924
  if (!graphGroup) return;
924
- const mesh = createNodeMesh(nodeData, position, glowTexture);
925
+ const mesh = createNodeMesh(nodeData, position, glowTexture, forceShowQuestDate);
925
926
  mesh.scale.set(0.01, 0.01, 0.01);
926
927
  graphGroup.add(mesh);
927
928
  if (mesh.userData.labelObject) {
@@ -2329,7 +2330,7 @@ var userActionHandlers = {
2329
2330
  if (stateRef.current && stateRef.current.graphGroup) {
2330
2331
  const pos = oldMeshPosition.clone();
2331
2332
  pos.x += 12;
2332
- addStandaloneNodeToScene(stateRef.current, nextQuestNode, pos);
2333
+ addStandaloneNodeToScene(stateRef.current, nextQuestNode, pos, true);
2333
2334
  }
2334
2335
  }, 2e3);
2335
2336
  }
@@ -2774,7 +2775,8 @@ var IGNORED_KEYS = [
2774
2775
  "recurrence_config",
2775
2776
  "reviewStack",
2776
2777
  "timeline",
2777
- "milestone_ids"
2778
+ "milestone_ids",
2779
+ "dependency_ids"
2778
2780
  ];
2779
2781
  function extractCustomPropsFromNode(node) {
2780
2782
  const customPropTypes = node._customPropTypes || {};
@@ -10915,7 +10917,8 @@ function QuestDetailsPanel({
10915
10917
  currentUser,
10916
10918
  milestones = [],
10917
10919
  onUpdateMilestones = () => {
10918
- }
10920
+ },
10921
+ onFocusNode
10919
10922
  }) {
10920
10923
  var _a, _b;
10921
10924
  const initialRawTitle = (node == null ? void 0 : node.raw_title) || (((_a = node == null ? void 0 : node.name) == null ? void 0 : _a.includes(" - \xBB ")) ? node.name.split(" - \xBB ")[1] : node == null ? void 0 : node.name) || "";
@@ -11887,12 +11890,24 @@ ${noteText}` : noteText : entry.notes,
11887
11890
  "span",
11888
11891
  {
11889
11892
  key: depId,
11890
- className: `flex items-center gap-2 px-2 py-1 rounded-lg text-xs font-medium border ${isDone ? "bg-green-500/10 text-green-300 border-green-500/20" : "bg-amber-500/10 text-amber-300 border-amber-500/20"}`,
11891
- title: isDone ? "Pronta" : "Pendente"
11893
+ onClick: () => onFocusNode == null ? void 0 : onFocusNode(depNode),
11894
+ className: `flex items-center gap-2 px-2 py-1 rounded-lg text-xs font-medium border cursor-pointer hover:brightness-110 transition-all ${isDone ? "bg-green-500/10 text-green-300 border-green-500/20" : "bg-amber-500/10 text-amber-300 border-amber-500/20"}`,
11895
+ title: isDone ? `Pronta - Clique para focar` : `Pendente - Clique para focar`
11892
11896
  },
11893
11897
  /* @__PURE__ */ import_react20.default.createElement("span", { className: `w-1.5 h-1.5 rounded-full ${isDone ? "bg-green-400" : "bg-amber-400 animate-pulse"}` }),
11894
11898
  depNode.raw_title || depNode.name,
11895
- canEdit && /* @__PURE__ */ import_react20.default.createElement("button", { type: "button", onClick: () => handleRemoveDependency(depId), className: "hover:text-white transition-colors opacity-60 hover:opacity-100" }, /* @__PURE__ */ import_react20.default.createElement(import_fi19.FiX, { size: 12 }))
11899
+ canEdit && /* @__PURE__ */ import_react20.default.createElement(
11900
+ "button",
11901
+ {
11902
+ type: "button",
11903
+ onClick: (e) => {
11904
+ e.stopPropagation();
11905
+ handleRemoveDependency(depId);
11906
+ },
11907
+ className: "hover:text-white transition-colors opacity-60 hover:opacity-100 Ml-1"
11908
+ },
11909
+ /* @__PURE__ */ import_react20.default.createElement(import_fi19.FiX, { size: 12 })
11910
+ )
11896
11911
  );
11897
11912
  }), canEdit && /* @__PURE__ */ import_react20.default.createElement("div", { className: "flex-1 min-w-[120px] relative" }, /* @__PURE__ */ import_react20.default.createElement(
11898
11913
  "input",
@@ -14553,7 +14568,7 @@ function XViewScene({
14553
14568
  return !!objs[key];
14554
14569
  }, []);
14555
14570
  const addOrUpdateNodeMesh = (0, import_react29.useCallback)(
14556
- (nodeData, position, suppressVersionUpdate = false) => {
14571
+ (nodeData, position, suppressVersionUpdate = false, forceShowQuestDate = false) => {
14557
14572
  const {
14558
14573
  graphGroup,
14559
14574
  nodeObjects,
@@ -14574,7 +14589,8 @@ function XViewScene({
14574
14589
  const mesh = createNodeMesh(
14575
14590
  nodeData,
14576
14591
  position || new THREE3.Vector3(),
14577
- glowTexture
14592
+ glowTexture,
14593
+ forceShowQuestDate
14578
14594
  );
14579
14595
  graphGroup.add(mesh);
14580
14596
  if (mesh.userData.labelObject) {
@@ -17831,8 +17847,14 @@ function XViewScene({
17831
17847
  }, []);
17832
17848
  const handleFocusNode = (0, import_react29.useCallback)(
17833
17849
  (nodeData) => {
17850
+ var _a2;
17834
17851
  if (!nodeData) return;
17835
- const nodeMesh = stateRef.current.nodeObjects[String(nodeData.id)];
17852
+ let nodeMesh = stateRef.current.nodeObjects[String(nodeData.id)];
17853
+ if (!nodeMesh) {
17854
+ const spawnPos = ((_a2 = stateRef.current.controls) == null ? void 0 : _a2.target.clone()) || new THREE3.Vector3();
17855
+ addStandaloneNodeToScene(stateRef.current, nodeData, spawnPos);
17856
+ nodeMesh = stateRef.current.nodeObjects[String(nodeData.id)];
17857
+ }
17836
17858
  if (nodeMesh) {
17837
17859
  tweenToTarget(nodeMesh, 1.2);
17838
17860
  }
@@ -18309,6 +18331,7 @@ function XViewScene({
18309
18331
  {
18310
18332
  node: detailsNode,
18311
18333
  onClose: () => setDetailsNode(null),
18334
+ onFocusNode: handleFocusNode,
18312
18335
  onSave: (data) => userActionHandlers.handleSaveNodeDetails(actionHandlerContext, data),
18313
18336
  onNameChange: handleDetailNodeNameChange,
18314
18337
  onColorChange: handleDetailNodeColorChange,
package/dist/index.mjs CHANGED
@@ -203,7 +203,7 @@ var computeNodeMaterialProps = (colorHex) => {
203
203
  emissive: emissiveColor
204
204
  };
205
205
  };
206
- var createNodeMesh = (nodeData, position, glowTexture) => {
206
+ var createNodeMesh = (nodeData, position, glowTexture, forceShowQuestDate = false) => {
207
207
  let geometry, material, mesh;
208
208
  const colorHex = nodeData.color || "#ffffff";
209
209
  const userIntensity = nodeData.intensity !== void 0 ? Number(nodeData.intensity) : 0;
@@ -286,7 +286,7 @@ var createNodeMesh = (nodeData, position, glowTexture) => {
286
286
  label.name = "label";
287
287
  mesh.userData.labelObject = label;
288
288
  mesh.userData.labelOffset = new THREE.Vector3(0, 3.8, 0);
289
- if (nodeData.is_quest && nodeData.Date) {
289
+ if (nodeData.is_quest && nodeData.Date && forceShowQuestDate) {
290
290
  const timeInfo = parseDateProp(nodeData.Date);
291
291
  if (!timeInfo.isUndated && timeInfo.label) {
292
292
  const dateSprite = createTextSprite(timeInfo.label, 36);
@@ -305,6 +305,7 @@ var updateExistingNodeVisuals = (state, updatedNode) => {
305
305
  const oldLabelOffset = existingMesh.userData.labelOffset;
306
306
  const oldTimelineBar = existingMesh.userData.timelineIntervalBar;
307
307
  const oldTimelineEndLabel = existingMesh.userData.timelineEndLabel;
308
+ const hadQuestDateLabel = !!existingMesh.getObjectByName("questDateLabel");
308
309
  const currentIsImage = existingMesh.userData.useImageAsTexture === true || String(existingMesh.userData.useImageAsTexture) === "true";
309
310
  const newIsImage = updatedNode.useImageAsTexture === true || String(updatedNode.useImageAsTexture) === "true";
310
311
  const urlChanged = existingMesh.userData.textureImageUrl !== updatedNode.textureImageUrl;
@@ -330,7 +331,7 @@ var updateExistingNodeVisuals = (state, updatedNode) => {
330
331
  if (oldLabelObject.material) oldLabelObject.material.dispose();
331
332
  }
332
333
  }
333
- const newMesh = createNodeMesh(updatedNode, position, state.glowTexture);
334
+ const newMesh = createNodeMesh(updatedNode, position, state.glowTexture, hadQuestDateLabel);
334
335
  if (oldTimelineBar) {
335
336
  newMesh.userData.timelineIntervalBar = oldTimelineBar;
336
337
  }
@@ -879,10 +880,10 @@ var removeNodeFromScene = (state, nodeId) => {
879
880
  });
880
881
  }
881
882
  };
882
- var addStandaloneNodeToScene = (state, nodeData, position) => {
883
+ var addStandaloneNodeToScene = (state, nodeData, position, forceShowQuestDate = false) => {
883
884
  const { graphGroup, nodeObjects, clickableNodes, glowTexture } = state;
884
885
  if (!graphGroup) return;
885
- const mesh = createNodeMesh(nodeData, position, glowTexture);
886
+ const mesh = createNodeMesh(nodeData, position, glowTexture, forceShowQuestDate);
886
887
  mesh.scale.set(0.01, 0.01, 0.01);
887
888
  graphGroup.add(mesh);
888
889
  if (mesh.userData.labelObject) {
@@ -2290,7 +2291,7 @@ var userActionHandlers = {
2290
2291
  if (stateRef.current && stateRef.current.graphGroup) {
2291
2292
  const pos = oldMeshPosition.clone();
2292
2293
  pos.x += 12;
2293
- addStandaloneNodeToScene(stateRef.current, nextQuestNode, pos);
2294
+ addStandaloneNodeToScene(stateRef.current, nextQuestNode, pos, true);
2294
2295
  }
2295
2296
  }, 2e3);
2296
2297
  }
@@ -2735,7 +2736,8 @@ var IGNORED_KEYS = [
2735
2736
  "recurrence_config",
2736
2737
  "reviewStack",
2737
2738
  "timeline",
2738
- "milestone_ids"
2739
+ "milestone_ids",
2740
+ "dependency_ids"
2739
2741
  ];
2740
2742
  function extractCustomPropsFromNode(node) {
2741
2743
  const customPropTypes = node._customPropTypes || {};
@@ -10946,7 +10948,8 @@ function QuestDetailsPanel({
10946
10948
  currentUser,
10947
10949
  milestones = [],
10948
10950
  onUpdateMilestones = () => {
10949
- }
10951
+ },
10952
+ onFocusNode
10950
10953
  }) {
10951
10954
  var _a, _b;
10952
10955
  const initialRawTitle = (node == null ? void 0 : node.raw_title) || (((_a = node == null ? void 0 : node.name) == null ? void 0 : _a.includes(" - \xBB ")) ? node.name.split(" - \xBB ")[1] : node == null ? void 0 : node.name) || "";
@@ -11918,12 +11921,24 @@ ${noteText}` : noteText : entry.notes,
11918
11921
  "span",
11919
11922
  {
11920
11923
  key: depId,
11921
- className: `flex items-center gap-2 px-2 py-1 rounded-lg text-xs font-medium border ${isDone ? "bg-green-500/10 text-green-300 border-green-500/20" : "bg-amber-500/10 text-amber-300 border-amber-500/20"}`,
11922
- title: isDone ? "Pronta" : "Pendente"
11924
+ onClick: () => onFocusNode == null ? void 0 : onFocusNode(depNode),
11925
+ className: `flex items-center gap-2 px-2 py-1 rounded-lg text-xs font-medium border cursor-pointer hover:brightness-110 transition-all ${isDone ? "bg-green-500/10 text-green-300 border-green-500/20" : "bg-amber-500/10 text-amber-300 border-amber-500/20"}`,
11926
+ title: isDone ? `Pronta - Clique para focar` : `Pendente - Clique para focar`
11923
11927
  },
11924
11928
  /* @__PURE__ */ React19.createElement("span", { className: `w-1.5 h-1.5 rounded-full ${isDone ? "bg-green-400" : "bg-amber-400 animate-pulse"}` }),
11925
11929
  depNode.raw_title || depNode.name,
11926
- canEdit && /* @__PURE__ */ React19.createElement("button", { type: "button", onClick: () => handleRemoveDependency(depId), className: "hover:text-white transition-colors opacity-60 hover:opacity-100" }, /* @__PURE__ */ React19.createElement(FiX7, { size: 12 }))
11930
+ canEdit && /* @__PURE__ */ React19.createElement(
11931
+ "button",
11932
+ {
11933
+ type: "button",
11934
+ onClick: (e) => {
11935
+ e.stopPropagation();
11936
+ handleRemoveDependency(depId);
11937
+ },
11938
+ className: "hover:text-white transition-colors opacity-60 hover:opacity-100 Ml-1"
11939
+ },
11940
+ /* @__PURE__ */ React19.createElement(FiX7, { size: 12 })
11941
+ )
11927
11942
  );
11928
11943
  }), canEdit && /* @__PURE__ */ React19.createElement("div", { className: "flex-1 min-w-[120px] relative" }, /* @__PURE__ */ React19.createElement(
11929
11944
  "input",
@@ -14597,7 +14612,7 @@ function XViewScene({
14597
14612
  return !!objs[key];
14598
14613
  }, []);
14599
14614
  const addOrUpdateNodeMesh = useCallback4(
14600
- (nodeData, position, suppressVersionUpdate = false) => {
14615
+ (nodeData, position, suppressVersionUpdate = false, forceShowQuestDate = false) => {
14601
14616
  const {
14602
14617
  graphGroup,
14603
14618
  nodeObjects,
@@ -14618,7 +14633,8 @@ function XViewScene({
14618
14633
  const mesh = createNodeMesh(
14619
14634
  nodeData,
14620
14635
  position || new THREE3.Vector3(),
14621
- glowTexture
14636
+ glowTexture,
14637
+ forceShowQuestDate
14622
14638
  );
14623
14639
  graphGroup.add(mesh);
14624
14640
  if (mesh.userData.labelObject) {
@@ -17875,8 +17891,14 @@ function XViewScene({
17875
17891
  }, []);
17876
17892
  const handleFocusNode = useCallback4(
17877
17893
  (nodeData) => {
17894
+ var _a2;
17878
17895
  if (!nodeData) return;
17879
- const nodeMesh = stateRef.current.nodeObjects[String(nodeData.id)];
17896
+ let nodeMesh = stateRef.current.nodeObjects[String(nodeData.id)];
17897
+ if (!nodeMesh) {
17898
+ const spawnPos = ((_a2 = stateRef.current.controls) == null ? void 0 : _a2.target.clone()) || new THREE3.Vector3();
17899
+ addStandaloneNodeToScene(stateRef.current, nodeData, spawnPos);
17900
+ nodeMesh = stateRef.current.nodeObjects[String(nodeData.id)];
17901
+ }
17880
17902
  if (nodeMesh) {
17881
17903
  tweenToTarget(nodeMesh, 1.2);
17882
17904
  }
@@ -18353,6 +18375,7 @@ function XViewScene({
18353
18375
  {
18354
18376
  node: detailsNode,
18355
18377
  onClose: () => setDetailsNode(null),
18378
+ onFocusNode: handleFocusNode,
18356
18379
  onSave: (data) => userActionHandlers.handleSaveNodeDetails(actionHandlerContext, data),
18357
18380
  onNameChange: handleDetailNodeNameChange,
18358
18381
  onColorChange: handleDetailNodeColorChange,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.5-dev.53",
3
+ "version": "1.2.5-dev.55",
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",