@nil-/doc 0.2.7 → 0.2.9
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/CHANGELOG.md +12 -0
- package/components/Layout.svelte +3 -2
- package/components/etc/Container.svelte +9 -11
- package/components/etc/action.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @nil-/doc
|
|
2
2
|
|
|
3
|
+
## 0.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5c10f11: [fix] layout fill height
|
|
8
|
+
|
|
9
|
+
## 0.2.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 865eef0: Adjusted Container to allow collapsing (based on primary/secondary and double clicking the divider)
|
|
14
|
+
|
|
3
15
|
## 0.2.7
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/components/Layout.svelte
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
@import "../styles/reset.css";
|
|
3
3
|
@import "../styles/scrollable.css";
|
|
4
4
|
|
|
5
|
-
.
|
|
5
|
+
.layout {
|
|
6
6
|
width: 100%;
|
|
7
|
+
height: 100%;
|
|
7
8
|
color: rgb(201, 205, 207);
|
|
8
9
|
background-color: rgb(34, 36, 37);
|
|
9
10
|
font-family: "Fira Code", "Courier New", Courier, monospace;
|
|
@@ -26,7 +27,7 @@ export let sorter = null;
|
|
|
26
27
|
export let renamer = null;
|
|
27
28
|
const r = inRoot();
|
|
28
29
|
</script>
|
|
29
|
-
<div class="
|
|
30
|
+
<div class="layout" class:nil-doc-reset={r}>
|
|
30
31
|
<Container offset={250} padding={250} vertical>
|
|
31
32
|
<svelte:fragment slot="a">
|
|
32
33
|
<Nav
|
|
@@ -40,6 +40,7 @@ export let thickness = 10;
|
|
|
40
40
|
export let padding = 0;
|
|
41
41
|
let width;
|
|
42
42
|
let height;
|
|
43
|
+
let collapse = false;
|
|
43
44
|
const { position, draggable } = createDraggable(offset);
|
|
44
45
|
function update(w, h, limit, value) {
|
|
45
46
|
if (w == null || h == null) {
|
|
@@ -49,7 +50,7 @@ function update(w, h, limit, value) {
|
|
|
49
50
|
offset = Math.max(Math.min(value, span - limit), limit);
|
|
50
51
|
}
|
|
51
52
|
$: update(width, height, padding, $position);
|
|
52
|
-
$: offsetpx = `${offset}px`;
|
|
53
|
+
$: offsetpx = collapse ? "10px" : `${offset}px`;
|
|
53
54
|
$: thicknesspx = `${thickness}px`;
|
|
54
55
|
</script>
|
|
55
56
|
<div
|
|
@@ -62,14 +63,12 @@ $: thicknesspx = `${thickness}px`;
|
|
|
62
63
|
<div
|
|
63
64
|
class:primary={!reversed}
|
|
64
65
|
class:secondary={reversed}
|
|
65
|
-
style:min-height={!vertical ? `${padding}px` : null}
|
|
66
|
-
style:max-height={!vertical ? `${height - padding}px` : null}
|
|
67
|
-
style:min-width={vertical ? `${padding}px` : null}
|
|
68
|
-
style:max-width={vertical ? `${width - padding}px` : null}
|
|
69
66
|
style:width={!reversed && vertical ? offsetpx : null}
|
|
70
67
|
style:height={!reversed && !vertical ? offsetpx : null}
|
|
71
68
|
>
|
|
72
|
-
|
|
69
|
+
{#if !collapse || reversed}
|
|
70
|
+
<slot name="a" />
|
|
71
|
+
{/if}
|
|
73
72
|
</div>
|
|
74
73
|
<div
|
|
75
74
|
class="divider"
|
|
@@ -83,19 +82,18 @@ $: thicknesspx = `${thickness}px`;
|
|
|
83
82
|
style:cursor={vertical ? "col-resize" : "row-resize"}
|
|
84
83
|
style:transform={vertical ? "translateX(-50%)" : "translateY(-50%)"}
|
|
85
84
|
use:draggable={{ reset: () => offset, reversed, vertical }}
|
|
85
|
+
on:dblclick={() => (collapse = !collapse)}
|
|
86
86
|
/>
|
|
87
87
|
</div>
|
|
88
88
|
<div
|
|
89
89
|
class:primary={reversed}
|
|
90
90
|
class:secondary={!reversed}
|
|
91
|
-
style:min-height={!vertical ? `${padding}px` : null}
|
|
92
|
-
style:max-height={!vertical ? `${height - padding}px` : null}
|
|
93
|
-
style:min-width={vertical ? `${padding}px` : null}
|
|
94
|
-
style:max-width={vertical ? `${width - padding}px` : null}
|
|
95
91
|
style:width={reversed && vertical ? offsetpx : null}
|
|
96
92
|
style:height={reversed && !vertical ? offsetpx : null}
|
|
97
93
|
>
|
|
98
|
-
|
|
94
|
+
{#if !collapse || !reversed}
|
|
95
|
+
<slot name="b" />
|
|
96
|
+
{/if}
|
|
99
97
|
</div>
|
|
100
98
|
{/if}
|
|
101
99
|
</div>
|
package/components/etc/action.js
CHANGED
|
@@ -24,6 +24,7 @@ export const createDraggable = (offset) => {
|
|
|
24
24
|
div.addEventListener("mousedown", engage);
|
|
25
25
|
document.addEventListener("mouseup", disengage);
|
|
26
26
|
document.addEventListener("mousemove", move);
|
|
27
|
+
document.addEventListener("dblclick", disengage);
|
|
27
28
|
return {
|
|
28
29
|
update: (parameter) => {
|
|
29
30
|
if (param.reversed !== parameter.reversed ||
|
|
@@ -31,12 +32,12 @@ export const createDraggable = (offset) => {
|
|
|
31
32
|
moving = false;
|
|
32
33
|
}
|
|
33
34
|
param = parameter;
|
|
34
|
-
position.set(param.reset());
|
|
35
35
|
},
|
|
36
36
|
destroy: () => {
|
|
37
37
|
div.removeEventListener("mousedown", engage);
|
|
38
38
|
document.removeEventListener("mouseup", disengage);
|
|
39
39
|
document.removeEventListener("mousemove", move);
|
|
40
|
+
document.removeEventListener("dblclick", disengage);
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
}
|