gantt-lib 0.141.0 → 0.141.2

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)(() => {
@@ -6423,7 +6425,7 @@ var DependencyLines = import_react7.default.memo(({
6423
6425
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6424
6426
  "marker",
6425
6427
  {
6426
- id: "arrowhead",
6428
+ id: markerId("arrowhead"),
6427
6429
  markerWidth: "8",
6428
6430
  markerHeight: "6",
6429
6431
  markerUnits: "userSpaceOnUse",
@@ -6442,7 +6444,7 @@ var DependencyLines = import_react7.default.memo(({
6442
6444
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6443
6445
  "marker",
6444
6446
  {
6445
- id: "arrowhead-cycle",
6447
+ id: markerId("arrowhead-cycle"),
6446
6448
  markerWidth: "8",
6447
6449
  markerHeight: "6",
6448
6450
  markerUnits: "userSpaceOnUse",
@@ -6461,7 +6463,7 @@ var DependencyLines = import_react7.default.memo(({
6461
6463
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6462
6464
  "marker",
6463
6465
  {
6464
- id: "arrowhead-selected",
6466
+ id: markerId("arrowhead-selected"),
6465
6467
  markerWidth: "8",
6466
6468
  markerHeight: "6",
6467
6469
  markerUnits: "userSpaceOnUse",
@@ -6480,7 +6482,7 @@ var DependencyLines = import_react7.default.memo(({
6480
6482
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6481
6483
  "marker",
6482
6484
  {
6483
- id: "arrowhead-hover",
6485
+ id: markerId("arrowhead-hover"),
6484
6486
  markerWidth: "8",
6485
6487
  markerHeight: "6",
6486
6488
  markerUnits: "userSpaceOnUse",
@@ -6499,7 +6501,7 @@ var DependencyLines = import_react7.default.memo(({
6499
6501
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6500
6502
  "marker",
6501
6503
  {
6502
- id: "arrowhead-critical",
6504
+ id: markerId("arrowhead-critical"),
6503
6505
  markerWidth: "8",
6504
6506
  markerHeight: "6",
6505
6507
  markerUnits: "userSpaceOnUse",
@@ -6525,10 +6527,11 @@ var DependencyLines = import_react7.default.memo(({
6525
6527
  else if (isCritical) pathClassName += " gantt-dependency-critical";
6526
6528
  if (isVirtual && !isSelected) pathClassName += " gantt-dependency-virtual";
6527
6529
  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)";
6530
+ if (isHovered) markerEnd = `url(#${markerId("arrowhead-hover")})`;
6531
+ else if (isSelected) markerEnd = `url(#${markerId("arrowhead-selected")})`;
6532
+ else if (hasCycle) markerEnd = `url(#${markerId("arrowhead-cycle")})`;
6533
+ else if (isCritical) markerEnd = `url(#${markerId("arrowhead-critical")})`;
6534
+ else markerEnd = `url(#${markerId("arrowhead")})`;
6532
6535
  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
6536
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react7.default.Fragment, { children: [
6534
6537
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
@@ -16168,6 +16171,9 @@ function TaskGanttChartInner(props, ref) {
16168
16171
  const newStart = new Date(updatedTask.startDate);
16169
16172
  const newEnd = new Date(updatedTask.endDate);
16170
16173
  const datesChanged = origStart.getTime() !== newStart.getTime() || origEnd.getTime() !== newEnd.getTime();
16174
+ if (datesChanged && onScheduleIntent && JSON.stringify(originalTask.dependencies ?? []) !== JSON.stringify(updatedTask.dependencies ?? [])) {
16175
+ onTasksChange?.([{ ...updatedTask, startDate: originalTask.startDate, endDate: originalTask.endDate }]);
16176
+ }
16171
16177
  const isCompositeDetail = datesChanged && tasks.some((task) => task.id === updatedTask.parentId && task.composite);
16172
16178
  if (isCompositeDetail) updatedTask = { ...updatedTask, synced: false };
16173
16179
  if (!datesChanged) {