@burdenoff/planmagnet-fe-sdk 2026.703.3 → 2026.704.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.d.ts CHANGED
@@ -233,6 +233,37 @@ interface WorkItemLinkList {
233
233
  pageInfo: TaskPageInfo;
234
234
  totalCount: number;
235
235
  }
236
+ /** Milestone status (MilestoneStatus). */
237
+ type MilestoneStatus = "PENDING" | "IN_PROGRESS" | "COMPLETED" | "MISSED" | "CANCELLED";
238
+ /**
239
+ * A project milestone (e.g. a harvest window). Rendered as a flag on the
240
+ * Timeline. `sortOrder`/`tagsV2` are intentionally omitted (see LIST_MILESTONES).
241
+ */
242
+ interface Milestone {
243
+ id: string;
244
+ projectId: string;
245
+ name: string;
246
+ description?: string | null;
247
+ status: MilestoneStatus;
248
+ dueDate?: string | null;
249
+ completedAt?: string | null;
250
+ ownerId?: string | null;
251
+ createdAt: string;
252
+ updatedAt: string;
253
+ }
254
+ /** Filter for `planmagnetMilestones` (PlanmagnetMilestoneFilter). */
255
+ interface ListMilestonesInput {
256
+ ownerId?: string;
257
+ projectId?: string;
258
+ search?: string;
259
+ status?: MilestoneStatus;
260
+ }
261
+ /** Shape returned by LIST_MILESTONES (PlanmagnetMilestoneList). */
262
+ interface MilestoneList {
263
+ items: Milestone[];
264
+ pageInfo: TaskPageInfo;
265
+ totalCount: number;
266
+ }
236
267
  /** Board column definition. */
