@industry-theme/backlogmd-kanban-panel 1.1.5 → 1.1.7

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 +1 @@
1
- {"version":3,"file":"KanbanPanel.d.ts","sourceRoot":"","sources":["../../src/panels/KanbanPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAelG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAiBtD;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAk9CvD,CAAC"}
1
+ {"version":3,"file":"KanbanPanel.d.ts","sourceRoot":"","sources":["../../src/panels/KanbanPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAelG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAiBtD;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA29CvD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TaskDetailPanel.d.ts","sourceRoot":"","sources":["../../src/panels/TaskDetailPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAMxE,OAAO,KAAK,EAAE,yBAAyB,EAAqB,MAAM,UAAU,CAAC;AAuG7E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,yBAAyB;IACrE,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAiDD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0yB1D,CAAC"}
1
+ {"version":3,"file":"TaskDetailPanel.d.ts","sourceRoot":"","sources":["../../src/panels/TaskDetailPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAMxE,OAAO,KAAK,EAAE,yBAAyB,EAAqB,MAAM,UAAU,CAAC;AAuG7E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,yBAAyB;IACrE,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAiDD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoxB1D,CAAC"}
@@ -11489,94 +11489,121 @@ const KanbanPanel = ({
11489
11489
  style: {
11490
11490
  display: "flex",
11491
11491
  alignItems: "center",
11492
- gap: "12px"
11492
+ gap: "6px",
11493
+ flex: 1
11493
11494
  },
11494
- children: [/* @__PURE__ */ jsxs("div", {
11495
+ children: [/* @__PURE__ */ jsx(SquareKanban, {
11496
+ size: 24,
11497
+ color: theme2.colors.primary
11498
+ }), /* @__PURE__ */ jsx("h2", {
11495
11499
  style: {
11496
- display: "flex",
11497
- alignItems: "center",
11498
- gap: "6px"
11500
+ margin: 0,
11501
+ fontSize: theme2.fontSizes[4],
11502
+ color: theme2.colors.text
11499
11503
  },
11500
- children: [/* @__PURE__ */ jsx(SquareKanban, {
11501
- size: 24,
11502
- color: theme2.colors.primary
11503
- }), /* @__PURE__ */ jsx("h2", {
11504
+ children: /* @__PURE__ */ jsxs("a", {
11505
+ href: "https://github.com/MrLesk/Backlog.md",
11506
+ target: "_blank",
11507
+ rel: "noopener noreferrer",
11504
11508
  style: {
11505
- margin: 0,
11506
- fontSize: theme2.fontSizes[4],
11507
- color: theme2.colors.text
11509
+ color: "inherit",
11510
+ textDecoration: "none"
11508
11511
  },
11509
- children: /* @__PURE__ */ jsxs("a", {
11510
- href: "https://github.com/MrLesk/Backlog.md",
11511
- target: "_blank",
11512
- rel: "noopener noreferrer",
11512
+ onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
11513
+ onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
11514
+ children: ["Backlog", /* @__PURE__ */ jsx("span", {
11513
11515
  style: {
11514
- color: "inherit",
11515
- textDecoration: "none"
11516
+ color: theme2.colors.primary
11516
11517
  },
11517
- onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
11518
- onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
11519
- children: ["Backlog", /* @__PURE__ */ jsx("span", {
11520
- style: {
11521
- color: theme2.colors.primary
11522
- },
11523
- children: ".md"
11524
- })]
11525
- })
11526
- })]
11527
- }), isBacklogProject && totalTasksState.total > 0 && /* @__PURE__ */ jsxs("div", {
11518
+ children: ".md"
11519
+ })]
11520
+ })
11521
+ })]
11522
+ }), isBacklogProject && totalTasksState.total > 0 && /* @__PURE__ */ jsxs("div", {
11523
+ style: {
11524
+ display: "flex",
11525
+ background: theme2.colors.backgroundSecondary,
11526
+ borderRadius: theme2.radii[2],
11527
+ padding: "3px",
11528
+ gap: "2px"
11529
+ },
11530
+ children: [/* @__PURE__ */ jsx("button", {
11531
+ onClick: () => {
11532
+ setViewMode("milestones");
11533
+ setIsSearchVisible(false);
11534
+ setSearchQuery("");
11535
+ },
11528
11536
  style: {
11537
+ padding: "6px 12px",
11538
+ border: "none",
11539
+ borderRadius: theme2.radii[1],
11540
+ background: "transparent",
11541
+ color: viewMode === "milestones" ? theme2.colors.primary : theme2.colors.textSecondary,
11542
+ fontSize: theme2.fontSizes[2],
11543
+ fontWeight: theme2.fontWeights.medium,
11544
+ cursor: "pointer",
11545
+ transition: "all 0.2s ease",
11529
11546
  display: "flex",
11530
- background: theme2.colors.backgroundSecondary,
11531
- borderRadius: theme2.radii[2],
11532
- padding: "3px",
11533
- gap: "2px"
11547
+ alignItems: "center",
11548
+ justifyContent: "center",
11549
+ gap: "6px",
11550
+ minWidth: "91px"
11534
11551
  },
11535
- children: [/* @__PURE__ */ jsx("button", {
11536
- onClick: () => setViewMode("board"),
11537
- style: {
11538
- padding: "6px 12px",
11539
- border: "none",
11540
- borderRadius: theme2.radii[1],
11541
- background: viewMode === "board" ? theme2.colors.primary : "transparent",
11542
- color: viewMode === "board" ? theme2.colors.textOnPrimary : theme2.colors.textSecondary,
11543
- fontSize: theme2.fontSizes[1],
11544
- fontWeight: theme2.fontWeights.medium,
11545
- cursor: "pointer",
11546
- transition: "all 0.2s ease",
11547
- display: "flex",
11548
- alignItems: "center",
11549
- gap: "6px"
11550
- },
11551
- children: "Board"
11552
- }), /* @__PURE__ */ jsx("button", {
11553
- onClick: () => setViewMode("milestones"),
11554
- style: {
11555
- padding: "6px 12px",
11556
- border: "none",
11557
- borderRadius: theme2.radii[1],
11558
- background: viewMode === "milestones" ? theme2.colors.primary : "transparent",
11559
- color: viewMode === "milestones" ? theme2.colors.textOnPrimary : theme2.colors.textSecondary,
11560
- fontSize: theme2.fontSizes[1],
11561
- fontWeight: theme2.fontWeights.medium,
11562
- cursor: "pointer",
11563
- transition: "all 0.2s ease",
11564
- display: "flex",
11565
- alignItems: "center",
11566
- gap: "6px"
11567
- },
11568
- children: "Milestones"
11569
- })]
11552
+ children: "Milestones"
11553
+ }), /* @__PURE__ */ jsx("button", {
11554
+ onClick: () => {
11555
+ setViewMode("board");
11556
+ setIsSearchVisible(false);
11557
+ setSearchQuery("");
11558
+ },
11559
+ style: {
11560
+ padding: "6px 12px",
11561
+ border: "none",
11562
+ borderRadius: theme2.radii[1],
11563
+ background: "transparent",
11564
+ color: viewMode === "board" ? theme2.colors.primary : theme2.colors.textSecondary,
11565
+ fontSize: theme2.fontSizes[2],
11566
+ fontWeight: theme2.fontWeights.medium,
11567
+ cursor: "pointer",
11568
+ transition: "all 0.2s ease",
11569
+ display: "flex",
11570
+ alignItems: "center",
11571
+ justifyContent: "center",
11572
+ gap: "6px",
11573
+ minWidth: "91px"
11574
+ },
11575
+ children: "Status"
11570
11576
  })]
11571
11577
  }), isBacklogProject && totalTasksState.total > 0 && /* @__PURE__ */ jsx("div", {
11572
11578
  style: {
11573
11579
  display: "flex",
11574
11580
  alignItems: "center",
11575
11581
  gap: "8px",
11576
- flexWrap: "wrap"
11582
+ flexWrap: "wrap",
11583
+ flex: 1,
11584
+ justifyContent: "flex-end"
11577
11585
  },
11578
11586
  children: viewMode === "board" ? /* @__PURE__ */ jsxs(Fragment, {
11579
- children: [/* @__PURE__ */ jsx("button", {
11587
+ children: [canWrite && /* @__PURE__ */ jsxs("button", {
11588
+ onClick: handleOpenNewTask,
11589
+ style: {
11590
+ display: "flex",
11591
+ alignItems: "center",
11592
+ gap: "6px",
11593
+ background: theme2.colors.primary,
11594
+ color: theme2.colors.textOnPrimary,
11595
+ border: "1px solid transparent",
11596
+ borderRadius: theme2.radii[2],
11597
+ padding: "6px 12px",
11598
+ fontSize: theme2.fontSizes[1],
11599
+ fontWeight: theme2.fontWeights.medium,
11600
+ cursor: "pointer",
11601
+ transition: "opacity 0.2s ease"
11602
+ },
11603
+ children: [/* @__PURE__ */ jsx(Plus, {
11604
+ size: 14
11605
+ }), "Add Task"]
11606
+ }), /* @__PURE__ */ jsx("button", {
11580
11607
  onClick: () => {
11581
11608
  const newVisible = !isSearchVisible;
11582
11609
  setIsSearchVisible(newVisible);
@@ -11588,27 +11615,28 @@ const KanbanPanel = ({
11588
11615
  display: "flex",
11589
11616
  alignItems: "center",
11590
11617
  justifyContent: "center",
11591
- background: isSearchVisible ? theme2.colors.primary : theme2.colors.backgroundSecondary,
11592
- color: isSearchVisible ? theme2.colors.textOnPrimary : theme2.colors.textSecondary,
11593
- border: isSearchVisible ? "none" : `1px solid ${theme2.colors.border}`,
11618
+ background: theme2.colors.backgroundSecondary,
11619
+ color: theme2.colors.textSecondary,
11620
+ border: `1px solid ${theme2.colors.border}`,
11594
11621
  borderRadius: theme2.radii[2],
11595
11622
  padding: "6px",
11596
- cursor: "pointer",
11597
- transition: "all 0.2s ease"
11623
+ cursor: "pointer"
11598
11624
  },
11599
11625
  title: isSearchVisible ? "Hide search" : "Search tasks",
11600
11626
  children: /* @__PURE__ */ jsx(Search, {
11601
11627
  size: 16
11602
11628
  })
11603
- }), canWrite && /* @__PURE__ */ jsxs("button", {
11604
- onClick: handleOpenNewTask,
11629
+ })]
11630
+ }) : /* @__PURE__ */ jsxs(Fragment, {
11631
+ children: [canWriteMilestones && /* @__PURE__ */ jsxs("button", {
11632
+ onClick: handleOpenNewMilestone,
11605
11633
  style: {
11606
11634
  display: "flex",
11607
11635
  alignItems: "center",
11608
11636
  gap: "6px",
11609
11637
  background: theme2.colors.primary,
11610
11638
  color: theme2.colors.textOnPrimary,
11611
- border: "none",
11639
+ border: "1px solid transparent",
11612
11640
  borderRadius: theme2.radii[2],
11613
11641
  padding: "6px 12px",
11614
11642
  fontSize: theme2.fontSizes[1],
@@ -11618,10 +11646,8 @@ const KanbanPanel = ({
11618
11646
  },
11619
11647
  children: [/* @__PURE__ */ jsx(Plus, {
11620
11648
  size: 14
11621
- }), "Add Task"]
11622
- })]
11623
- }) : /* @__PURE__ */ jsxs(Fragment, {
11624
- children: [canWrite && /* @__PURE__ */ jsxs("button", {
11649
+ }), "Add Milestone"]
11650
+ }), canWrite && /* @__PURE__ */ jsxs("button", {
11625
11651
  onClick: handleOpenNewTask,
11626
11652
  disabled: !selectedMilestoneId,
11627
11653
  title: selectedMilestoneId ? "Add task to milestone" : "Select a milestone first",
@@ -11631,7 +11657,7 @@ const KanbanPanel = ({
11631
11657
  gap: "6px",
11632
11658
  background: selectedMilestoneId ? theme2.colors.primary : theme2.colors.backgroundSecondary,
11633
11659
  color: selectedMilestoneId ? theme2.colors.textOnPrimary : theme2.colors.textMuted,
11634
- border: selectedMilestoneId ? "none" : `1px solid ${theme2.colors.border}`,
11660
+ border: `1px solid ${selectedMilestoneId ? "transparent" : theme2.colors.border}`,
11635
11661
  borderRadius: theme2.radii[2],
11636
11662
  padding: "6px 12px",
11637
11663
  fontSize: theme2.fontSizes[1],
@@ -11643,25 +11669,6 @@ const KanbanPanel = ({
11643
11669
  children: [/* @__PURE__ */ jsx(Plus, {
11644
11670
  size: 14
11645
11671
  }), "Add Task"]
11646
- }), canWriteMilestones && /* @__PURE__ */ jsxs("button", {
11647
- onClick: handleOpenNewMilestone,
11648
- style: {
11649
- display: "flex",
11650
- alignItems: "center",
11651
- gap: "6px",
11652
- background: theme2.colors.primary,
11653
- color: theme2.colors.textOnPrimary,
11654
- border: "none",
11655
- borderRadius: theme2.radii[2],
11656
- padding: "6px 12px",
11657
- fontSize: theme2.fontSizes[1],
11658
- fontWeight: theme2.fontWeights.medium,
11659
- cursor: "pointer",
11660
- transition: "opacity 0.2s ease"
11661
- },
11662
- children: [/* @__PURE__ */ jsx(Plus, {
11663
- size: 14
11664
- }), "Add Milestone"]
11665
11672
  }), /* @__PURE__ */ jsx("button", {
11666
11673
  onClick: handleRefreshMilestones,
11667
11674
  disabled: isRefreshingMilestones || isMilestonesLoading,
@@ -56322,6 +56329,7 @@ const StatusBadge = ({
56322
56329
  const TaskDetailPanel = ({
56323
56330
  context: context2,
56324
56331
  events: events2,
56332
+ actions,
56325
56333
  config
56326
56334
  }) => {
56327
56335
  var _a;
@@ -56405,21 +56413,61 @@ const TaskDetailPanel = ({
56405
56413
  span.end();
56406
56414
  setIsDeleteModalOpen(true);
56407
56415
  }, [selectedTask]);
56408
- const handleDeleteConfirm = useCallback(() => {
56409
- if (!events2 || !selectedTask) return;
56416
+ const handleDeleteConfirm = useCallback(async () => {
56417
+ if (!selectedTask) return;
56418
+ if (!(actions == null ? void 0 : actions.deleteTask)) {
56419
+ setDeleteState({
56420
+ status: "error",
56421
+ error: "Delete action not available"
56422
+ });
56423
+ return;
56424
+ }
56410
56425
  setDeleteState({
56411
56426
  status: "loading"
56412
56427
  });
56413
- events2.emit({
56414
- type: "task:delete-requested",
56415
- source: "task-detail-panel",
56416
- timestamp: Date.now(),
56417
- payload: {
56418
- taskId: selectedTask.id,
56419
- task: selectedTask
56420
- }
56421
- });
56422
- }, [events2, selectedTask]);
56428
+ try {
56429
+ await actions.deleteTask(selectedTask.id);
56430
+ const tracer = getTracer();
56431
+ const span = tracer.startSpan("task.mutation", {
56432
+ attributes: {
56433
+ "task.id": selectedTask.id
56434
+ }
56435
+ });
56436
+ span.addEvent("task.deleted", {
56437
+ "task.id": selectedTask.id
56438
+ });
56439
+ span.setStatus({
56440
+ code: SpanStatusCode.OK
56441
+ });
56442
+ span.end();
56443
+ setDeleteState({
56444
+ status: "success"
56445
+ });
56446
+ setIsDeleteModalOpen(false);
56447
+ setTimeout(() => {
56448
+ if (events2) {
56449
+ events2.emit({
56450
+ type: "task:deleted",
56451
+ source: "task-detail-panel",
56452
+ timestamp: Date.now(),
56453
+ payload: {
56454
+ taskId: selectedTask.id
56455
+ }
56456
+ });
56457
+ }
56458
+ setSelectedTask(null);
56459
+ setDeleteState({
56460
+ status: "idle"
56461
+ });
56462
+ }, 2e3);
56463
+ } catch (error) {
56464
+ const errorMessage = error instanceof Error ? error.message : "Failed to delete task";
56465
+ setDeleteState({
56466
+ status: "error",
56467
+ error: errorMessage
56468
+ });
56469
+ }
56470
+ }, [actions, selectedTask, events2]);
56423
56471
  useEffect(() => {
56424
56472
  if (!events2) return;
56425
56473
  const handleTaskSelected = (event) => {
@@ -56461,58 +56509,6 @@ const TaskDetailPanel = ({
56461
56509
  });
56462
56510
  };
56463
56511
  }, [events2, selectedTask == null ? void 0 : selectedTask.id]);
56464
- useEffect(() => {
56465
- if (!events2) return;
56466
- const unsubscribers = [events2.on("task:deleted:success", (event) => {
56467
- const payload = event.payload;
56468
- if (payload.taskId === (selectedTask == null ? void 0 : selectedTask.id)) {
56469
- const tracer = getTracer();
56470
- const span = tracer.startSpan("task.mutation", {
56471
- attributes: {
56472
- "task.id": payload.taskId
56473
- }
56474
- });
56475
- span.addEvent("task.deleted", {
56476
- "task.id": payload.taskId
56477
- });
56478
- span.setStatus({
56479
- code: SpanStatusCode.OK
56480
- });
56481
- span.end();
56482
- setDeleteState({
56483
- status: "success"
56484
- });
56485
- setIsDeleteModalOpen(false);
56486
- setTimeout(() => {
56487
- events2.emit({
56488
- type: "task:deleted",
56489
- source: "task-detail-panel",
56490
- timestamp: Date.now(),
56491
- payload: {
56492
- taskId: payload.taskId
56493
- }
56494
- });
56495
- setSelectedTask(null);
56496
- setDeleteState({
56497
- status: "idle"
56498
- });
56499
- }, 2e3);
56500
- }
56501
- }), events2.on("task:deleted:error", (event) => {
56502
- const payload = event.payload;
56503
- if (payload.taskId === (selectedTask == null ? void 0 : selectedTask.id)) {
56504
- setDeleteState({
56505
- status: "error",
56506
- error: payload.error
56507
- });
56508
- }
56509
- })];
56510
- return () => {
56511
- unsubscribers.forEach((unsub) => {
56512
- if (typeof unsub === "function") unsub();
56513
- });
56514
- };
56515
- }, [events2, selectedTask == null ? void 0 : selectedTask.id]);
56516
56512
  const handleBack = useCallback(() => {
56517
56513
  if (selectedTask) {
56518
56514
  const tracer = getTracer();