gantt-lib 0.128.2 → 0.129.0

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.
@@ -1,2 +1,2 @@
1
- export { ah as CascadeContext, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, L as LinkType, m as ScaleTaskSubtreeAnchor, n as ScaleTaskSubtreeErrorCode, o as ScaleTaskSubtreeExternalPolicy, p as ScaleTaskSubtreeOptions, S as ScaleTaskSubtreeResult, q as ScaleTaskSubtreeWarning, ai as ScheduleCommandOptions, aj as ScheduleCommandResult, ak as ScheduleDependency, al as ScheduleTask, am as ScheduleTaskUpdate, T as Task, an as TaskDependency, V as ValidationResult, ao as addBusinessDays, s as alignToWorkingDay, t as areTasksHierarchicallyRelated, u as buildAdjacencyList, v as buildTaskRangeFromEnd, w as buildTaskRangeFromStart, x as calculateSuccessorDate, y as cascadeByLinks, ap as cascadeTaskProgress, z as clampTaskRangeForIncomingFS, A as computeCriticalPath, E as computeLagFromDates, F as computeParentDates, H as computeParentProgress, aq as createCascadeContext, I as detectCycles, J as extendCriticalIdsToParents, K as findParentId, N as getAllDependencyEdges, O as getAllDescendants, P as getBusinessDayOffset, ar as getBusinessDaysCount, Q as getChildren, U as getDependencyLag, X as getSuccessorChain, Y as getTaskDuration, Z as getTransitiveCascadeChain, _ as isAncestorTask, $ as isTaskParent, a0 as moveTaskRange, a1 as moveTaskWithCascade, a2 as normalizeDependencyLag, a3 as normalizePredecessorDates, a4 as normalizeTaskDependencyLags, a5 as normalizeUTCDate, a6 as parseDateOnly, a7 as recalculateIncomingLags, a8 as recalculateProjectSchedule, a9 as recalculateTaskFromDependencies, aa as reflowTasksOnModeSwitch, ab as removeDependenciesBetweenTasks, ac as resizeTaskWithCascade, ad as scaleTaskSubtreeDuration, ae as shiftBusinessDayOffset, as as subtractBusinessDays, af as universalCascade, ag as validateDependencies } from '../../index-BWHqH6v8.mjs';
1
+ export { ai as CascadeContext, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, L as LinkType, n as ScaleTaskSubtreeAnchor, o as ScaleTaskSubtreeErrorCode, p as ScaleTaskSubtreeExternalPolicy, q as ScaleTaskSubtreeOptions, S as ScaleTaskSubtreeResult, r as ScaleTaskSubtreeWarning, aj as ScheduleCommandOptions, ak as ScheduleCommandResult, al as ScheduleDependency, am as ScheduleTask, an as ScheduleTaskUpdate, T as Task, ao as TaskDependency, V as ValidationResult, ap as addBusinessDays, t as alignToWorkingDay, u as areTasksHierarchicallyRelated, v as buildAdjacencyList, w as buildTaskRangeFromEnd, x as buildTaskRangeFromStart, y as calculateSuccessorDate, z as cascadeByLinks, aq as cascadeTaskProgress, A as clampTaskRangeForIncomingFS, E as computeCriticalPath, F as computeLagFromDates, H as computeParentDates, I as computeParentProgress, ar as createCascadeContext, J as detectCycles, K as extendCriticalIdsToParents, N as findParentId, O as getAllDependencyEdges, P as getAllDescendants, Q as getBusinessDayOffset, as as getBusinessDaysCount, U as getChildren, X as getDependencyLag, Y as getSuccessorChain, Z as getTaskDuration, _ as getTransitiveCascadeChain, $ as isAncestorTask, a0 as isTaskParent, a1 as moveTaskRange, a2 as moveTaskWithCascade, a3 as normalizeDependencyLag, a4 as normalizePredecessorDates, a5 as normalizeTaskDependencyLags, a6 as normalizeUTCDate, a7 as parseDateOnly, a8 as recalculateIncomingLags, a9 as recalculateProjectSchedule, aa as recalculateTaskFromDependencies, ab as reflowTasksOnModeSwitch, ac as removeDependenciesBetweenTasks, ad as resizeTaskWithCascade, ae as scaleTaskSubtreeDuration, af as shiftBusinessDayOffset, at as subtractBusinessDays, ag as universalCascade, ah as validateDependencies } from '../../index-CIFbOgGc.mjs';
2
2
  import 'react';
@@ -1,2 +1,2 @@
1
- export { ah as CascadeContext, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, L as LinkType, m as ScaleTaskSubtreeAnchor, n as ScaleTaskSubtreeErrorCode, o as ScaleTaskSubtreeExternalPolicy, p as ScaleTaskSubtreeOptions, S as ScaleTaskSubtreeResult, q as ScaleTaskSubtreeWarning, ai as ScheduleCommandOptions, aj as ScheduleCommandResult, ak as ScheduleDependency, al as ScheduleTask, am as ScheduleTaskUpdate, T as Task, an as TaskDependency, V as ValidationResult, ao as addBusinessDays, s as alignToWorkingDay, t as areTasksHierarchicallyRelated, u as buildAdjacencyList, v as buildTaskRangeFromEnd, w as buildTaskRangeFromStart, x as calculateSuccessorDate, y as cascadeByLinks, ap as cascadeTaskProgress, z as clampTaskRangeForIncomingFS, A as computeCriticalPath, E as computeLagFromDates, F as computeParentDates, H as computeParentProgress, aq as createCascadeContext, I as detectCycles, J as extendCriticalIdsToParents, K as findParentId, N as getAllDependencyEdges, O as getAllDescendants, P as getBusinessDayOffset, ar as getBusinessDaysCount, Q as getChildren, U as getDependencyLag, X as getSuccessorChain, Y as getTaskDuration, Z as getTransitiveCascadeChain, _ as isAncestorTask, $ as isTaskParent, a0 as moveTaskRange, a1 as moveTaskWithCascade, a2 as normalizeDependencyLag, a3 as normalizePredecessorDates, a4 as normalizeTaskDependencyLags, a5 as normalizeUTCDate, a6 as parseDateOnly, a7 as recalculateIncomingLags, a8 as recalculateProjectSchedule, a9 as recalculateTaskFromDependencies, aa as reflowTasksOnModeSwitch, ab as removeDependenciesBetweenTasks, ac as resizeTaskWithCascade, ad as scaleTaskSubtreeDuration, ae as shiftBusinessDayOffset, as as subtractBusinessDays, af as universalCascade, ag as validateDependencies } from '../../index-BWHqH6v8.js';
1
+ export { ai as CascadeContext, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, L as LinkType, n as ScaleTaskSubtreeAnchor, o as ScaleTaskSubtreeErrorCode, p as ScaleTaskSubtreeExternalPolicy, q as ScaleTaskSubtreeOptions, S as ScaleTaskSubtreeResult, r as ScaleTaskSubtreeWarning, aj as ScheduleCommandOptions, ak as ScheduleCommandResult, al as ScheduleDependency, am as ScheduleTask, an as ScheduleTaskUpdate, T as Task, ao as TaskDependency, V as ValidationResult, ap as addBusinessDays, t as alignToWorkingDay, u as areTasksHierarchicallyRelated, v as buildAdjacencyList, w as buildTaskRangeFromEnd, x as buildTaskRangeFromStart, y as calculateSuccessorDate, z as cascadeByLinks, aq as cascadeTaskProgress, A as clampTaskRangeForIncomingFS, E as computeCriticalPath, F as computeLagFromDates, H as computeParentDates, I as computeParentProgress, ar as createCascadeContext, J as detectCycles, K as extendCriticalIdsToParents, N as findParentId, O as getAllDependencyEdges, P as getAllDescendants, Q as getBusinessDayOffset, as as getBusinessDaysCount, U as getChildren, X as getDependencyLag, Y as getSuccessorChain, Z as getTaskDuration, _ as getTransitiveCascadeChain, $ as isAncestorTask, a0 as isTaskParent, a1 as moveTaskRange, a2 as moveTaskWithCascade, a3 as normalizeDependencyLag, a4 as normalizePredecessorDates, a5 as normalizeTaskDependencyLags, a6 as normalizeUTCDate, a7 as parseDateOnly, a8 as recalculateIncomingLags, a9 as recalculateProjectSchedule, aa as recalculateTaskFromDependencies, ab as reflowTasksOnModeSwitch, ac as removeDependenciesBetweenTasks, ad as resizeTaskWithCascade, ae as scaleTaskSubtreeDuration, af as shiftBusinessDayOffset, at as subtractBusinessDays, ag as universalCascade, ah as validateDependencies } from '../../index-CIFbOgGc.js';
2
2
  import 'react';
