@burdenoff/planmagnet-fe-sdk 2026.706.7 → 2026.708.1

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
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { HTMLAttributes, ReactNode, ComponentType, DragEvent } from 'react';
2
+ import { HTMLAttributes, ReactNode, ComponentType, DragEvent, Ref } from 'react';
3
3
  import { ApolloClient } from '@apollo/client/core';
4
4
  import * as graphql from 'graphql';
5
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
@@ -64,6 +64,14 @@ interface Task {
64
64
  storyPoints?: number | null;
65
65
  dueDate?: string | null;
66
66
  labels: string[];
67
+ /**
68
+ * Board ordering within a status column (SDL `WorkItem.sortOrder`, backed by
69
+ * the Prisma `position` column via a read field resolver — safe to SELECT on
70
+ * query paths). Drives drag-to-reorder-within-a-column; the board sorts cards
71
+ * by this ascending so a persisted reorder survives refetch. Optional so older
72
+ * mocks/hosts that don't select it still type-check.
73
+ */
74
+ sortOrder?: number | null;
67
75
  }
68
76
  /**
69
77
  * A work item with the full field set from `WorkItemFields` — used by the
@@ -410,6 +418,12 @@ interface TaskCardProps {
410
418
  draggable?: boolean;
411
419
  onDragStart?: (task: Task, e: DragEvent<HTMLDivElement>) => void;
412
420
  onDragEnd?: (task: Task, e: DragEvent<HTMLDivElement>) => void;
421
+ /**
422
+ * Native drag-over on the card — the board uses this to compute a
423
+ * within-column reorder drop index (before/after this card). Only wired when
424
+ * `draggable`.
425
+ */
426
+ onDragOver?: (e: DragEvent<HTMLDivElement>) => void;
413
427
  /** True while this card is the one being dragged. */
414
428
  dragging?: boolean;
415
429
  resolveAssignee?: ResolveAssignee;
