horizon-layout 1.0.0 → 1.0.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/HorizonLayout.svelte +20 -18
- package/package.json +57 -58
|
@@ -300,9 +300,17 @@
|
|
|
300
300
|
// If it changes during a drag operation, the drag is cancelled
|
|
301
301
|
// and the new config is applied immediately.
|
|
302
302
|
$effect(() => {
|
|
303
|
-
|
|
303
|
+
// Validation-time inputs are read on every run
|
|
304
|
+
// so that changing them revalidates the config.
|
|
305
|
+
void minWidthRatio;
|
|
306
|
+
void minHeightRatio;
|
|
307
|
+
void skipValidation;
|
|
308
|
+
void views;
|
|
304
309
|
|
|
305
|
-
|
|
310
|
+
const external = $state.snapshot(config);
|
|
311
|
+
const internal = untrack(() => internalConfig && $state.snapshot(internalConfig));
|
|
312
|
+
|
|
313
|
+
if (internal && areConfigsEquivalent(internal, external)) {
|
|
306
314
|
return;
|
|
307
315
|
}
|
|
308
316
|
|
|
@@ -310,19 +318,16 @@
|
|
|
310
318
|
dragData = null;
|
|
311
319
|
}
|
|
312
320
|
|
|
313
|
-
internalConfig = createInternalConfig(
|
|
321
|
+
internalConfig = createInternalConfig(external);
|
|
314
322
|
});
|
|
315
323
|
|
|
316
324
|
// Propagate internalConfig changes → external config binding.
|
|
317
325
|
// Skipped while a drag is in progress to avoid propagating temporary intermediate states.
|
|
318
326
|
$effect(() => {
|
|
319
327
|
if (dragData || !internalConfig) return;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
untrack(() => config)
|
|
324
|
-
)
|
|
325
|
-
) {
|
|
328
|
+
|
|
329
|
+
const external = untrack(() => $state.snapshot(config));
|
|
330
|
+
if (!areConfigsEquivalent(internalConfig, external)) {
|
|
326
331
|
config = cloneConfig(internalConfig);
|
|
327
332
|
}
|
|
328
333
|
});
|
|
@@ -406,11 +411,11 @@
|
|
|
406
411
|
const directionAxis = direction === 'left' || direction === 'right' ? 'horizontal' : 'vertical';
|
|
407
412
|
const isDirectionLeftOrUp = direction === 'left' || direction === 'up';
|
|
408
413
|
|
|
409
|
-
const edgeTabGroup = (root: NodeConfig
|
|
414
|
+
const edgeTabGroup = (root: NodeConfig): TabGroupConfig => {
|
|
410
415
|
if (nodeConfigType(root) === 'tabGroup') return root as TabGroupConfig;
|
|
411
416
|
const split = root as SplitConfig;
|
|
412
417
|
const index = isDirectionLeftOrUp ? split.views.length - 1 : 0;
|
|
413
|
-
return edgeTabGroup(split.views[index]
|
|
418
|
+
return edgeTabGroup(split.views[index]!);
|
|
414
419
|
};
|
|
415
420
|
|
|
416
421
|
const findClosestTabGroupAndMoveTab = (child: NodeConfig) => {
|
|
@@ -427,10 +432,7 @@
|
|
|
427
432
|
return findClosestTabGroupAndMoveTab(parentData.parent);
|
|
428
433
|
}
|
|
429
434
|
|
|
430
|
-
moveActiveTabToTabGroup(
|
|
431
|
-
tabGroup,
|
|
432
|
-
edgeTabGroup(parentData.parent.views[targetIndex]!, direction)
|
|
433
|
-
);
|
|
435
|
+
moveActiveTabToTabGroup(tabGroup, edgeTabGroup(parentData.parent.views[targetIndex]!));
|
|
434
436
|
};
|
|
435
437
|
|
|
436
438
|
findClosestTabGroupAndMoveTab(tabGroup);
|
|
@@ -629,7 +631,7 @@
|
|
|
629
631
|
const wanted = new Set(internalConfig.popouts ?? []);
|
|
630
632
|
|
|
631
633
|
// Close any popouts that are no longer in the config.
|
|
632
|
-
for (const id of
|
|
634
|
+
for (const id of popouts.keys()) {
|
|
633
635
|
if (!wanted.has(id)) cleanupPopout(id, true);
|
|
634
636
|
}
|
|
635
637
|
|
|
@@ -651,14 +653,14 @@
|
|
|
651
653
|
|
|
652
654
|
// Close all popout windows when the base window closes or the component is unmounted.
|
|
653
655
|
function closeAllPopouts() {
|
|
654
|
-
for (const id of
|
|
656
|
+
for (const id of popouts.keys()) {
|
|
655
657
|
cleanupPopout(id, true);
|
|
656
658
|
}
|
|
657
659
|
}
|
|
658
660
|
|
|
659
661
|
function retryPendingPopouts() {
|
|
660
662
|
const now = Date.now();
|
|
661
|
-
for (const [id, since] of
|
|
663
|
+
for (const [id, since] of pendingPopouts.entries()) {
|
|
662
664
|
if (now - since >= POPOUT_BLOCKED_TIMEOUT_MS) {
|
|
663
665
|
pendingPopouts.delete(id);
|
|
664
666
|
handleBlockedPopout(id);
|
package/package.json
CHANGED
|
@@ -1,59 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
2
|
+
"name": "horizon-layout",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"svelte"
|
|
6
|
+
],
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/play-horizon/horizon-layout"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"!dist/**/*.test.*",
|
|
15
|
+
"!dist/**/*.spec.*"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"**/*.css"
|
|
20
|
+
],
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"svelte": "./dist/index.js",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"svelte": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./horizon-layout.css": "./dist/horizon-layout.css"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"dev": "vite dev",
|
|
32
|
+
"build": "vite build && npm run prepack",
|
|
33
|
+
"preview": "vite preview",
|
|
34
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
35
|
+
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
36
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
37
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
38
|
+
"lint": "oxlint . && oxfmt --check .",
|
|
39
|
+
"format": "oxfmt ."
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@sveltejs/adapter-auto": "^7.0.1",
|
|
43
|
+
"@sveltejs/kit": "^2.70.3",
|
|
44
|
+
"@sveltejs/package": "^2.5.8",
|
|
45
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
46
|
+
"@types/node": "^26.6.2",
|
|
47
|
+
"oxfmt": "^0.68.0",
|
|
48
|
+
"oxlint": "^1.83.0",
|
|
49
|
+
"publint": "^0.3.24",
|
|
50
|
+
"svelte": "^5.57.1",
|
|
51
|
+
"svelte-check": "^4.7.6",
|
|
52
|
+
"typescript": "^6.0.3",
|
|
53
|
+
"vite": "^8.3.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"svelte": "^5.0.0"
|
|
57
|
+
}
|
|
58
|
+
}
|