@esportsplus/ui 0.64.1 → 0.64.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.
@@ -262,8 +262,13 @@ const shell = component(function ({ catalog, empty, icons = false, narrow: break
262
262
  landing = group ? () => state.move(surface.id, group, to) : null;
263
263
  },
264
264
  outside: {
265
- ondrop: (surface, element) => {
266
- landing = () => drop(surface, element);
265
+ ondrop: (surface, element, from, source) => {
266
+ landing = () => {
267
+ drop(surface, element);
268
+ if (findSurfaceGroup(state.layout.root, surface.id)?.id === strips.get(source)) {
269
+ source.splice(from, 0, surface);
270
+ }
271
+ };
267
272
  },
268
273
  over: (_, x, y) => workspace ? target(workspace, x, y) : null
269
274
  }
package/package.json CHANGED
@@ -54,7 +54,7 @@
54
54
  "**/*.scss"
55
55
  ],
56
56
  "type": "module",
57
- "version": "0.64.1",
57
+ "version": "0.64.2",
58
58
  "scripts": {
59
59
  "build": "run-s build:vite build:ts",
60
60
  "build:ts": "tsc",
@@ -340,8 +340,17 @@ const shell = component(
340
340
  landing = group ? () => state.move(surface.id, group, to) : null;
341
341
  },
342
342
  outside: {
343
- ondrop: (surface, element) => {
344
- landing = () => drop(surface, element);
343
+ // The strip lets the tab go as it is dropped, before the layout takes it. A drop the layout
344
+ // turns down, such as a group's only tab onto its own edge, changes nothing, so the group isn't
345
+ // rebuilt; the tab goes back where it was in its strip.
346
+ ondrop: (surface, element, from, source) => {
347
+ landing = () => {
348
+ drop(surface, element);
349
+
350
+ if (findSurfaceGroup(state.layout.root, surface.id)?.id === strips.get(source)) {
351
+ source.splice(from, 0, surface);
352
+ }
353
+ };
345
354
  },
346
355
  over: (_, x, y) => workspace ? target(workspace, x, y) : null
347
356
  }