@@ -424,7 +438,7 @@ interface TaskCardProps {
424
438
  * only real fields (no invented assignee names or entity links). Semantic
425
439
  * tokens only.
426
440
  */
427
- declare function TaskCard({ task, hidden, onClick, draggable, onDragStart, onDragEnd, dragging, resolveAssignee, links, renderLinkIcon, className, }: TaskCardProps): react.JSX.Element;
441
+ declare function TaskCard({ task, hidden, onClick, draggable, onDragStart, onDragEnd, onDragOver, dragging, resolveAssignee, links, renderLinkIcon, className, }: TaskCardProps): react.JSX.Element;
428
442
 
429
443
  interface TaskBoardCoreProps {
430
444
  /** Scope the board to one project (client-side filter for Phase 1). */
@@ -793,6 +807,11 @@ interface TaskToolbarProps {
793
807
  views?: TaskView[];
794
808
  search: string;
795
809
  onSearchChange: (search: string) => void;
810
+ /**
811
+ * Optional ref to the search `<input>` — lets a host focus it programmatically
812
+ * (e.g. the `/` keyboard shortcut on the composed Tasks page).
813
+ */
814
+ searchInputRef?: Ref<HTMLInputElement>;
796
815
  priority: TaskPriority | "ALL";
797
816
  onPriorityChange: (priority: TaskPriority | "ALL") => void;
798
817
  type: TaskType | "ALL";
@@ -802,6 +821,11 @@ interface TaskToolbarProps {
802
821
  /** "My tasks" toggle — only rendered when `onMineChange` is provided. */
803
822
  mine?: boolean;
804
823
  onMineChange?: (mine: boolean) => void;
824
+ /**
825
+ * Extra controls rendered at the LEADING edge of the right-hand action group
826
+ * (before search) — e.g. the Saved Views dropdown. Omit for none.
827
+ */
828
+ leadingActions?: ReactNode;
805
829
  className?: string;
806
830
  }
807
831
  /**
@@ -809,7 +833,7 @@ interface TaskToolbarProps {
809
833
  * view tabs (Board / List / Timeline) + search + priority/type filters + a
810
834
  * "New task" action. Fully controlled; semantic-token only.
811
835
  */
812
- declare function TaskToolbar({ view, onViewChange, views, search, onSearchChange, priority, onPriorityChange, type, onTypeChange, onNewTask, canCreate, mine, onMineChange, className, }: TaskToolbarProps): react.JSX.Element;
836
+ declare function TaskToolbar({ view, onViewChange, views, search, onSearchChange, searchInputRef, priority, onPriorityChange, type, onTypeChange, onNewTask, canCreate, mine, onMineChange, leadingActions, className, }: TaskToolbarProps): react.JSX.Element;
813
837
 
814
838
  /** Fields that can be hidden / suppressed on the detail view + edit form. */
815
839
  type TaskDetailField = "description" | "type" | "status" | "priority" | "assignee" | "dueDate" | "labels" | "storyPoints";
@@ -965,6 +989,22 @@ interface TaskLabels {
965
989
  allTypes: string;
966
990
  newTask: string;
967
991
  myTasks: string;
992
+ savedViews: string;
993
+ saveView: string;
994
+ viewName: string;
995
+ saveViewAction: string;
996
+ deleteView: string;
997
+ noSavedViews: string;
998
+ defaultViewName: string;
999
+ keyboardShortcuts: string;
1000
+ shortcutNewTask: string;
1001
+ shortcutSearch: string;
1002
+ shortcutBoardView: string;
1003
+ shortcutListView: string;
1004
+ shortcutTimelineView: string;
1005
+ shortcutMyTasks: string;
1006
+ shortcutHelp: string;
1007
+ shortcutClose: string;
968
1008
  noTasks: string;
969
1009
  noTasksFound: string;
970
1010
  dropHere: string;
@@ -1053,6 +1093,7 @@ interface TaskLabels {
1053
1093
  projectRequired: string;
1054
1094
  errorLoading: string;
1055
1095
  moveFailed: string;
1096
+ reorderFailed: string;
1056
1097
  failedToCreate: string;
1057
1098
  failedToSave: string;
1058
1099
  failedToDelete: string;
@@ -1180,6 +1221,33 @@ interface TasksPageCoreProps {
1180
1221
  createSurface?: "modal" | "inline";
1181
1222
  /** How the detail view is surfaced. Defaults to "drawer". */
1182
1223
  detailSurface?: "drawer" | "inline";
1224
+ /**
1225
+ * Opt-in "Saved Views". When true, the toolbar state (view tab, priority /
1226
+ * type filters, search, "my tasks", and the list column config) is persisted
1227
+ * to `localStorage` (keyed per workspace) and restored on the next mount, and
1228
+ * a compact "Views" dropdown lets the user save / switch / delete named
1229
+ * views. OFF by default — existing embeds are unchanged. Client-only, no
1230
+ * backend; all storage access is SSR-/failure-safe.
1231
+ */
1232
+ enableSavedViews?: boolean;
1233
+ /**
1234
+ * Optional storage-key suffix so multiple independent Tasks surfaces in the
1235
+ * same workspace (e.g. two boards on one page) don't clobber each other's
1236
+ * persisted state. Implies `enableSavedViews` when set. The storage key is
1237
+ * `planmagnet:views:<workspaceId>[:<persistViewKey>]`.
1238
+ */
1239
+ persistViewKey?: string;
1240
+ /**
1241
+ * Opt-in Linear-style keyboard shortcuts. When true, a scoped `keydown`
1242
+ * listener (active only while this page is mounted, ignored while typing in a
1243
+ * form field and for modifier combos) enables:
1244
+ * `c` new task, `/` focus search, `b`/`l`/`g` switch Board/List/Timeline
1245
+ * (only among the enabled views), `m` toggle "My tasks" (needs
1246
+ * `currentActorId`), `?` toggle a dismissible help overlay, and `Escape` to
1247
+ * close the create / detail / help surfaces. OFF by default — existing embeds
1248
+ * are byte-for-byte unchanged.
1249
+ */
1250
+ enableShortcuts?: boolean;
1183
1251
  /** Extra classes on the root container. */
1184
1252
  className?: string;
1185
1253
  }
@@ -1192,7 +1260,7 @@ interface TasksPageCoreProps {
1192
1260
  * BYO-Apollo: reads the ambient `<ApolloProvider>` and takes `workspaceId` from
1193
1261
  * a prop or the PlanMagnetProvider context. Semantic tokens only, farm-free.
1194
1262
  */
1195
- declare function TasksPageCore({ workspaceId: workspaceIdProp, projectId, boardProjectId, columns, readonly, canCreateMilestone, locale, hiddenFields, views, defaultView, confirmMove, resolveAssignee, linkSourceProduct, renderLinkIcon, assigneeOptions, currentActorId, commentsEntityType, onMention, labels, openItemId, header, onTaskSaved, createSurface, detailSurface, className, }: TasksPageCoreProps): react.JSX.Element;
1263
+ declare function TasksPageCore({ workspaceId: workspaceIdProp, projectId, boardProjectId, columns, readonly, canCreateMilestone, locale, hiddenFields, views, defaultView, confirmMove, resolveAssignee, linkSourceProduct, renderLinkIcon, assigneeOptions, currentActorId, commentsEntityType, onMention, labels, openItemId, header, onTaskSaved, createSurface, detailSurface, enableSavedViews, persistViewKey, enableShortcuts, className, }: TasksPageCoreProps): react.JSX.Element;
1196
1264
 
1197
1265
  interface TasksPageProps extends TasksPageCoreProps {
1198
1266
  /** Workspace API gateway URL (URL mode). */
@@ -1345,6 +1413,110 @@ declare function useMilestones(workspaceId: string | undefined, opts?: {
1345
1413
  limit?: number;
1346
1414
  }): UseMilestonesResult;
1347
1415
 
1416
+ /**
1417
+ * The user-controlled toolbar/view state the Saved Views feature persists and
1418
+ * restores. Product-agnostic: the same shape drives Board / List / Timeline.
1419
+ */
1420
+ interface ViewState {
1421
+ /** Active view tab. */
1422
+ view: TaskView;
1423
+ /** Priority quick-filter ("ALL" = no filter). */
1424
+ priority: TaskPriority | "ALL";
1425
+ /** Type quick-filter ("ALL" = no filter). */
1426
+ type: TaskType | "ALL";
1427
+ /** Free-text search. */
1428
+ search: string;
1429
+ /** "My tasks" toggle. */
1430
+ mine: boolean;
1431
+ /**
1432
+ * List column config (order preserved). `null` = use the page default
1433
+ * (which itself may depend on `linkSourceProduct`).
1434
+ */
1435
+ listColumns: TaskListColumn[] | null;
1436
+ }
1437
+ /** A user-named snapshot of a {@link ViewState}. */
1438
+ interface SavedView {
1439
+ /** Stable id (nanoid-ish; generated client-side). */
1440
+ id: string;
1441
+ /** Display name the user typed. */
1442
+ name: string;
1443
+ /** The captured filter/view state. */
1444
+ state: ViewState;
1445
+ }
1446
+ /**
1447
+ * Compose the storage key for a workspace — `planmagnet:views:<workspaceId>`,
1448
+ * optionally suffixed (`:<suffix>`) so multiple independent Tasks surfaces in
1449
+ * one workspace don't clobber each other.
1450
+ */
1451
+ declare function makeStorageKey(workspaceId: string, suffix?: string): string;
1452
+ interface UseSavedViewsArgs {
1453
+ /**
1454
+ * Fully-composed localStorage key (see {@link makeStorageKey}). All reads and
1455
+ * writes target this key.
1456
+ */
1457
+ storageKey: string;
1458
+ /** Feature master switch — when false the hook is a no-op passthrough. */
1459
+ enabled: boolean;
1460
+ /** The live toolbar state to persist (debounced). */
1461
+ current: ViewState;
1462
+ }
1463
+ interface UseSavedViewsResult {
1464
+ /**
1465
+ * The state restored from storage on the first mount, or `null` if there was
1466
+ * nothing to restore (or the feature is disabled). Consumers apply this once
1467
+ * to seed their controlled inputs.
1468
+ */
1469
+ restored: ViewState | null;
1470
+ /** All saved named views for this workspace. */
1471
+ views: SavedView[];
1472
+ /** The id of the currently-applied saved view (or null for an ad-hoc state). */
1473
+ activeViewId: string | null;
1474
+ /** Persist the current toolbar state as a new named view; returns its id. */
1475
+ saveView: (name: string) => string | null;
1476
+ /** Apply a saved view — returns its state so the caller can seed inputs. */
1477
+ applyView: (id: string) => ViewState | null;
1478
+ /** Delete a saved view by id. */
1479
+ deleteView: (id: string) => void;
1480
+ /** Clear the "active saved view" pointer (e.g. after a manual filter edit). */
1481
+ clearActiveView: () => void;
1482
+ }
1483
+ /**
1484
+ * useSavedViews — client-side (localStorage) persistence of the Tasks toolbar
1485
+ * state, keyed per workspace, plus optional user-named views. No backend.
1486
+ *
1487
+ * - Restores the last-active toolbar state on mount (`restored`, applied once).
1488
+ * - Debounces writes of the live `current` state.
1489
+ * - Manages a list of named views (save / apply / delete).
1490
+ * - Fully guarded: SSR-safe and resilient to disabled/quota-limited storage.
1491
+ *
1492
+ * When `enabled` is false the hook does nothing (no reads, no writes) and
1493
+ * returns empty results, so callers stay non-breaking by default.
1494
+ */
1495
+ declare function useSavedViews({ storageKey, enabled, current, }: UseSavedViewsArgs): UseSavedViewsResult;
1496
+
1497
+ interface SavedViewsMenuProps {
1498
+ /** All saved named views for the workspace. */
1499
+ views: SavedView[];
1500
+ /** The id of the currently-applied saved view (null = ad-hoc/default). */
1501
+ activeViewId: string | null;
1502
+ /** Save the current filter set as a new named view. */
1503
+ onSaveView: (name: string) => void;
1504
+ /** Apply a saved view by id. */
1505
+ onApplyView: (id: string) => void;
1506
+ /** Delete a saved view by id. */
1507
+ onDeleteView: (id: string) => void;
1508
+ className?: string;
1509
+ }
1510
+ /**
1511
+ * SavedViewsMenu — a compact toolbar dropdown to save the current filter set as
1512
+ * a named view, switch between saved views, and delete one. Client-only (the
1513
+ * persistence lives in `useSavedViews`); semantic-token styled; farm-free.
1514
+ *
1515
+ * Self-contained dropdown (no fe-libs / portal dependency) so it renders in any
1516
+ * host and in happy-dom tests. Closes on outside-click and Escape.
1517
+ */
1518
+ declare function SavedViewsMenu({ views, activeViewId, onSaveView, onApplyView, onDeleteView, className, }: SavedViewsMenuProps): react.JSX.Element;
1519
+
1348
1520
  interface PlanMagnetClientConfig {
1349
1521
  /** Workspace API gateway base URL (e.g. https://graphqlworkspaces.burdenoff.com). */
1350
1522
  apiGatewayUrl: string;
@@ -1495,4 +1667,4 @@ declare function getGraphQLEndpoint(baseUrl?: string): string;
1495
1667
 
1496
1668
  declare function cn(...inputs: ClassValue[]): string;
1497
1669
 
1498
- export { type AssigneeOption, Avatar, type AvatarProps, BULK_UPDATE_WORK_ITEMS, 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, TaskCommentsCore, type TaskCommentsCoreProps, 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 };
1670
+ export { type AssigneeOption, Avatar, type AvatarProps, BULK_UPDATE_WORK_ITEMS, 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, type SavedView, SavedViewsMenu, type SavedViewsMenuProps, StatusIcon, type StatusIconProps, StatusPill, type StatusPillProps, TASK_PRIORITIES, TASK_STATUSES, TASK_TYPES, type Task, TaskBoard, TaskBoardCore, type TaskBoardCoreProps, type TaskBoardProps, TaskCard, type TaskCardProps, TaskCommentsCore, type TaskCommentsCoreProps, 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 UseSavedViewsArgs, type UseSavedViewsResult, type UseWorkItemLinksResult, type ViewState, 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, makeStorageKey, mergeTaskLabels, resetPlanMagnetClient, resetPlanMagnetConfig, setPlanMagnetClient, setPlanMagnetConfig, useMilestones, usePlanMagnetContext, usePlanMagnetContextSafe, useSavedViews, useTaskLabels, useWorkItemLinks, validateTrustedOrigin, waitForPlanMagnetClient };