@@ -1,5 +1,20 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
+ type GanttScheduleIntent = {
4
+ type: 'move_task';
5
+ taskId: string;
6
+ startDate: string;
7
+ } | {
8
+ type: 'resize_task';
9
+ taskId: string;
10
+ anchor: 'start' | 'end';
11
+ date: string;
12
+ } | {
13
+ type: 'change_duration';
14
+ taskId: string;
15
+ duration: number;
16
+ anchor: 'start' | 'end';
17
+ };
3
18
  type GanttChartMode = 'gantt' | 'table-matrix' | 'plan-fact' | 'resource-planner';
4
19
  type TaskDateChangeMode = 'preserve-duration' | 'free';
5
20
  interface TimelineMarker {
@@ -748,4 +763,4 @@ type ScaleTaskSubtreeResult = {
748
763
  */
749
764
  declare function scaleTaskSubtreeDuration(parentId: string, targetDuration: number, snapshot: Task[], options?: ScaleTaskSubtreeOptions): ScaleTaskSubtreeResult;
750
765
 
751
- export { isTaskParent as $, computeCriticalPath as A, type BuiltInResourceTableColumnId as B, type CriticalPathOptions as C, DAY_MS as D, computeLagFromDates as E, computeParentDates as F, type GanttChartMode as G, computeParentProgress as H, detectCycles as I, extendCriticalIdsToParents as J, findParentId as K, type LinkType as L, type MonthSpan as M, getAllDependencyEdges as N, getAllDescendants as O, getBusinessDayOffset as P, getChildren as Q, type ResourceTimelineItem as R, type ScaleTaskSubtreeResult as S, type Task as T, getDependencyLag as U, type ValidationResult as V, type WeekendBlock as W, getSuccessorChain as X, getTaskDuration as Y, getTransitiveCascadeChain as Z, isAncestorTask as _, type TimelineMarker as a, moveTaskRange as a0, moveTaskWithCascade as a1, normalizeDependencyLag as a2, normalizePredecessorDates as a3, normalizeTaskDependencyLags as a4, normalizeUTCDate as a5, parseDateOnly as a6, recalculateIncomingLags as a7, recalculateProjectSchedule as a8, recalculateTaskFromDependencies as a9, reflowTasksOnModeSwitch as aa, removeDependenciesBetweenTasks as ab, resizeTaskWithCascade as ac, scaleTaskSubtreeDuration as ad, shiftBusinessDayOffset as ae, universalCascade as af, validateDependencies as ag, type CascadeContext as ah, type ScheduleCommandOptions as ai, type ScheduleCommandResult as aj, type ScheduleDependency as ak, type ScheduleTask as al, type ScheduleTaskUpdate as am, type TaskDependency as an, addBusinessDays as ao, cascadeTaskProgress as ap, createCascadeContext as aq, getBusinessDaysCount as ar, subtractBusinessDays as as, type TaskDateChangeMode as b, type ResourcePlannerChartProps as c, type ResourceTimelineResource as d, type DependencyError as e, type GanttDateRange as f, type GridConfig as g, type GridLine as h, type ResourceTableColumnId as i, type ResourceTableColumnWidthMap as j, type ResourceTimelineMove as k, type ResourceTimelineResourceMenuCommand as l, type ScaleTaskSubtreeAnchor as m, type ScaleTaskSubtreeErrorCode as n, type ScaleTaskSubtreeExternalPolicy as o, type ScaleTaskSubtreeOptions as p, type ScaleTaskSubtreeWarning as q, type TaskBarGeometry as r, alignToWorkingDay as s, areTasksHierarchicallyRelated as t, buildAdjacencyList as u, buildTaskRangeFromEnd as v, buildTaskRangeFromStart as w, calculateSuccessorDate as x, cascadeByLinks as y, clampTaskRangeForIncomingFS as z };
766
+ export { isAncestorTask as $, clampTaskRangeForIncomingFS as A, type BuiltInResourceTableColumnId as B, type CriticalPathOptions as C, DAY_MS as D, computeCriticalPath as E, computeLagFromDates as F, type GanttScheduleIntent as G, computeParentDates as H, computeParentProgress as I, detectCycles as J, extendCriticalIdsToParents as K, type LinkType as L, type MonthSpan as M, findParentId as N, getAllDependencyEdges as O, getAllDescendants as P, getBusinessDayOffset as Q, type ResourceTimelineItem as R, type ScaleTaskSubtreeResult as S, type Task as T, getChildren as U, type ValidationResult as V, type WeekendBlock as W, getDependencyLag as X, getSuccessorChain as Y, getTaskDuration as Z, getTransitiveCascadeChain as _, type TimelineMarker as a, isTaskParent as a0, moveTaskRange as a1, moveTaskWithCascade as a2, normalizeDependencyLag as a3, normalizePredecessorDates as a4, normalizeTaskDependencyLags as a5, normalizeUTCDate as a6, parseDateOnly as a7, recalculateIncomingLags as a8, recalculateProjectSchedule as a9, recalculateTaskFromDependencies as aa, reflowTasksOnModeSwitch as ab, removeDependenciesBetweenTasks as ac, resizeTaskWithCascade as ad, scaleTaskSubtreeDuration as ae, shiftBusinessDayOffset as af, universalCascade as ag, validateDependencies as ah, type CascadeContext as ai, type ScheduleCommandOptions as aj, type ScheduleCommandResult as ak, type ScheduleDependency as al, type ScheduleTask as am, type ScheduleTaskUpdate as an, type TaskDependency as ao, addBusinessDays as ap, cascadeTaskProgress as aq, createCascadeContext as ar, getBusinessDaysCount as as, subtractBusinessDays as at, type TaskDateChangeMode as b, type ResourcePlannerChartProps as c, type ResourceTimelineResource as d, type DependencyError as e, type GanttChartMode as f, type GanttDateRange as g, type GridConfig as h, type GridLine as i, type ResourceTableColumnId as j, type ResourceTableColumnWidthMap as k, type ResourceTimelineMove as l, type ResourceTimelineResourceMenuCommand as m, type ScaleTaskSubtreeAnchor as n, type ScaleTaskSubtreeErrorCode as o, type ScaleTaskSubtreeExternalPolicy as p, type ScaleTaskSubtreeOptions as q, type ScaleTaskSubtreeWarning as r, type TaskBarGeometry as s, alignToWorkingDay as t, areTasksHierarchicallyRelated as u, buildAdjacencyList as v, buildTaskRangeFromEnd as w, buildTaskRangeFromStart as x, calculateSuccessorDate as y, cascadeByLinks as z };
@@ -1,5 +1,20 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
+ type GanttScheduleIntent = {
4
+ type: 'move_task';
5
+ taskId: string;
6
+ startDate: string;
7
+ } | {
8
+ type: 'resize_task';
9
+ taskId: string;
10
+ anchor: 'start' | 'end';
11
+ date: string;
12
+ } | {
13
+ type: 'change_duration';
14
+ taskId: string;
15
+ duration: number;
16
+ anchor: 'start' | 'end';
17
+ };
3
18
  type GanttChartMode = 'gantt' | 'table-matrix' | 'plan-fact' | 'resource-planner';
4
19
  type TaskDateChangeMode = 'preserve-duration' | 'free';
5
20
  interface TimelineMarker {
@@ -748,4 +763,4 @@ type ScaleTaskSubtreeResult = {
748
763
  */
749
764
  declare function scaleTaskSubtreeDuration(parentId: string, targetDuration: number, snapshot: Task[], options?: ScaleTaskSubtreeOptions): ScaleTaskSubtreeResult;
750
765
 
751
- export { isTaskParent as $, computeCriticalPath as A, type BuiltInResourceTableColumnId as B, type CriticalPathOptions as C, DAY_MS as D, computeLagFromDates as E, computeParentDates as F, type GanttChartMode as G, computeParentProgress as H, detectCycles as I, extendCriticalIdsToParents as J, findParentId as K, type LinkType as L, type MonthSpan as M, getAllDependencyEdges as N, getAllDescendants as O, getBusinessDayOffset as P, getChildren as Q, type ResourceTimelineItem as R, type ScaleTaskSubtreeResult as S, type Task as T, getDependencyLag as U, type ValidationResult as V, type WeekendBlock as W, getSuccessorChain as X, getTaskDuration as Y, getTransitiveCascadeChain as Z, isAncestorTask as _, type TimelineMarker as a, moveTaskRange as a0, moveTaskWithCascade as a1, normalizeDependencyLag as a2, normalizePredecessorDates as a3, normalizeTaskDependencyLags as a4, normalizeUTCDate as a5, parseDateOnly as a6, recalculateIncomingLags as a7, recalculateProjectSchedule as a8, recalculateTaskFromDependencies as a9, reflowTasksOnModeSwitch as aa, removeDependenciesBetweenTasks as ab, resizeTaskWithCascade as ac, scaleTaskSubtreeDuration as ad, shiftBusinessDayOffset as ae, universalCascade as af, validateDependencies as ag, type CascadeContext as ah, type ScheduleCommandOptions as ai, type ScheduleCommandResult as aj, type ScheduleDependency as ak, type ScheduleTask as al, type ScheduleTaskUpdate as am, type TaskDependency as an, addBusinessDays as ao, cascadeTaskProgress as ap, createCascadeContext as aq, getBusinessDaysCount as ar, subtractBusinessDays as as, type TaskDateChangeMode as b, type ResourcePlannerChartProps as c, type ResourceTimelineResource as d, type DependencyError as e, type GanttDateRange as f, type GridConfig as g, type GridLine as h, type ResourceTableColumnId as i, type ResourceTableColumnWidthMap as j, type ResourceTimelineMove as k, type ResourceTimelineResourceMenuCommand as l, type ScaleTaskSubtreeAnchor as m, type ScaleTaskSubtreeErrorCode as n, type ScaleTaskSubtreeExternalPolicy as o, type ScaleTaskSubtreeOptions as p, type ScaleTaskSubtreeWarning as q, type TaskBarGeometry as r, alignToWorkingDay as s, areTasksHierarchicallyRelated as t, buildAdjacencyList as u, buildTaskRangeFromEnd as v, buildTaskRangeFromStart as w, calculateSuccessorDate as x, cascadeByLinks as y, clampTaskRangeForIncomingFS as z };
766
+ export { isAncestorTask as $, clampTaskRangeForIncomingFS as A, type BuiltInResourceTableColumnId as B, type CriticalPathOptions as C, DAY_MS as D, computeCriticalPath as E, computeLagFromDates as F, type GanttScheduleIntent as G, computeParentDates as H, computeParentProgress as I, detectCycles as J, extendCriticalIdsToParents as K, type LinkType as L, type MonthSpan as M, findParentId as N, getAllDependencyEdges as O, getAllDescendants as P, getBusinessDayOffset as Q, type ResourceTimelineItem as R, type ScaleTaskSubtreeResult as S, type Task as T, getChildren as U, type ValidationResult as V, type WeekendBlock as W, getDependencyLag as X, getSuccessorChain as Y, getTaskDuration as Z, getTransitiveCascadeChain as _, type TimelineMarker as a, isTaskParent as a0, moveTaskRange as a1, moveTaskWithCascade as a2, normalizeDependencyLag as a3, normalizePredecessorDates as a4, normalizeTaskDependencyLags as a5, normalizeUTCDate as a6, parseDateOnly as a7, recalculateIncomingLags as a8, recalculateProjectSchedule as a9, recalculateTaskFromDependencies as aa, reflowTasksOnModeSwitch as ab, removeDependenciesBetweenTasks as ac, resizeTaskWithCascade as ad, scaleTaskSubtreeDuration as ae, shiftBusinessDayOffset as af, universalCascade as ag, validateDependencies as ah, type CascadeContext as ai, type ScheduleCommandOptions as aj, type ScheduleCommandResult as ak, type ScheduleDependency as al, type ScheduleTask as am, type ScheduleTaskUpdate as an, type TaskDependency as ao, addBusinessDays as ap, cascadeTaskProgress as aq, createCascadeContext as ar, getBusinessDaysCount as as, subtractBusinessDays as at, type TaskDateChangeMode as b, type ResourcePlannerChartProps as c, type ResourceTimelineResource as d, type DependencyError as e, type GanttChartMode as f, type GanttDateRange as g, type GridConfig as h, type GridLine as i, type ResourceTableColumnId as j, type ResourceTableColumnWidthMap as k, type ResourceTimelineMove as l, type ResourceTimelineResourceMenuCommand as m, type ScaleTaskSubtreeAnchor as n, type ScaleTaskSubtreeErrorCode as o, type ScaleTaskSubtreeExternalPolicy as p, type ScaleTaskSubtreeOptions as q, type ScaleTaskSubtreeWarning as r, type TaskBarGeometry as s, alignToWorkingDay as t, areTasksHierarchicallyRelated as u, buildAdjacencyList as v, buildTaskRangeFromEnd as w, buildTaskRangeFromStart as x, calculateSuccessorDate as y, cascadeByLinks as z };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React$1, { ReactNode } from 'react';
2
- import { T as Task$1, R as ResourceTimelineItem, V as ValidationResult, a as TimelineMarker, b as TaskDateChangeMode, S as ScaleTaskSubtreeResult, c as ResourcePlannerChartProps, d as ResourceTimelineResource } from './index-BWHqH6v8.mjs';
3
- export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, G as GanttChartMode, f as GanttDateRange, g as GridConfig, h as GridLine, L as LinkType, M as MonthSpan, i as ResourceTableColumnId, j as ResourceTableColumnWidthMap, k as ResourceTimelineMove, l as ResourceTimelineResourceMenuCommand, m as ScaleTaskSubtreeAnchor, n as ScaleTaskSubtreeErrorCode, o as ScaleTaskSubtreeExternalPolicy, p as ScaleTaskSubtreeOptions, q as ScaleTaskSubtreeWarning, r as TaskBarGeometry, W as WeekendBlock, s as alignToWorkingDay, t as areTasksHierarchicallyRelated, u as buildAdjacencyList, v as buildTaskRangeFromEnd, w as buildTaskRangeFromStart, x as calculateSuccessorDate, y as cascadeByLinks, z as clampTaskRangeForIncomingFS, A as computeCriticalPath, E as computeLagFromDates, F as computeParentDates, H as computeParentProgress, I as detectCycles, J as extendCriticalIdsToParents, K as findParentId, N as getAllDependencyEdges, O as getAllDescendants, P as getBusinessDayOffset, Q as getChildren, U as getDependencyLag, X as getSuccessorChain, Y as getTaskDuration, Z as getTransitiveCascadeChain, _ as isAncestorTask, $ as isTaskParent, a0 as moveTaskRange, a1 as moveTaskWithCascade, a2 as normalizeDependencyLag, a3 as normalizePredecessorDates, a4 as normalizeTaskDependencyLags, a5 as normalizeUTCDate, a6 as parseDateOnly, a7 as recalculateIncomingLags, a8 as recalculateProjectSchedule, a9 as recalculateTaskFromDependencies, aa as reflowTasksOnModeSwitch, ab as removeDependenciesBetweenTasks, ac as resizeTaskWithCascade, ad as scaleTaskSubtreeDuration, ae as shiftBusinessDayOffset, af as universalCascade, ag as validateDependencies } from './index-BWHqH6v8.mjs';
2
+ import { T as Task$1, R as ResourceTimelineItem, G as GanttScheduleIntent, V as ValidationResult, a as TimelineMarker, b as TaskDateChangeMode, S as ScaleTaskSubtreeResult, c as ResourcePlannerChartProps, d as ResourceTimelineResource } from './index-CIFbOgGc.mjs';
3
+ export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, f as GanttChartMode, g as GanttDateRange, h as GridConfig, i as GridLine, L as LinkType, M as MonthSpan, j as ResourceTableColumnId, k as ResourceTableColumnWidthMap, l as ResourceTimelineMove, m as ResourceTimelineResourceMenuCommand, n as ScaleTaskSubtreeAnchor, o as ScaleTaskSubtreeErrorCode, p as ScaleTaskSubtreeExternalPolicy, q as ScaleTaskSubtreeOptions, r as ScaleTaskSubtreeWarning, s as TaskBarGeometry, W as WeekendBlock, t as alignToWorkingDay, u as areTasksHierarchicallyRelated, v as buildAdjacencyList, w as buildTaskRangeFromEnd, x as buildTaskRangeFromStart, y as calculateSuccessorDate, z as cascadeByLinks, A as clampTaskRangeForIncomingFS, E as computeCriticalPath, F as computeLagFromDates, H as computeParentDates, I as computeParentProgress, J as detectCycles, K as extendCriticalIdsToParents, N as findParentId, O as getAllDependencyEdges, P as getAllDescendants, Q as getBusinessDayOffset, U as getChildren, X as getDependencyLag, Y as getSuccessorChain, Z as getTaskDuration, _ as getTransitiveCascadeChain, $ as isAncestorTask, a0 as isTaskParent, a1 as moveTaskRange, a2 as moveTaskWithCascade, a3 as normalizeDependencyLag, a4 as normalizePredecessorDates, a5 as normalizeTaskDependencyLags, a6 as normalizeUTCDate, a7 as parseDateOnly, a8 as recalculateIncomingLags, a9 as recalculateProjectSchedule, aa as recalculateTaskFromDependencies, ab as reflowTasksOnModeSwitch, ac as removeDependenciesBetweenTasks, ad as resizeTaskWithCascade, ae as scaleTaskSubtreeDuration, af as shiftBusinessDayOffset, ag as universalCascade, ah as validateDependencies } from './index-CIFbOgGc.mjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as RadixPopover from '@radix-ui/react-popover';
6
6
 
@@ -534,6 +534,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
534
534
  containerHeight?: number | string;
535
535
  /** Callback when tasks are modified. Receives ONLY the changed tasks as full objects with all properties. */
536
536
  onTasksChange?: (tasks: TTask[]) => void;
537
+ /** Semantic scheduling operation completed by the user. */
538
+ onScheduleIntent?: (intent: GanttScheduleIntent) => void;
537
539
  /** Optional callback for dependency validation results */
538
540
  onValidateDependencies?: (result: ValidationResult) => void;
539
541
  /** Enable automatic shifting of dependent tasks when predecessor moves (default: false) */
@@ -754,6 +756,8 @@ interface TaskRowProps {
754
756
  rowHeight: number;
755
757
  /** Callback when task is modified via drag/resize. Receives array of changed tasks. */
756
758
  onTasksChange?: (tasks: Task[]) => void;
759
+ /** Semantic scheduling operation completed by this chart row. */
760
+ onScheduleIntent?: (intent: GanttScheduleIntent) => void;
757
761
  /** Callback when task drag state changes (for rendering guide lines) */
758
762
  onDragStateChange?: (state: {
759
763
  isDragging: boolean;
@@ -933,6 +937,8 @@ interface TaskListProps {
933
937
  taskListWidth?: number;
934
938
  /** Callback when tasks are modified via inline edit. Receives array of changed tasks. */
935
939
  onTasksChange?: (tasks: Task[]) => void;
940
+ /** Internal scheduling boundary for task-list duration edits. */
941
+ onDurationChange?: (task: Task, duration: number) => void;
936
942
  /** ID of currently selected task */
937
943
  selectedTaskId?: string;
938
944
  /** Callback when task row is clicked */
@@ -1196,6 +1202,8 @@ interface UseTaskDragOptions {
1196
1202
  endDate: Date;
1197
1203
  updatedDependencies?: Task$1['dependencies'];
1198
1204
  }) => void;
1205
+ /** Semantic scheduling operation completed by the drag. */
1206
+ onScheduleIntent?: (intent: GanttScheduleIntent) => void;
1199
1207
  /** Callback for drag state changes (for parent components to render guide lines) */
1200
1208
  onDragStateChange?: (state: {
1201
1209
  isDragging: boolean;
@@ -1551,4 +1559,4 @@ interface ResourceTimelineLayoutResult<TItem extends ResourceTimelineItem = Reso
1551
1559
  }
1552
1560
  declare const layoutResourceTimelineItems: <TItem extends ResourceTimelineItem = ResourceTimelineItem>(resources: Array<ResourceTimelineResource<TItem>>, options: ResourceTimelineLayoutOptions) => ResourceTimelineLayoutResult<TItem>;
1553
1561
 
1554
- export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, type GanttModeProps, GridBackground, Input, type InputProps, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type ReorderDropPlacement, type ReorderDropTarget, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, subtractBusinessDays, useTaskDrag, withoutDeps };
1562
+ export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, type GanttModeProps, GanttScheduleIntent, GridBackground, Input, type InputProps, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type ReorderDropPlacement, type ReorderDropTarget, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, subtractBusinessDays, useTaskDrag, withoutDeps };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React$1, { ReactNode } from 'react';
2
- import { T as Task$1, R as ResourceTimelineItem, V as ValidationResult, a as TimelineMarker, b as TaskDateChangeMode, S as ScaleTaskSubtreeResult, c as ResourcePlannerChartProps, d as ResourceTimelineResource } from './index-BWHqH6v8.js';
3
- export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, G as GanttChartMode, f as GanttDateRange, g as GridConfig, h as GridLine, L as LinkType, M as MonthSpan, i as ResourceTableColumnId, j as ResourceTableColumnWidthMap, k as ResourceTimelineMove, l as ResourceTimelineResourceMenuCommand, m as ScaleTaskSubtreeAnchor, n as ScaleTaskSubtreeErrorCode, o as ScaleTaskSubtreeExternalPolicy, p as ScaleTaskSubtreeOptions, q as ScaleTaskSubtreeWarning, r as TaskBarGeometry, W as WeekendBlock, s as alignToWorkingDay, t as areTasksHierarchicallyRelated, u as buildAdjacencyList, v as buildTaskRangeFromEnd, w as buildTaskRangeFromStart, x as calculateSuccessorDate, y as cascadeByLinks, z as clampTaskRangeForIncomingFS, A as computeCriticalPath, E as computeLagFromDates, F as computeParentDates, H as computeParentProgress, I as detectCycles, J as extendCriticalIdsToParents, K as findParentId, N as getAllDependencyEdges, O as getAllDescendants, P as getBusinessDayOffset, Q as getChildren, U as getDependencyLag, X as getSuccessorChain, Y as getTaskDuration, Z as getTransitiveCascadeChain, _ as isAncestorTask, $ as isTaskParent, a0 as moveTaskRange, a1 as moveTaskWithCascade, a2 as normalizeDependencyLag, a3 as normalizePredecessorDates, a4 as normalizeTaskDependencyLags, a5 as normalizeUTCDate, a6 as parseDateOnly, a7 as recalculateIncomingLags, a8 as recalculateProjectSchedule, a9 as recalculateTaskFromDependencies, aa as reflowTasksOnModeSwitch, ab as removeDependenciesBetweenTasks, ac as resizeTaskWithCascade, ad as scaleTaskSubtreeDuration, ae as shiftBusinessDayOffset, af as universalCascade, ag as validateDependencies } from './index-BWHqH6v8.js';
2
+ import { T as Task$1, R as ResourceTimelineItem, G as GanttScheduleIntent, V as ValidationResult, a as TimelineMarker, b as TaskDateChangeMode, S as ScaleTaskSubtreeResult, c as ResourcePlannerChartProps, d as ResourceTimelineResource } from './index-CIFbOgGc.js';
3
+ export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, f as GanttChartMode, g as GanttDateRange, h as GridConfig, i as GridLine, L as LinkType, M as MonthSpan, j as ResourceTableColumnId, k as ResourceTableColumnWidthMap, l as ResourceTimelineMove, m as ResourceTimelineResourceMenuCommand, n as ScaleTaskSubtreeAnchor, o as ScaleTaskSubtreeErrorCode, p as ScaleTaskSubtreeExternalPolicy, q as ScaleTaskSubtreeOptions, r as ScaleTaskSubtreeWarning, s as TaskBarGeometry, W as WeekendBlock, t as alignToWorkingDay, u as areTasksHierarchicallyRelated, v as buildAdjacencyList, w as buildTaskRangeFromEnd, x as buildTaskRangeFromStart, y as calculateSuccessorDate, z as cascadeByLinks, A as clampTaskRangeForIncomingFS, E as computeCriticalPath, F as computeLagFromDates, H as computeParentDates, I as computeParentProgress, J as detectCycles, K as extendCriticalIdsToParents, N as findParentId, O as getAllDependencyEdges, P as getAllDescendants, Q as getBusinessDayOffset, U as getChildren, X as getDependencyLag, Y as getSuccessorChain, Z as getTaskDuration, _ as getTransitiveCascadeChain, $ as isAncestorTask, a0 as isTaskParent, a1 as moveTaskRange, a2 as moveTaskWithCascade, a3 as normalizeDependencyLag, a4 as normalizePredecessorDates, a5 as normalizeTaskDependencyLags, a6 as normalizeUTCDate, a7 as parseDateOnly, a8 as recalculateIncomingLags, a9 as recalculateProjectSchedule, aa as recalculateTaskFromDependencies, ab as reflowTasksOnModeSwitch, ac as removeDependenciesBetweenTasks, ad as resizeTaskWithCascade, ae as scaleTaskSubtreeDuration, af as shiftBusinessDayOffset, ag as universalCascade, ah as validateDependencies } from './index-CIFbOgGc.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as RadixPopover from '@radix-ui/react-popover';
6
6
 
@@ -534,6 +534,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
534
534
  containerHeight?: number | string;
535
535
  /** Callback when tasks are modified. Receives ONLY the changed tasks as full objects with all properties. */
536
536
  onTasksChange?: (tasks: TTask[]) => void;
537
+ /** Semantic scheduling operation completed by the user. */
538
+ onScheduleIntent?: (intent: GanttScheduleIntent) => void;
537
539
  /** Optional callback for dependency validation results */
538
540
  onValidateDependencies?: (result: ValidationResult) => void;
539
541
  /** Enable automatic shifting of dependent tasks when predecessor moves (default: false) */
@@ -754,6 +756,8 @@ interface TaskRowProps {
754
756
  rowHeight: number;
755
757
  /** Callback when task is modified via drag/resize. Receives array of changed tasks. */
756
758
  onTasksChange?: (tasks: Task[]) => void;
759
+ /** Semantic scheduling operation completed by this chart row. */
760
+ onScheduleIntent?: (intent: GanttScheduleIntent) => void;
757
761
  /** Callback when task drag state changes (for rendering guide lines) */
758
762
  onDragStateChange?: (state: {
759
763
  isDragging: boolean;
@@ -933,6 +937,8 @@ interface TaskListProps {
933
937
  taskListWidth?: number;
934
938
  /** Callback when tasks are modified via inline edit. Receives array of changed tasks. */
935
939
  onTasksChange?: (tasks: Task[]) => void;
940
+ /** Internal scheduling boundary for task-list duration edits. */
941
+ onDurationChange?: (task: Task, duration: number) => void;
936
942
  /** ID of currently selected task */
937
943
  selectedTaskId?: string;
938
944
  /** Callback when task row is clicked */
@@ -1196,6 +1202,8 @@ interface UseTaskDragOptions {
1196
1202
  endDate: Date;
1197
1203
  updatedDependencies?: Task$1['dependencies'];
1198
1204
  }) => void;
1205
+ /** Semantic scheduling operation completed by the drag. */
1206
+ onScheduleIntent?: (intent: GanttScheduleIntent) => void;
1199
1207
  /** Callback for drag state changes (for parent components to render guide lines) */
1200
1208
  onDragStateChange?: (state: {
1201
1209
  isDragging: boolean;
@@ -1551,4 +1559,4 @@ interface ResourceTimelineLayoutResult<TItem extends ResourceTimelineItem = Reso
1551
1559
  }
1552
1560
  declare const layoutResourceTimelineItems: <TItem extends ResourceTimelineItem = ResourceTimelineItem>(resources: Array<ResourceTimelineResource<TItem>>, options: ResourceTimelineLayoutOptions) => ResourceTimelineLayoutResult<TItem>;
1553
1561
 
1554
- export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, type GanttModeProps, GridBackground, Input, type InputProps, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type ReorderDropPlacement, type ReorderDropTarget, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, subtractBusinessDays, useTaskDrag, withoutDeps };
1562
+ export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, type GanttModeProps, GanttScheduleIntent, GridBackground, Input, type InputProps, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type ReorderDropPlacement, type ReorderDropTarget, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, subtractBusinessDays, useTaskDrag, withoutDeps };
package/dist/index.js CHANGED
@@ -3994,6 +3994,7 @@ var useTaskDrag = (options) => {
3994
3994
  monthStart,
3995
3995
  dayWidth,
3996
3996
  onDragEnd,
3997
+ onScheduleIntent,
3997
3998
  onDragStateChange,
3998
3999
  edgeZoneWidth = 12,
3999
4000
  allTasks = [],
@@ -4137,6 +4138,39 @@ var useTaskDrag = (options) => {
4137
4138
  setCurrentWidth(width);
4138
4139
  return;
4139
4140
  }
4141
+ if (onScheduleIntent) {
4142
+ const toDate = (date) => date.toISOString().split("T")[0];
4143
+ if (finalMode === "move") {
4144
+ onScheduleIntent({
4145
+ type: "move_task",
4146
+ taskId,
4147
+ startDate: toDate(newStartDate)
4148
+ });
4149
+ } else if (currentTask && isTaskParent(taskId, allTasks)) {
4150
+ const anchor = finalMode === "resize-left" ? "end" : "start";
4151
+ const parentRange = computeParentDates(taskId, allTasks);
4152
+ const targetDuration = getTaskDuration(
4153
+ anchor === "start" ? parentRange.startDate : newStartDate,
4154
+ anchor === "start" ? newEndDate : parentRange.endDate,
4155
+ businessDays,
4156
+ weekendPredicate
4157
+ );
4158
+ onScheduleIntent({
4159
+ type: "change_duration",
4160
+ taskId,
4161
+ duration: targetDuration,
4162
+ anchor
4163
+ });
4164
+ } else {
4165
+ const anchor = finalMode === "resize-left" ? "end" : "start";
4166
+ onScheduleIntent({
4167
+ type: "resize_task",
4168
+ taskId,
4169
+ anchor,
4170
+ date: toDate(finalMode === "resize-left" ? newStartDate : newEndDate)
4171
+ });
4172
+ }
4173
+ }
4140
4174
  const isParentResize = currentTask && (finalMode === "resize-left" || finalMode === "resize-right") ? isTaskParent(taskId, allTasks) : false;
4141
4175
  if (!disableConstraints && onCascade && allTasks.length > 0 && !isParentResize) {
4142
4176
  const draggedTaskData = currentTask;
@@ -4191,6 +4225,7 @@ var useTaskDrag = (options) => {
4191
4225
  dayWidth,
4192
4226
  monthStart,
4193
4227
  onDragEnd,
4228
+ onScheduleIntent,
4194
4229
  onDragStateChange,
4195
4230
  taskId,
4196
4231
  disableConstraints,
@@ -4351,7 +4386,7 @@ var arePropsEqual = (prevProps, nextProps) => {
4351
4386
  return prevProps.task.id === nextProps.task.id && prevProps.task.name === nextProps.task.name && prevProps.task.startDate === nextProps.task.startDate && prevProps.task.endDate === nextProps.task.endDate && prevProps.task.baselineStartDate === nextProps.task.baselineStartDate && prevProps.task.baselineEndDate === nextProps.task.baselineEndDate && prevProps.task.type === nextProps.task.type && prevProps.task.color === nextProps.task.color && prevProps.task.progress === nextProps.task.progress && prevProps.task.accepted === nextProps.task.accepted && prevProps.monthStart.getTime() === nextProps.monthStart.getTime() && prevProps.dayWidth === nextProps.dayWidth && prevProps.rowHeight === nextProps.rowHeight && prevProps.overridePosition?.left === nextProps.overridePosition?.left && prevProps.overridePosition?.width === nextProps.overridePosition?.width && prevProps.previewPositionStore === nextProps.previewPositionStore && prevProps.allTasks === nextProps.allTasks && prevProps.disableConstraints === nextProps.disableConstraints && prevProps.task.locked === nextProps.task.locked && prevProps.task.synced === nextProps.task.synced && prevProps.task.divider === nextProps.task.divider && prevProps.highlightExpiredTasks === nextProps.highlightExpiredTasks && prevProps.isCritical === nextProps.isCritical && prevProps.showBaseline === nextProps.showBaseline && prevProps.isFilterMatch === nextProps.isFilterMatch && prevProps.businessDays === nextProps.businessDays && prevProps.customDays === nextProps.customDays && prevProps.isWeekend === nextProps.isWeekend && prevProps.disableTaskDrag === nextProps.disableTaskDrag && prevProps.disableDependencyEditing === nextProps.disableDependencyEditing && prevProps.isDependencyDragActive === nextProps.isDependencyDragActive && prevProps.viewMode === nextProps.viewMode;
4352
4387
  };
4353
4388
  var TaskRow = import_react3.default.memo(
4354
- ({ task, monthStart, dayWidth, rowHeight, onTasksChange, onDragStateChange, rowIndex, allTasks, enableAutoSchedule, disableConstraints, overridePosition, previewPositionStore, onCascadeProgress, onCascade, divider, highlightExpiredTasks, isCritical = false, showBaseline = false, isFilterMatch = false, businessDays, customDays, isWeekend: isWeekend3, disableTaskDrag = false, disableDependencyEditing = false, onDependencyPortPointerDown, isDependencyDragActive = false, viewMode = "day" }) => {
4389
+ ({ task, monthStart, dayWidth, rowHeight, onTasksChange, onScheduleIntent, onDragStateChange, rowIndex, allTasks, enableAutoSchedule, disableConstraints, overridePosition, previewPositionStore, onCascadeProgress, onCascade, divider, highlightExpiredTasks, isCritical = false, showBaseline = false, isFilterMatch = false, businessDays, customDays, isWeekend: isWeekend3, disableTaskDrag = false, disableDependencyEditing = false, onDependencyPortPointerDown, isDependencyDragActive = false, viewMode = "day" }) => {
4355
4390
  const defaultParentBarColor = "#782FC4";
4356
4391
  const { divider: taskDivider } = task;
4357
4392
  const normalizedTask = (0, import_react3.useMemo)(() => normalizeTaskDatesForType(task), [task]);
@@ -4445,7 +4480,9 @@ var TaskRow = import_react3.default.memo(
4445
4480
  endDate: result.endDate.toISOString(),
4446
4481
  ...result.updatedDependencies !== void 0 && { dependencies: result.updatedDependencies }
4447
4482
  };
4448
- onTasksChange?.([updatedTask]);
4483
+ if (!onScheduleIntent) {
4484
+ onTasksChange?.([updatedTask]);
4485
+ }
4449
4486
  };
4450
4487
  const weekendPredicate = (0, import_react3.useMemo)(
4451
4488
  () => createCustomDayPredicate({ customDays, isWeekend: isWeekend3 }),
@@ -4464,6 +4501,7 @@ var TaskRow = import_react3.default.memo(
4464
4501
  monthStart,
4465
4502
  dayWidth,
4466
4503
  onDragEnd: handleDragEnd,
4504
+ onScheduleIntent,
4467
4505
  onDragStateChange,
4468
4506
  edgeZoneWidth: 20,
4469
4507
  allTasks,
@@ -6707,6 +6745,7 @@ var TaskListRow = import_react11.default.memo(
6707
6745
  taskNumberMap = {},
6708
6746
  rowHeight,
6709
6747
  onTasksChange,
6748
+ onDurationChange,
6710
6749
  selectedTaskId,
6711
6750
  onRowClick,
6712
6751
  disableTaskNameEditing = false,
@@ -7019,12 +7058,14 @@ var TaskListRow = import_react11.default.memo(
7019
7058
  const normalizedDuration = Math.max(0, Math.round(nextDuration) || 0);
7020
7059
  setDurationValue(normalizedDuration);
7021
7060
  }, []);
7022
- const handleDurationSave = (0, import_react11.useCallback)(() => {
7023
- if (durationConfirmedRef.current) {
7024
- durationConfirmedRef.current = false;
7061
+ const emitDurationChange = (0, import_react11.useCallback)((rounded) => {
7062
+ if (onDurationChange) {
7063
+ onDurationChange(
7064
+ isMilestone && rounded > 0 ? { ...task, type: "task" } : !isMilestone && rounded === 0 ? { ...task, type: "milestone", endDate: task.startDate } : task,
7065
+ rounded
7066
+ );
7025
7067
  return;
7026
7068
  }
7027
- const rounded = Math.round(durationValue) || 0;
7028
7069
  if (isMilestone && rounded > 0) {
7029
7070
  onTasksChange?.([
7030
7071
  { ...task, type: "task", endDate: getEndDate(task.startDate, rounded) }
@@ -7038,8 +7079,16 @@ var TaskListRow = import_react11.default.memo(
7038
7079
  { ...task, endDate: getEndDate(task.startDate, rounded) }
7039
7080
  ]);
7040
7081
  }
7082
+ }, [getEndDate, isMilestone, onDurationChange, onTasksChange, task]);
7083
+ const handleDurationSave = (0, import_react11.useCallback)(() => {
7084
+ if (durationConfirmedRef.current) {
7085
+ durationConfirmedRef.current = false;
7086
+ return;
7087
+ }
7088
+ const rounded = Math.round(durationValue) || 0;
7089
+ emitDurationChange(rounded);
7041
7090
  setEditingColumnId(null);
7042
- }, [durationValue, task, onTasksChange, getEndDate, isMilestone]);
7091
+ }, [durationValue, emitDurationChange]);
7043
7092
  const handleDurationCancel = (0, import_react11.useCallback)(() => {
7044
7093
  setDurationValue(isMilestone ? 0 : getDuration(normalizedTask.startDate, normalizedTask.endDate));
7045
7094
  setEditingColumnId(null);
@@ -7056,25 +7105,13 @@ var TaskListRow = import_react11.default.memo(
7056
7105
  if (e.key === "Enter") {
7057
7106
  durationConfirmedRef.current = true;
7058
7107
  const rounded = Math.round(durationValue) || 0;
7059
- if (isMilestone && rounded > 0) {
7060
- onTasksChange?.([
7061
- { ...task, type: "task", endDate: getEndDate(task.startDate, rounded) }
7062
- ]);
7063
- } else if (!isMilestone && rounded === 0) {
7064
- onTasksChange?.([
7065
- { ...task, type: "milestone", endDate: task.startDate }
7066
- ]);
7067
- } else if (!isMilestone && rounded > 0) {
7068
- onTasksChange?.([
7069
- { ...task, endDate: getEndDate(task.startDate, rounded) }
7070
- ]);
7071
- }
7108
+ emitDurationChange(rounded);
7072
7109
  setEditingColumnId(null);
7073
7110
  } else if (e.key === "Escape") {
7074
7111
  handleDurationCancel();
7075
7112
  }
7076
7113
  },
7077
- [durationValue, task, onTasksChange, handleDurationCancel, getEndDate, isMilestone]
7114
+ [durationValue, emitDurationChange, handleDurationCancel]
7078
7115
  );
7079
7116
  const handleProgressClick = (0, import_react11.useCallback)(
7080
7117
  (e) => {
@@ -8872,6 +8909,7 @@ var TaskList = ({
8872
8909
  headerHeight,
8873
8910
  taskListWidth,
8874
8911
  onTasksChange,
8912
+ onDurationChange,
8875
8913
  selectedTaskId,
8876
8914
  onTaskSelect,
8877
8915
  show = true,
@@ -9893,6 +9931,7 @@ var TaskList = ({
9893
9931
  taskNumberMap: originalTaskNumberMap,
9894
9932
  rowHeight,
9895
9933
  onTasksChange,
9934
+ onDurationChange,
9896
9935
  selectedTaskId,
9897
9936
  onRowClick: handleRowClick,
9898
9937
  disableTaskNameEditing,
@@ -13895,6 +13934,7 @@ function TaskGanttChartInner(props, ref) {
13895
13934
  headerHeight = 40,
13896
13935
  containerHeight,
13897
13936
  onTasksChange,
13937
+ onScheduleIntent,
13898
13938
  onValidateDependencies,
13899
13939
  enableAutoSchedule,
13900
13940
  disableConstraints,
@@ -14420,7 +14460,7 @@ function TaskGanttChartInner(props, ref) {
14420
14460
  }
14421
14461
  previewPositionStore.clear();
14422
14462
  }, [previewPositionStore]);
14423
- const handleTaskChange = (0, import_react18.useCallback)((updatedTasks) => {
14463
+ const handleTaskChange = (0, import_react18.useCallback)((updatedTasks, durationEdit) => {
14424
14464
  const updatedTask = updatedTasks[0];
14425
14465
  if (!updatedTask) return;
14426
14466
  const originalTask = tasks.find((t) => t.id === updatedTask.id);
@@ -14469,12 +14509,18 @@ function TaskGanttChartInner(props, ref) {
14469
14509
  const isUniformMove = deltaStart === deltaEnd && deltaStart !== 0;
14470
14510
  if (!isUniformMove) {
14471
14511
  const anchor = deltaStart === 0 ? "start" : deltaEnd === 0 ? "end" : "start";
14472
- const targetDuration = getTaskDuration(
14512
+ const targetDuration = durationEdit?.duration ?? getTaskDuration(
14473
14513
  anchor === "start" ? origStart : newStart,
14474
14514
  anchor === "start" ? newEnd : origEnd,
14475
14515
  businessDays,
14476
14516
  isCustomWeekend
14477
14517
  );
14518
+ onScheduleIntent?.({
14519
+ type: "change_duration",
14520
+ taskId: updatedTask.id,
14521
+ duration: targetDuration,
14522
+ anchor: durationEdit?.anchor ?? anchor
14523
+ });
14478
14524
  const scaleResult = scaleTaskSubtreeDuration(updatedTask.id, targetDuration, tasks, {
14479
14525
  anchor,
14480
14526
  businessDays,
@@ -14482,7 +14528,7 @@ function TaskGanttChartInner(props, ref) {
14482
14528
  externalDependencyPolicy: "cascade-successors"
14483
14529
  });
14484
14530
  onSubtreeScaleResult?.(scaleResult);
14485
- if (scaleResult.ok && scaleResult.changedTasks.length > 0) {
14531
+ if (!onScheduleIntent && scaleResult.ok && scaleResult.changedTasks.length > 0) {
14486
14532
  onTasksChange?.(scaleResult.changedTasks);
14487
14533
  }
14488
14534
  if (editingTaskId === updatedTask.id) {
@@ -14491,7 +14537,15 @@ function TaskGanttChartInner(props, ref) {
14491
14537
  return;
14492
14538
  }
14493
14539
  const movedParentCascade = disableConstraints ? [updatedTask] : universalCascade(updatedTask, newStart, newEnd, tasks, businessDays, isCustomWeekend);
14494
- onTasksChange?.(movedParentCascade);
14540
+ if (onScheduleIntent) {
14541
+ onScheduleIntent({
14542
+ type: "move_task",
14543
+ taskId: updatedTask.id,
14544
+ startDate: newStart.toISOString().split("T")[0]
14545
+ });
14546
+ } else {
14547
+ onTasksChange?.(movedParentCascade);
14548
+ }
14495
14549
  if (editingTaskId === updatedTask.id) {
14496
14550
  setEditingTaskId(null);
14497
14551
  }
@@ -14499,8 +14553,51 @@ function TaskGanttChartInner(props, ref) {
14499
14553
  }
14500
14554
  const sourceTasks = tasks.map((task) => task.id === updatedTask.id ? updatedTask : task);
14501
14555
  const cascadedTasks = disableConstraints ? [updatedTask] : universalCascade(updatedTask, newStart, newEnd, sourceTasks, businessDays, isCustomWeekend);
14502
- onTasksChange?.(cascadedTasks);
14503
- }, [tasks, onTasksChange, disableConstraints, editingTaskId, businessDays, isCustomWeekend, onSubtreeScaleResult]);
14556
+ if (durationEdit) {
14557
+ if (onScheduleIntent) {
14558
+ onScheduleIntent({
14559
+ type: "change_duration",
14560
+ taskId: updatedTask.id,
14561
+ duration: durationEdit.duration,
14562
+ anchor: durationEdit.anchor
14563
+ });
14564
+ } else {
14565
+ onTasksChange?.(cascadedTasks);
14566
+ }
14567
+ } else if (onScheduleIntent) {
14568
+ const startChanged = origStart.getTime() !== newStart.getTime();
14569
+ const endChanged = origEnd.getTime() !== newEnd.getTime();
14570
+ if (startChanged && endChanged) {
14571
+ onScheduleIntent({
14572
+ type: "move_task",
14573
+ taskId: updatedTask.id,
14574
+ startDate: newStart.toISOString().split("T")[0]
14575
+ });
14576
+ } else {
14577
+ const anchor = startChanged ? "end" : "start";
14578
+ onScheduleIntent({
14579
+ type: "resize_task",
14580
+ taskId: updatedTask.id,
14581
+ anchor,
14582
+ date: (startChanged ? newStart : newEnd).toISOString().split("T")[0]
14583
+ });
14584
+ }
14585
+ } else {
14586
+ onTasksChange?.(cascadedTasks);
14587
+ }
14588
+ }, [tasks, onTasksChange, onScheduleIntent, disableConstraints, editingTaskId, businessDays, isCustomWeekend, onSubtreeScaleResult]);
14589
+ const handleTaskDurationChange = (0, import_react18.useCallback)((task, duration) => {
14590
+ const updatedTask = {
14591
+ ...task,
14592
+ endDate: task.type === "milestone" ? task.startDate : buildTaskRangeFromStart(
14593
+ parseUTCDate(task.startDate),
14594
+ duration,
14595
+ businessDays,
14596
+ isCustomWeekend
14597
+ ).end.toISOString()
14598
+ };
14599
+ handleTaskChange([updatedTask], { duration, anchor: "start" });
14600
+ }, [businessDays, handleTaskChange, isCustomWeekend]);
14504
14601
  const handleDelete = (0, import_react18.useCallback)((taskId) => {
14505
14602
  const toDelete = /* @__PURE__ */ new Set([taskId]);
14506
14603
  function collectDescendants(parentId) {
@@ -14648,8 +14745,10 @@ function TaskGanttChartInner(props, ref) {
14648
14745
  [renderedChartTasks]
14649
14746
  );
14650
14747
  const handleCascade = (0, import_react18.useCallback)((cascadedTasks) => {
14651
- onTasksChange?.(cascadedTasks);
14652
- }, [tasks, onTasksChange]);
14748
+ if (!onScheduleIntent) {
14749
+ onTasksChange?.(cascadedTasks);
14750
+ }
14751
+ }, [onScheduleIntent, onTasksChange]);
14653
14752
  const handleTaskSelect = (0, import_react18.useCallback)((taskId) => {
14654
14753
  setSelectedTaskId(taskId);
14655
14754
  }, []);
@@ -14984,6 +15083,7 @@ function TaskGanttChartInner(props, ref) {
14984
15083
  headerHeight,
14985
15084
  taskListWidth,
14986
15085
  onTasksChange: handleTaskChange,
15086
+ onDurationChange: handleTaskDurationChange,
14987
15087
  selectedTaskId: selectedTaskId ?? void 0,
14988
15088
  onTaskSelect: handleTaskSelect,
14989
15089
  show: showTaskList,
@@ -15289,6 +15389,7 @@ function TaskGanttChartInner(props, ref) {
15289
15389
  previewPositionStore,
15290
15390
  onCascadeProgress: handleCascadeProgress,
15291
15391
  onCascade: handleCascade,
15392
+ onScheduleIntent,
15292
15393
  highlightExpiredTasks,
15293
15394
  showBaseline,
15294
15395
  isFilterMatch: (filterMode === "highlight" ? matchedTaskIds.has(task.id) : false) || (criticalPathMode === "highlight" ? criticalTaskIds.has(task.id) : false),