237
268
  interface BoardColumn {
238
269
  status: TaskStatus;
@@ -364,6 +395,11 @@ declare function Drawer(props: DrawerProps): react.JSX.Element;
364
395
  type ResolveAssignee = (assigneeId: string) => {
365
396
  name?: string | null;
366
397
  } | null | undefined;
398
+ /** A selectable assignee for the create/edit picker (host-provided directory). */
399
+ interface AssigneeOption {
400
+ id: string;
401
+ name: string;
402
+ }
367
403
  interface TaskCardProps {
368
404
  task: Task;
369
405
  /** Field names to hide (key/type/priority/labels/storyPoints/assignee/dueDate). */
@@ -509,6 +545,8 @@ interface CreateTaskCoreProps {
509
545
  * until a project id is present.
510
546
  */
511
547
  projectId?: string;
548
+ /** Optional host-provided member directory → renders an assignee picker. */
549
+ assigneeOptions?: AssigneeOption[];
512
550
  /** Field names to hide on the form. */
513
551
  hiddenFields?: CreateTaskField[];
514
552
  /** Default values applied on first render. */
@@ -536,7 +574,7 @@ interface CreateTaskCoreProps {
536
574
  * Mirrors the TaskBoardCore contract: `workspaceId` from a prop or the
537
575
  * PlanMagnetProvider context, `hiddenFields` for host-driven field suppression.
538
576
  */
539
- declare function CreateTaskCore({ projectId: projectIdProp, hiddenFields, defaultValues, hideHeader, submitLabel, onCreated, onError, onCancel, className, workspaceId: workspaceIdProp, }: CreateTaskCoreProps): react.JSX.Element;
577
+ declare function CreateTaskCore({ projectId: projectIdProp, assigneeOptions, hiddenFields, defaultValues, hideHeader, submitLabel, onCreated, onError, onCancel, className, workspaceId: workspaceIdProp, }: CreateTaskCoreProps): react.JSX.Element;
540
578
 
541
579
  interface CreateTaskProps extends CreateTaskCoreProps {
542
580
  /** Workspace API gateway URL (URL mode). */
@@ -693,6 +731,8 @@ interface TaskTimelineCoreProps {
693
731
  onSelect?: (id: string) => void;
694
732
  /** Optional host hook to resolve an assignee id → display name. */
695
733
  resolveAssignee?: ResolveAssignee;
734
+ /** Fetch + flag project milestones on the timeline (default true). */
735
+ showMilestones?: boolean;
696
736
  className?: string;
697
737
  workspaceId?: string;
698
738
  }
@@ -705,7 +745,7 @@ interface TaskTimelineCoreProps {
705
745
  * honest to the data. Overdue and undated work is surfaced explicitly so nothing
706
746
  * hides. BYO-Apollo, semantic-token only, farm-free.
707
747
  */
708
- declare function TaskTimelineCore({ projectId, priority, type, search, assigneeId, defaultMode, onSelect, resolveAssignee, className, workspaceId: workspaceIdProp, }: TaskTimelineCoreProps): react.JSX.Element;
748
+ declare function TaskTimelineCore({ projectId, priority, type, search, assigneeId, defaultMode, onSelect, resolveAssignee, showMilestones, className, workspaceId: workspaceIdProp, }: TaskTimelineCoreProps): react.JSX.Element;
709
749
 
710
750
  /** The three task views the toolbar can switch between. */
711
751
  type TaskView = "board" | "list" | "timeline";
@@ -722,6 +762,9 @@ interface TaskToolbarProps {
722
762
  onTypeChange: (type: TaskType | "ALL") => void;
723
763
  onNewTask?: () => void;
724
764
  canCreate?: boolean;
765
+ /** "My tasks" toggle — only rendered when `onMineChange` is provided. */
766
+ mine?: boolean;
767
+ onMineChange?: (mine: boolean) => void;
725
768
  className?: string;
726
769
  }
727
770
  /**
@@ -729,7 +772,7 @@ interface TaskToolbarProps {
729
772
  * view tabs (Board / List / Timeline) + search + priority/type filters + a
730
773
  * "New task" action. Fully controlled; semantic-token only.
731
774
  */
732
- declare function TaskToolbar({ view, onViewChange, views, search, onSearchChange, priority, onPriorityChange, type, onTypeChange, onNewTask, canCreate, className, }: TaskToolbarProps): react.JSX.Element;
775
+ declare function TaskToolbar({ view, onViewChange, views, search, onSearchChange, priority, onPriorityChange, type, onTypeChange, onNewTask, canCreate, mine, onMineChange, className, }: TaskToolbarProps): react.JSX.Element;
733
776
 
734
777
  /** Fields that can be hidden / suppressed on the detail view + edit form. */
735
778
  type TaskDetailField = "description" | "type" | "status" | "priority" | "assignee" | "dueDate" | "labels" | "storyPoints";
@@ -744,8 +787,14 @@ interface TaskDetailCoreProps {
744
787
  hideHeader?: boolean;
745
788
  /** Called with the updated work item after a successful save. */
746
789
  onUpdated?: (workItem: WorkItemDetail) => void;
747
- /** Called when the update mutation errors. */
790
+ /** Called after a successful delete (with the deleted id). Enables the Delete button. */
791
+ onDeleted?: (id: string) => void;
792
+ /** Called when a mutation errors. */
748
793
  onError?: (error: Error) => void;
794
+ /** Optional host hook to resolve an assignee id → display name. */
795
+ resolveAssignee?: ResolveAssignee;
796
+ /** Optional host-provided member directory → renders a picker instead of a raw id field. */
797
+ assigneeOptions?: AssigneeOption[];
749
798
  /** Extra classes on the root container. */
750
799
  className?: string;
751
800
  }
@@ -754,7 +803,7 @@ interface TaskDetailCoreProps {
754
803
  * edit. Fetches via `planmagnetWorkItem(id)`, saves via
755
804
  * `planmagnetUpdateWorkItem`. BYO-Apollo, semantic-token only, farm-free.
756
805
  */
757
- declare function TaskDetailCore({ id, readonly, hiddenFields, hideHeader, onUpdated, onError, className, }: TaskDetailCoreProps): react.JSX.Element;
806
+ declare function TaskDetailCore({ id, readonly, hiddenFields, hideHeader, onUpdated, onDeleted, onError, resolveAssignee, assigneeOptions, className, }: TaskDetailCoreProps): react.JSX.Element;
758
807
 
759
808
  interface TaskDetailProps extends TaskDetailCoreProps {
760
809
  /** Workspace API gateway URL (URL mode). */
@@ -795,6 +844,96 @@ interface TaskDetailProps extends TaskDetailCoreProps {
795
844
  */
796
845
  declare function TaskDetail({ apiGatewayUrl, authToken, workspaceToken, workspaceId, tenantId, organizationId, trustedOrigins, onAuthError, workspaceClient, ...coreProps }: TaskDetailProps): react.JSX.Element;
797
846
 
847
+ /**
848
+ * TaskLabels — every user-facing string the SDK renders, so a host (e.g.
849
+ * HealthyBowl, which ships 6 languages) can inject translations. English
850
+ * defaults are used when no `labels` are provided, so the SDK works standalone.
851
+ * The SDK stays farm-free + string-agnostic; the host owns translation.
852
+ */
853
+ interface TaskLabels {
854
+ board: string;
855
+ list: string;
856
+ timeline: string;
857
+ searchPlaceholder: string;
858
+ allPriorities: string;
859
+ allTypes: string;
860
+ newTask: string;
861
+ myTasks: string;
862
+ noTasks: string;
863
+ noTasksFound: string;
864
+ dropHere: string;
865
+ unassigned: string;
866
+ assigned: string;
867
+ overdue: string;
868
+ noDueDate: string;
869
+ milestones: string;
870
+ today: string;
871
+ week: string;
872
+ month: string;
873
+ tasksSingular: string;
874
+ tasksPlural: string;
875
+ colTask: string;
876
+ colStatus: string;
877
+ colPriority: string;
878
+ colAssignee: string;
879
+ colDueDate: string;
880
+ colPoints: string;
881
+ colLinkedRecord: string;
882
+ colType: string;
883
+ colKey: string;
884
+ colLabels: string;
885
+ newTaskHeading: string;
886
+ newTaskSubtitle: string;
887
+ title: string;
888
+ titlePlaceholder: string;
889
+ description: string;
890
+ descriptionPlaceholder: string;
891
+ typeLabel: string;
892
+ statusLabel: string;
893
+ priorityLabel: string;
894
+ assigneeLabel: string;
895
+ assigneePlaceholder: string;
896
+ dueDateLabel: string;
897
+ storyPointsLabel: string;
898
+ labelsLabel: string;
899
+ labelsPlaceholder: string;
900
+ create: string;
901
+ creating: string;
902
+ cancel: string;
903
+ edit: string;
904
+ del: string;
905
+ deletePrompt: string;
906
+ yes: string;
907
+ no: string;
908
+ save: string;
909
+ saving: string;
910
+ taskNotFound: string;
911
+ projectRequired: string;
912
+ errorLoading: string;
913
+ moveFailed: string;
914
+ failedToCreate: string;
915
+ failedToSave: string;
916
+ failedToDelete: string;
917
+ overdueLabel: string;
918
+ more: string;
919
+ status: Record<TaskStatus, string>;
920
+ priority: Record<TaskPriority, string>;
921
+ type: Record<TaskType, string>;
922
+ }
923
+ /** English defaults — the SDK renders these when no `labels` prop is provided. */
924
+ declare const DEFAULT_TASK_LABELS: TaskLabels;
925
+ declare const TaskLabelsProvider: react.Provider<TaskLabels>;
926
+ /** Read the active task labels (English defaults if no host override). */
927
+ declare function useTaskLabels(): TaskLabels;
928
+ /** A host may override any subset; missing keys fall back to English. */
929
+ type PartialTaskLabels = Partial<Omit<TaskLabels, "status" | "priority" | "type">> & {
930
+ status?: Partial<TaskLabels["status"]>;
931
+ priority?: Partial<TaskLabels["priority"]>;
932
+ type?: Partial<TaskLabels["type"]>;
933
+ };
934
+ /** Merge a host's partial overrides onto the English defaults. */
935
+ declare function mergeTaskLabels(overrides?: PartialTaskLabels): TaskLabels;
936
+
798
937
  /**
799
938
  * Which SDK fields the composed page should suppress. The union of the create
800
939
  * form fields and the detail fields — the page fans a single `hiddenFields`
@@ -844,6 +983,21 @@ interface TasksPageCoreProps {
844
983
  linkSourceProduct?: string;
845
984
  /** Optional host hook to render an icon per linked-entity type. */
846
985
  renderLinkIcon?: RenderLinkIcon;
986
+ /** Optional host-provided member directory → renders assignee pickers in create/edit. */
987
+ assigneeOptions?: AssigneeOption[];
988
+ /**
989
+ * The current user's actor id. When provided, the toolbar shows a "My tasks"
990
+ * toggle that filters every view to items assigned to this actor.
991
+ */
992
+ currentActorId?: string;
993
+ /** Host-provided translations for every UI string (English defaults otherwise). */
994
+ labels?: PartialTaskLabels;
995
+ /**
996
+ * Open a specific work item's detail on mount / when this changes — e.g. a
997
+ * deep-link from the calendar (`/tasks?item=<id>`). Cleared internally when
998
+ * the user closes the drawer; pass a new value to re-open.
999
+ */
1000
+ openItemId?: string;
847
1001
  /**
848
1002
  * Header/title slot rendered ABOVE the toolbar. Pass a string for the default
849
1003
  * heading, or any node to fully own the title area. Omit for no title (e.g.
@@ -868,7 +1022,7 @@ interface TasksPageCoreProps {
868
1022
  * BYO-Apollo: reads the ambient `<ApolloProvider>` and takes `workspaceId` from
869
1023
  * a prop or the PlanMagnetProvider context. Semantic tokens only, farm-free.
870
1024
  */
871
- declare function TasksPageCore({ workspaceId: workspaceIdProp, projectId, boardProjectId, columns, readonly, hiddenFields, views, defaultView, resolveAssignee, linkSourceProduct, renderLinkIcon, header, onTaskSaved, createSurface, detailSurface, className, }: TasksPageCoreProps): react.JSX.Element;
1025
+ declare function TasksPageCore({ workspaceId: workspaceIdProp, projectId, boardProjectId, columns, readonly, hiddenFields, views, defaultView, resolveAssignee, linkSourceProduct, renderLinkIcon, assigneeOptions, currentActorId, labels, openItemId, header, onTaskSaved, createSurface, detailSurface, className, }: TasksPageCoreProps): react.JSX.Element;
872
1026
 
873
1027
  interface TasksPageProps extends TasksPageCoreProps {
874
1028
  /** Workspace API gateway URL (URL mode). */
@@ -986,6 +1140,24 @@ interface UseWorkItemLinksResult {
986
1140
  */
987
1141
  declare function useWorkItemLinks(workspaceId: string | undefined, sourceProduct: string | undefined, limit?: number): UseWorkItemLinksResult;
988
1142
 
1143
+ interface UseMilestonesResult {
1144
+ milestones: Milestone[];
1145
+ /** Milestones grouped by their due day (yyyy-MM-dd), for timeline flags. */
1146
+ byDay: Map<string, Milestone[]>;
1147
+ loading: boolean;
1148
+ }
1149
+ /**
1150
+ * useMilestones — fetch a project's milestones (e.g. a harvest window) for the
1151
+ * Timeline to flag. Skips when no workspaceId. Errors are swallowed by Apollo's
1152
+ * error return so a milestone RBAC/serialization hiccup never breaks the board;
1153
+ * `milestones` is simply empty. Farm-free; opt-in via `enabled`.
1154
+ */
1155
+ declare function useMilestones(workspaceId: string | undefined, opts?: {
1156
+ projectId?: string;
1157
+ enabled?: boolean;
1158
+ limit?: number;
1159
+ }): UseMilestonesResult;
1160
+
989
1161
  interface PlanMagnetClientConfig {
990
1162
  /** Workspace API gateway base URL (e.g. https://graphqlworkspaces.burdenoff.com). */
991
1163
  apiGatewayUrl: string;
@@ -1063,6 +1235,9 @@ declare const WORK_ITEM_LINK_FIELDS: graphql.DocumentNode;
1063
1235
  declare const LIST_WORK_ITEM_LINKS: graphql.DocumentNode;
1064
1236
  declare const CREATE_WORK_ITEM_LINK: graphql.DocumentNode;
1065
1237
  declare const DELETE_WORK_ITEM_LINK: graphql.DocumentNode;
1238
+ declare const MILESTONE_FIELDS: graphql.DocumentNode;
1239
+ declare const LIST_MILESTONES: graphql.DocumentNode;
1240
+ declare const DELETE_WORK_ITEM: graphql.DocumentNode;
1066
1241
 
1067
1242
  /**
1068
1243
  * Configuration module for the PlanMagnet SDK.
@@ -1132,4 +1307,4 @@ declare function getGraphQLEndpoint(baseUrl?: string): string;
1132
1307
 
1133
1308
  declare function cn(...inputs: ClassValue[]): string;
1134
1309
 
1135
- export { Avatar, type AvatarProps, Badge, type BadgeProps, type BoardColumn, CREATE_WORK_ITEM, CREATE_WORK_ITEM_LINK, CreateTask, CreateTaskCore, type CreateTaskCoreProps, type CreateTaskField, type CreateTaskInput, type CreateTaskProps, type CreateWorkItemLinkInput, DEFAULT_BOARD_COLUMNS, DELETE_WORK_ITEM_LINK, Drawer, type DrawerProps, GET_PROJECTS, GET_WORK_ITEM, LIST_WORK_ITEMS, LIST_WORK_ITEM_LINKS, LinkChip, type LinkChipProps, type ListTasksInput, type ListWorkItemLinksInput, MOVE_WORK_ITEM, Modal, type ModalProps, PRIORITY_META, PROJECT_SUMMARY_FIELDS, type PlanMagnetClientConfig, type PlanMagnetConfig, PlanMagnetProvider, type PlanMagnetProviderProps, PriorityIndicator, type PriorityIndicatorProps, type Project, type ProjectList, type RenderLinkIcon, type ResolveAssignee, STATUS_META, StatusIcon, type StatusIconProps, StatusPill, type StatusPillProps, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, type Task, TaskBoard, TaskBoardCore, type TaskBoardCoreProps, type TaskBoardProps, TaskCard, type TaskCardProps, TaskDetail, TaskDetailCore, type TaskDetailCoreProps, type TaskDetailField, type TaskDetailProps, TaskList, type TaskListColumn, TaskListCore, type TaskListCoreProps, type TaskListProps, type TaskListSort, type TaskPageInfo, type TaskPaginationInput, type TaskPriority, type TaskSavedResult, type TaskStatus, TaskTimelineCore, type TaskTimelineCoreProps, TaskToolbar, type TaskToolbarProps, type TaskType, type TaskView, TasksPage, TasksPageCore, type TasksPageCoreProps, type TasksPageField, type TasksPageProps, type TasksPageSaved, TypeBadge, type TypeBadgeProps, UPDATE_WORK_ITEM, type UpdateTaskInput, type UseWorkItemLinksResult, WORK_ITEM_FIELDS, WORK_ITEM_LINK_FIELDS, WORK_ITEM_SUMMARY_FIELDS, type WorkItemDetail, type WorkItemLink, type WorkItemLinkList, type WorkItemLinkRelation, type WorkItemList, badgeVariants, cn, config, createPlanMagnetClient, enumLabel, getGraphQLEndpoint, getPlanMagnetClient, getPlanMagnetClientSafe, getPlanMagnetConfig, isPlanMagnetClientReady, resetPlanMagnetClient, resetPlanMagnetConfig, setPlanMagnetClient, setPlanMagnetConfig, usePlanMagnetContext, usePlanMagnetContextSafe, useWorkItemLinks, validateTrustedOrigin, waitForPlanMagnetClient };
1310
+ export { type AssigneeOption, Avatar, type AvatarProps, Badge, type BadgeProps, type BoardColumn, CREATE_WORK_ITEM, CREATE_WORK_ITEM_LINK, CreateTask, CreateTaskCore, type CreateTaskCoreProps, type CreateTaskField, type CreateTaskInput, type CreateTaskProps, type CreateWorkItemLinkInput, DEFAULT_BOARD_COLUMNS, DEFAULT_TASK_LABELS, DELETE_WORK_ITEM, DELETE_WORK_ITEM_LINK, Drawer, type DrawerProps, GET_PROJECTS, GET_WORK_ITEM, LIST_MILESTONES, LIST_WORK_ITEMS, LIST_WORK_ITEM_LINKS, LinkChip, type LinkChipProps, type ListMilestonesInput, type ListTasksInput, type ListWorkItemLinksInput, MILESTONE_FIELDS, MOVE_WORK_ITEM, type Milestone, type MilestoneList, type MilestoneStatus, Modal, type ModalProps, PRIORITY_META, PROJECT_SUMMARY_FIELDS, type PartialTaskLabels, type PlanMagnetClientConfig, type PlanMagnetConfig, PlanMagnetProvider, type PlanMagnetProviderProps, PriorityIndicator, type PriorityIndicatorProps, type Project, type ProjectList, type RenderLinkIcon, type ResolveAssignee, STATUS_META, StatusIcon, type StatusIconProps, StatusPill, type StatusPillProps, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, type Task, TaskBoard, TaskBoardCore, type TaskBoardCoreProps, type TaskBoardProps, TaskCard, type TaskCardProps, TaskDetail, TaskDetailCore, type TaskDetailCoreProps, type TaskDetailField, type TaskDetailProps, type TaskLabels, TaskLabelsProvider, TaskList, type TaskListColumn, TaskListCore, type TaskListCoreProps, type TaskListProps, type TaskListSort, type TaskPageInfo, type TaskPaginationInput, type TaskPriority, type TaskSavedResult, type TaskStatus, TaskTimelineCore, type TaskTimelineCoreProps, TaskToolbar, type TaskToolbarProps, type TaskType, type TaskView, TasksPage, TasksPageCore, type TasksPageCoreProps, type TasksPageField, type TasksPageProps, type TasksPageSaved, TypeBadge, type TypeBadgeProps, UPDATE_WORK_ITEM, type UpdateTaskInput, type UseMilestonesResult, type UseWorkItemLinksResult, WORK_ITEM_FIELDS, WORK_ITEM_LINK_FIELDS, WORK_ITEM_SUMMARY_FIELDS, type WorkItemDetail, type WorkItemLink, type WorkItemLinkList, type WorkItemLinkRelation, type WorkItemList, badgeVariants, cn, config, createPlanMagnetClient, enumLabel, getGraphQLEndpoint, getPlanMagnetClient, getPlanMagnetClientSafe, getPlanMagnetConfig, isPlanMagnetClientReady, mergeTaskLabels, resetPlanMagnetClient, resetPlanMagnetConfig, setPlanMagnetClient, setPlanMagnetConfig, useMilestones, usePlanMagnetContext, usePlanMagnetContextSafe, useTaskLabels, useWorkItemLinks, validateTrustedOrigin, waitForPlanMagnetClient };