react-os-shell 0.12.2 → 0.13.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.
package/dist/index.js CHANGED
@@ -1481,7 +1481,7 @@ function WidgetManager({ open, onClose }) {
1481
1481
  }
1482
1482
 
1483
1483
  // src/version.ts
1484
- var VERSION = "0.12.2" ;
1484
+ var VERSION = "0.13.0" ;
1485
1485
  var APP_VERSION = VERSION;
1486
1486
 
1487
1487
  // src/changelog.ts
@@ -6375,6 +6375,46 @@ function Kanban({
6375
6375
  setDragId(null);
6376
6376
  setOver(null);
6377
6377
  };
6378
+ const boardRef = useRef(null);
6379
+ const prevRects = useRef(/* @__PURE__ */ new Map());
6380
+ useLayoutEffect(() => {
6381
+ if (dragId !== null) return;
6382
+ const board = boardRef.current;
6383
+ if (!board) return;
6384
+ const next = /* @__PURE__ */ new Map();
6385
+ const moved = [];
6386
+ board.querySelectorAll("[data-kanban-card]").forEach((el) => {
6387
+ const id = el.dataset.kanbanCard;
6388
+ const rect = el.getBoundingClientRect();
6389
+ next.set(id, rect);
6390
+ const prev = prevRects.current.get(id);
6391
+ if (prev) {
6392
+ const dx = prev.left - rect.left;
6393
+ const dy = prev.top - rect.top;
6394
+ if (dx || dy) moved.push([el, dx, dy]);
6395
+ }
6396
+ });
6397
+ prevRects.current = next;
6398
+ if (!moved.length) return;
6399
+ for (const [el, dx, dy] of moved) {
6400
+ el.style.transition = "none";
6401
+ el.style.transform = `translate(${dx}px, ${dy}px)`;
6402
+ }
6403
+ requestAnimationFrame(() => {
6404
+ for (const [el] of moved) {
6405
+ el.style.transition = "transform 200ms cubic-bezier(0.2, 0, 0, 1)";
6406
+ el.style.transform = "";
6407
+ el.addEventListener(
6408
+ "transitionend",
6409
+ () => {
6410
+ el.style.transition = "";
6411
+ el.style.transform = "";
6412
+ },
6413
+ { once: true }
6414
+ );
6415
+ }
6416
+ });
6417
+ }, [grouped, dragId]);
6378
6418
  const commitMove = (col) => {
6379
6419
  if (dragId && over && over.col === col) {
6380
6420
  const colItems = grouped[col] ?? [];
@@ -6392,7 +6432,7 @@ function Kanban({
6392
6432
  if (items.length === 0) {
6393
6433
  return /* @__PURE__ */ jsx(Fragment, { children: emptyState ?? /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-500 p-4", children: "No items." }) });
6394
6434
  }
6395
- return /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-x-auto grid-scroll", children: /* @__PURE__ */ jsx("div", { className: "flex gap-3 h-full min-w-max pb-2", children: columns.map((col) => {
6435
+ return /* @__PURE__ */ jsx("div", { ref: boardRef, className: "flex-1 overflow-x-auto grid-scroll", children: /* @__PURE__ */ jsx("div", { className: "flex gap-3 h-full min-w-max pb-2", children: columns.map((col) => {
6396
6436
  const colItems = grouped[col.value] ?? [];
6397
6437
  const isOver = over !== null && over.col === col.value;
6398
6438
  const dp = dragId !== null ? colItems.findIndex((it) => getId(it) === dragId) : -1;
@@ -6433,6 +6473,7 @@ function Kanban({
6433
6473
  /* @__PURE__ */ jsx(
6434
6474
  "div",
6435
6475
  {
6476
+ "data-kanban-card": id,
6436
6477
  draggable: true,
6437
6478
  onDragStart: (e) => {
6438
6479
  setDragId(id);