gantt-lib 0.141.1 → 0.141.3

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
@@ -6239,6 +6239,8 @@ var DependencyLines = import_react7.default.memo(({
6239
6239
  onDependencyClick,
6240
6240
  horizontalWindow
6241
6241
  }) => {
6242
+ const markerPrefix = `gantt-dependency-${(0, import_react7.useId)().replace(/[^a-zA-Z0-9_-]/g, "")}`;
6243
+ const markerId = (kind) => `${markerPrefix}-${kind}`;
6242
6244
  const [hoveredLineId, setHoveredLineId] = (0, import_react7.useState)(null);
6243
6245
  const tasksForPositions = allTasks ?? tasks;
6244
6246
  const { taskPositions, taskIndices, hiddenTaskIds } = (0, import_react7.useMemo)(() => {
@@ -6362,6 +6364,9 @@ var DependencyLines = import_react7.default.memo(({
6362
6364
  if (activityEndpoints && predecessor.rowTop === successor.rowTop) {
6363
6365
  fromY = predecessor.rowTop + predecessor.rowHeight / 2;
6364
6366
  toY = successor.rowTop + successor.rowHeight / 2;
6367
+ } else if (activityEndpoints) {
6368
+ fromY = reverseOrder ? predecessor.rowTop : predecessor.rowTop + predecessor.rowHeight;
6369
+ toY = reverseOrder ? successor.rowTop + successor.rowHeight : successor.rowTop;
6365
6370
  } else if (reverseOrder) {
6366
6371
  fromY = predecessor.rowTop + 10;
6367
6372
  toY = successor.rowTop + successor.rowHeight - 6;
@@ -6423,7 +6428,7 @@ var DependencyLines = import_react7.default.memo(({
6423
6428
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6424
6429
  "marker",
6425
6430
  {
6426
- id: "arrowhead",
6431
+ id: markerId("arrowhead"),
6427
6432
  markerWidth: "8",
6428
6433
  markerHeight: "6",
6429
6434
  markerUnits: "userSpaceOnUse",
@@ -6442,7 +6447,7 @@ var DependencyLines = import_react7.default.memo(({
6442
6447
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6443
6448
  "marker",
6444
6449
  {
6445
- id: "arrowhead-cycle",
6450
+ id: markerId("arrowhead-cycle"),
6446
6451
  markerWidth: "8",
6447
6452
  markerHeight: "6",
6448
6453
  markerUnits: "userSpaceOnUse",
@@ -6461,7 +6466,7 @@ var DependencyLines = import_react7.default.memo(({
6461
6466
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6462
6467
  "marker",
6463
6468
  {
6464
- id: "arrowhead-selected",
6469
+ id: markerId("arrowhead-selected"),
6465
6470
  markerWidth: "8",
6466
6471
  markerHeight: "6",
6467
6472
  markerUnits: "userSpaceOnUse",
@@ -6480,7 +6485,7 @@ var DependencyLines = import_react7.default.memo(({
6480
6485
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6481
6486
  "marker",
6482
6487
  {
6483
- id: "arrowhead-hover",
6488
+ id: markerId("arrowhead-hover"),
6484
6489
  markerWidth: "8",
6485
6490
  markerHeight: "6",
6486
6491
  markerUnits: "userSpaceOnUse",
@@ -6499,7 +6504,7 @@ var DependencyLines = import_react7.default.memo(({
6499
6504
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6500
6505
  "marker",
6501
6506
  {
6502
- id: "arrowhead-critical",
6507
+ id: markerId("arrowhead-critical"),
6503
6508
  markerWidth: "8",
6504
6509
  markerHeight: "6",
6505
6510
  markerUnits: "userSpaceOnUse",
@@ -6525,10 +6530,11 @@ var DependencyLines = import_react7.default.memo(({
6525
6530
  else if (isCritical) pathClassName += " gantt-dependency-critical";
6526
6531
  if (isVirtual && !isSelected) pathClassName += " gantt-dependency-virtual";
6527
6532
  let markerEnd;
6528
- if (isSelected) markerEnd = "url(#arrowhead-selected)";
6529
- else if (hasCycle) markerEnd = "url(#arrowhead-cycle)";
6530
- else if (isCritical) markerEnd = "url(#arrowhead-critical)";
6531
- else markerEnd = "url(#arrowhead)";
6533
+ if (isHovered) markerEnd = `url(#${markerId("arrowhead-hover")})`;
6534
+ else if (isSelected) markerEnd = `url(#${markerId("arrowhead-selected")})`;
6535
+ else if (hasCycle) markerEnd = `url(#${markerId("arrowhead-cycle")})`;
6536
+ else if (isCritical) markerEnd = `url(#${markerId("arrowhead-critical")})`;
6537
+ else markerEnd = `url(#${markerId("arrowhead")})`;
6532
6538
  const lagColor = isSelected ? "#ef4444" : hasCycle ? "var(--gantt-dependency-cycle-color, #ef4444)" : isCritical ? "var(--gantt-critical-path-color, #dc2626)" : "var(--gantt-dependency-line-color, #666666)";
6533
6539
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react7.default.Fragment, { children: [
6534
6540
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(