@nil-/doc 0.2.49 → 0.2.51
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 +21 -0
- package/components/Layout.svelte +72 -109
- package/components/Layout.svelte.d.ts +1 -0
- package/components/block/Block.svelte +84 -41
- package/components/block/Controls.svelte +4 -6
- package/components/block/Controls.svelte.d.ts +2 -2
- package/components/block/Instance.svelte +79 -111
- package/components/block/Params.svelte +1 -1
- package/components/block/Template.svelte +2 -1
- package/components/block/context.d.ts +2 -2
- package/components/block/context.js +2 -1
- package/components/block/controls/events/Events.svelte +23 -14
- package/components/block/controls/events/misc/Styler.svelte +34 -60
- package/components/block/controls/props/Color.svelte +21 -0
- package/components/block/controls/props/Color.svelte.d.ts +21 -0
- package/components/block/controls/props/Component.svelte +6 -1
- package/components/block/controls/props/Number.svelte +5 -6
- package/components/block/controls/props/Object.svelte +10 -12
- package/components/block/controls/props/Props.svelte +3 -6
- package/components/block/controls/props/Range.svelte +38 -37
- package/components/block/controls/props/Select.svelte +11 -14
- package/components/block/controls/props/Switch.svelte +5 -6
- package/components/block/controls/props/Text.svelte +9 -10
- package/components/block/controls/props/Tuple.svelte +15 -27
- package/components/block/controls/props/misc/GroupHeader.svelte +6 -6
- package/components/block/controls/props/misc/Name.svelte +15 -16
- package/components/block/controls/props/misc/Styler.svelte +42 -50
- package/components/block/controls/props/misc/defaulter.d.ts +8 -8
- package/components/block/controls/props/misc/defaulter.js +28 -48
- package/components/block/controls/props/misc/utils.d.ts +11 -0
- package/components/block/controls/props/misc/utils.js +31 -0
- package/components/block/controls/types.d.ts +10 -2
- package/components/block/icons/Button.svelte +30 -0
- package/components/block/icons/Button.svelte.d.ts +35 -0
- package/components/block/icons/ControlView.svelte +14 -0
- package/components/block/icons/ControlView.svelte.d.ts +16 -0
- package/components/block/icons/Position.svelte +50 -0
- package/components/block/icons/Position.svelte.d.ts +16 -0
- package/components/etc/Base.svelte +58 -0
- package/components/etc/Base.svelte.d.ts +18 -0
- package/components/etc/Container.svelte +96 -109
- package/components/etc/Content.svelte +45 -0
- package/components/etc/Content.svelte.d.ts +18 -0
- package/components/{etc/NilIcon.svelte → icons/NilDoc.svelte} +17 -16
- package/components/icons/NilDoc.svelte.d.ts +14 -0
- package/components/{etc/ThemeIcon.svelte → icons/Theme.svelte} +29 -31
- package/components/icons/Theme.svelte.d.ts +17 -0
- package/components/navigation/Nav.svelte +27 -30
- package/components/navigation/Node.svelte +46 -47
- package/components/navigation/Tree.svelte +1 -1
- package/components/title/Icon.svelte +19 -0
- package/components/title/Icon.svelte.d.ts +21 -0
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/package.json +1 -1
- package/components/etc/NilIcon.svelte.d.ts +0 -14
- package/components/etc/ThemeIcon.svelte.d.ts +0 -16
|
@@ -1,107 +1,6 @@
|
|
|
1
|
-
<style>
|
|
2
|
-
div {
|
|
3
|
-
box-sizing: border-box;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.container {
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100%;
|
|
9
|
-
display: grid;
|
|
10
|
-
grid-template-areas:
|
|
11
|
-
"A"
|
|
12
|
-
"divider"
|
|
13
|
-
"B";
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.container.vertical {
|
|
18
|
-
grid-template-areas: "A divider B";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.container > div {
|
|
22
|
-
width: 100%;
|
|
23
|
-
height: 100%;
|
|
24
|
-
overflow: hidden;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.container > .divider {
|
|
28
|
-
z-index: 10;
|
|
29
|
-
overflow: visible;
|
|
30
|
-
user-select: none;
|
|
31
|
-
grid-area: divider;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.overlay {
|
|
35
|
-
touch-action: none;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.container > .divider > .overlay {
|
|
39
|
-
width: 100%;
|
|
40
|
-
height: 20px;
|
|
41
|
-
cursor: ns-resize;
|
|
42
|
-
transform: translateY(-50%);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.container.vertical > .divider > .overlay {
|
|
46
|
-
width: 20px;
|
|
47
|
-
height: 100%;
|
|
48
|
-
cursor: ew-resize;
|
|
49
|
-
transform: translateX(-50%);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/* colors */
|
|
53
|
-
.container {
|
|
54
|
-
--color-p: hsl(0, 2%, 70%);
|
|
55
|
-
--color-s: hsl(0, 0%, 0%);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.container.dark {
|
|
59
|
-
--color-p: hsl(0, 2%, 40%);
|
|
60
|
-
--color-s: hsl(0, 0%, 100%);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.divider {
|
|
64
|
-
transition: border-color 350ms, background-color 350ms;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.container:not(.vertical) > .divider {
|
|
68
|
-
border-bottom: var(--color-p) solid 2.5px;
|
|
69
|
-
border-top: var(--color-p) solid 2.5px;
|
|
70
|
-
background-color: var(--color-p);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.container.vertical > .divider {
|
|
74
|
-
border-right: var(--color-p) solid 2.5px;
|
|
75
|
-
border-left: var(--color-p) solid 2.5px;
|
|
76
|
-
background-color: var(--color-p);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.container:not(.b):not(.vertical) > .divider:hover,
|
|
80
|
-
.container.moving:not(.b):not(.vertical) > .divider {
|
|
81
|
-
border-bottom: var(--color-s) solid 2.5px;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.container.b:not(.vertical) > .divider:hover,
|
|
85
|
-
.container.moving.b:not(.vertical) > .divider {
|
|
86
|
-
border-top: var(--color-s) solid 2.5px;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.container:not(.b).vertical > .divider:hover,
|
|
90
|
-
.container.moving:not(.b).vertical > .divider {
|
|
91
|
-
border-right: var(--color-s) solid 2.5px;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.container.vertical.b > .divider:hover,
|
|
95
|
-
.container.moving.vertical.b > .divider {
|
|
96
|
-
border-left: var(--color-s) solid 2.5px;
|
|
97
|
-
}
|
|
98
|
-
</style>
|
|
99
|
-
|
|
100
1
|
<script>import { writable } from "svelte/store";
|
|
101
2
|
import { tweened } from "svelte/motion";
|
|
102
3
|
import { createDraggable } from "./action";
|
|
103
|
-
import { getTheme } from "../context";
|
|
104
|
-
const dark = getTheme();
|
|
105
4
|
export let vertical = false;
|
|
106
5
|
export let offset = 0;
|
|
107
6
|
export let b = false;
|
|
@@ -117,16 +16,17 @@ const update = (limit, value) => {
|
|
|
117
16
|
offset = Math.max(Math.min(value, span - limit), limit);
|
|
118
17
|
};
|
|
119
18
|
const off = tweened(offset, { duration: 50 });
|
|
19
|
+
const min = 4;
|
|
120
20
|
let last = [];
|
|
121
21
|
$:
|
|
122
|
-
update(
|
|
22
|
+
update(min, $position);
|
|
123
23
|
$:
|
|
124
24
|
$off = offset;
|
|
125
25
|
$:
|
|
126
|
-
style = !b ? `auto
|
|
26
|
+
style = !b ? `auto 0.2rem ${$off}px` : `${$off}px 0.2rem auto`;
|
|
127
27
|
const moving = writable(false);
|
|
128
28
|
const addLast = (v) => {
|
|
129
|
-
if (v >
|
|
29
|
+
if (v > min) {
|
|
130
30
|
if (last.length < 2) {
|
|
131
31
|
last = [...last, v];
|
|
132
32
|
} else {
|
|
@@ -135,26 +35,26 @@ const addLast = (v) => {
|
|
|
135
35
|
}
|
|
136
36
|
};
|
|
137
37
|
const dbltap = () => {
|
|
138
|
-
if ($off >
|
|
38
|
+
if ($off > min) {
|
|
139
39
|
addLast(offset);
|
|
140
|
-
offset =
|
|
40
|
+
offset = min;
|
|
141
41
|
} else if (last.length > 0) {
|
|
142
42
|
offset = last.pop();
|
|
143
43
|
}
|
|
144
44
|
};
|
|
145
45
|
const check = (v, flag, s) => {
|
|
146
46
|
if (flag) {
|
|
147
|
-
return v < s -
|
|
47
|
+
return v < s - min;
|
|
148
48
|
} else {
|
|
149
|
-
return v >
|
|
49
|
+
return v > min;
|
|
150
50
|
}
|
|
151
51
|
};
|
|
152
52
|
</script>
|
|
53
|
+
|
|
153
54
|
<div
|
|
154
55
|
class="container"
|
|
155
56
|
class:vertical
|
|
156
57
|
class:b
|
|
157
|
-
class:dark={$dark}
|
|
158
58
|
class:moving={$moving}
|
|
159
59
|
bind:clientWidth={width}
|
|
160
60
|
bind:clientHeight={height}
|
|
@@ -170,6 +70,7 @@ const check = (v, flag, s) => {
|
|
|
170
70
|
<div class="divider">
|
|
171
71
|
<div
|
|
172
72
|
class="overlay"
|
|
73
|
+
title={`Collapse ${vertical ? (b ? "left" : "right"): (b ? "top" : "bottom")}`}
|
|
173
74
|
use:draggable={{
|
|
174
75
|
reset: () => offset,
|
|
175
76
|
reversed: !b,
|
|
@@ -188,3 +89,89 @@ const check = (v, flag, s) => {
|
|
|
188
89
|
{/if}
|
|
189
90
|
</div>
|
|
190
91
|
|
|
92
|
+
<style>
|
|
93
|
+
.container {
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
display: grid;
|
|
97
|
+
grid-template-areas:
|
|
98
|
+
"A"
|
|
99
|
+
"divider"
|
|
100
|
+
"B";
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.container.vertical {
|
|
105
|
+
grid-template-areas: "A divider B";
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.container > div {
|
|
109
|
+
width: 100%;
|
|
110
|
+
height: 100%;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.container > .divider {
|
|
115
|
+
z-index: 10;
|
|
116
|
+
overflow: visible;
|
|
117
|
+
user-select: none;
|
|
118
|
+
grid-area: divider;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.overlay {
|
|
122
|
+
touch-action: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.container > .divider > .overlay {
|
|
126
|
+
width: 100%;
|
|
127
|
+
height: 1.5rem;
|
|
128
|
+
cursor: ns-resize;
|
|
129
|
+
transform: translateY(-50%);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.container.vertical > .divider > .overlay {
|
|
133
|
+
width: 1.5rem;
|
|
134
|
+
height: 100%;
|
|
135
|
+
cursor: ew-resize;
|
|
136
|
+
transform: translateX(-50%);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* colors */
|
|
140
|
+
.divider {
|
|
141
|
+
transition: border-color var(--i-nil-doc-transition-time),
|
|
142
|
+
background-color var(--i-nil-doc-transition-time);
|
|
143
|
+
--width: 0.0625rem;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.container:not(.vertical) > .divider {
|
|
147
|
+
border-bottom: var(--i-nil-doc-container-p) solid var(--width);
|
|
148
|
+
border-top: var(--i-nil-doc-container-p) solid var(--width);
|
|
149
|
+
background-color: var(--i-nil-doc-container-p);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.container.vertical > .divider {
|
|
153
|
+
border-right: var(--i-nil-doc-container-p) solid var(--width);
|
|
154
|
+
border-left: var(--i-nil-doc-container-p) solid var(--width);
|
|
155
|
+
background-color: var(--i-nil-doc-container-p);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.container:not(.b):not(.vertical) > .divider:hover,
|
|
159
|
+
.container.moving:not(.b):not(.vertical) > .divider {
|
|
160
|
+
border-bottom: var(--i-nil-doc-container-s) solid var(--width);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.container.b:not(.vertical) > .divider:hover,
|
|
164
|
+
.container.moving.b:not(.vertical) > .divider {
|
|
165
|
+
border-top: var(--i-nil-doc-container-s) solid var(--width);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.container:not(.b).vertical > .divider:hover,
|
|
169
|
+
.container.moving:not(.b).vertical > .divider {
|
|
170
|
+
border-right: var(--i-nil-doc-container-s) solid var(--width);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.container.vertical.b > .divider:hover,
|
|
174
|
+
.container.moving.vertical.b > .divider {
|
|
175
|
+
border-left: var(--i-nil-doc-container-s) solid var(--width);
|
|
176
|
+
}
|
|
177
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script>export let flat = false;
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<div class="scrollable">
|
|
5
|
+
{#if flat}
|
|
6
|
+
<slot />
|
|
7
|
+
{:else}
|
|
8
|
+
<div class="wrapper">
|
|
9
|
+
<slot />
|
|
10
|
+
</div>
|
|
11
|
+
{/if}
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<style>
|
|
15
|
+
.wrapper {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
margin: 0.5rem;
|
|
19
|
+
padding: 0.5rem;
|
|
20
|
+
border-radius: 0.5rem;
|
|
21
|
+
min-width: calc(100% - 1rem);
|
|
22
|
+
min-height: calc(100% - 1rem);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* scrollable */
|
|
26
|
+
.scrollable {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
overflow: scroll;
|
|
30
|
+
/* Firefox */
|
|
31
|
+
scrollbar-width: none;
|
|
32
|
+
/* IE and Edge */
|
|
33
|
+
-ms-overflow-style: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.scrollable::-webkit-scrollbar {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* color */
|
|
41
|
+
.wrapper {
|
|
42
|
+
border: solid 1px var(--i-nil-doc-content-outline-color);
|
|
43
|
+
box-shadow: 0px 0px 5px 0px var(--i-nil-doc-content-outline-color);
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
flat?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {
|
|
10
|
+
default: {};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type ContentProps = typeof __propDef.props;
|
|
14
|
+
export type ContentEvents = typeof __propDef.events;
|
|
15
|
+
export type ContentSlots = typeof __propDef.slots;
|
|
16
|
+
export default class Content extends SvelteComponentTyped<ContentProps, ContentEvents, ContentSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
<script context="module">const action = (p, length) => {
|
|
2
|
+
const update = (length2) => p.style.strokeDasharray = `${length2} 100`;
|
|
3
|
+
update(length);
|
|
4
|
+
return { update };
|
|
5
|
+
};
|
|
6
|
+
</script>
|
|
7
|
+
|
|
1
8
|
<script>import { tweened } from "svelte/motion";
|
|
2
9
|
const d = "M 0 -15 L 15 -15 L 15 0 L 0 0 -9 0 A 6 8 135 0 1 9 0";
|
|
3
10
|
const length = tweened(100);
|
|
@@ -11,23 +18,7 @@ const trigger = () => {
|
|
|
11
18
|
$:
|
|
12
19
|
0 === $length && trigger();
|
|
13
20
|
</script>
|
|
14
|
-
<style>
|
|
15
|
-
svg {
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
stroke-width: 4;
|
|
19
|
-
stroke-linejoin: miter;
|
|
20
|
-
stroke: currentColor;
|
|
21
|
-
fill: transparent;
|
|
22
|
-
}
|
|
23
|
-
</style>
|
|
24
21
|
|
|
25
|
-
<script context="module">const action = (p, length) => {
|
|
26
|
-
const update = (length2) => p.style.strokeDasharray = `${length2} 100`;
|
|
27
|
-
update(length);
|
|
28
|
-
return { update };
|
|
29
|
-
};
|
|
30
|
-
</script>
|
|
31
22
|
<svg viewBox="-35 -35 70 70" on:pointerenter={trigger}>
|
|
32
23
|
<g transform="rotate(45 0 0)">
|
|
33
24
|
<path {d} use:action={$length} />
|
|
@@ -37,3 +28,13 @@ $:
|
|
|
37
28
|
</g>
|
|
38
29
|
</svg>
|
|
39
30
|
|
|
31
|
+
<style>
|
|
32
|
+
svg {
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
stroke-width: 3;
|
|
36
|
+
stroke-linejoin: miter;
|
|
37
|
+
stroke: currentColor;
|
|
38
|
+
fill: transparent;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type NilDocProps = typeof __propDef.props;
|
|
10
|
+
export type NilDocEvents = typeof __propDef.events;
|
|
11
|
+
export type NilDocSlots = typeof __propDef.slots;
|
|
12
|
+
export default class NilDoc extends SvelteComponentTyped<NilDocProps, NilDocEvents, NilDocSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
<script>import { tweened } from "svelte/motion";
|
|
2
|
-
export let dark = true;
|
|
3
|
-
const values = tweened(dark ? vdark : vlight);
|
|
4
|
-
$:
|
|
5
|
-
$values = dark ? vdark : vlight;
|
|
6
|
-
const index = indexer++;
|
|
7
|
-
</script>
|
|
8
|
-
<style>
|
|
9
|
-
svg {
|
|
10
|
-
fill: currentColor;
|
|
11
|
-
stroke: currentColor;
|
|
12
|
-
|
|
13
|
-
-webkit-tap-highlight-color: transparent;
|
|
14
|
-
-moz-tap-highlight-color: transparent;
|
|
15
|
-
-o-tap-highlight-color: transparent;
|
|
16
|
-
/* tap-highlight-color: transparent; */
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
svg,
|
|
20
|
-
rect {
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 100%;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
line {
|
|
26
|
-
stroke-width: 2;
|
|
27
|
-
stroke-linecap: round;
|
|
28
|
-
stroke-linejoin: round;
|
|
29
|
-
}
|
|
30
|
-
</style>
|
|
31
|
-
|
|
32
1
|
<script context="module">let indexer = 0;
|
|
33
2
|
const vlight = {
|
|
34
3
|
rotate: 40,
|
|
@@ -43,6 +12,17 @@ const vdark = {
|
|
|
43
12
|
v: 1
|
|
44
13
|
};
|
|
45
14
|
</script>
|
|
15
|
+
|
|
16
|
+
<script>import { tweened } from "svelte/motion";
|
|
17
|
+
export let theme = "dark";
|
|
18
|
+
$:
|
|
19
|
+
dark = theme === "dark";
|
|
20
|
+
const values = tweened(dark ? vdark : vlight);
|
|
21
|
+
$:
|
|
22
|
+
$values = dark ? vdark : vlight;
|
|
23
|
+
const index = indexer++;
|
|
24
|
+
</script>
|
|
25
|
+
|
|
46
26
|
<svg class:dark viewBox="-25 -25 50 50" transform={`rotate(${$values.rotate})`}>
|
|
47
27
|
<mask id={`nil_doc_theme_icon_${index}`}>
|
|
48
28
|
<rect x="-25" y="-25" fill="white" />
|
|
@@ -65,3 +45,21 @@ const vdark = {
|
|
|
65
45
|
</g>
|
|
66
46
|
</svg>
|
|
67
47
|
|
|
48
|
+
<style>
|
|
49
|
+
svg {
|
|
50
|
+
fill: currentColor;
|
|
51
|
+
stroke: currentColor;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
svg,
|
|
55
|
+
rect {
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
line {
|
|
61
|
+
stroke-width: 2;
|
|
62
|
+
stroke-linecap: round;
|
|
63
|
+
stroke-linejoin: round;
|
|
64
|
+
}
|
|
65
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Theme } from "../context";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
theme?: Theme;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export type ThemeProps = typeof __propDef.props;
|
|
13
|
+
export type ThemeEvents = typeof __propDef.events;
|
|
14
|
+
export type ThemeSlots = typeof __propDef.slots;
|
|
15
|
+
export default class Theme extends SvelteComponentTyped<ThemeProps, ThemeEvents, ThemeSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
<style>
|
|
2
|
-
.nav {
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
min-width: 200px;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.search-bar {
|
|
11
|
-
padding: 5px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
input {
|
|
15
|
-
height: 30px;
|
|
16
|
-
width: 100%;
|
|
17
|
-
padding: 0px 10px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
input:focus {
|
|
21
|
-
outline: none;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
* {
|
|
25
|
-
box-sizing: border-box;
|
|
26
|
-
padding: 0px;
|
|
27
|
-
margin: 0px;
|
|
28
|
-
}
|
|
29
|
-
</style>
|
|
30
|
-
|
|
31
1
|
<script context="module">import { fuzz } from "./utils/fuzz";
|
|
32
2
|
const apply = (paths, init, pre, next, post) => {
|
|
33
3
|
const retval = {};
|
|
@@ -67,6 +37,7 @@ const populate = (filter, info, renamer) => {
|
|
|
67
37
|
);
|
|
68
38
|
};
|
|
69
39
|
</script>
|
|
40
|
+
|
|
70
41
|
<script>import Tree from "./Tree.svelte";
|
|
71
42
|
export let info;
|
|
72
43
|
export let selected;
|
|
@@ -95,6 +66,7 @@ const update = (selected2) => {
|
|
|
95
66
|
$:
|
|
96
67
|
update(selected);
|
|
97
68
|
</script>
|
|
69
|
+
|
|
98
70
|
<div class="nav">
|
|
99
71
|
<div class="search-bar">
|
|
100
72
|
<input bind:value={filter} type="text" placeholder="Search for page..." />
|
|
@@ -112,3 +84,28 @@ $:
|
|
|
112
84
|
</div>
|
|
113
85
|
</div>
|
|
114
86
|
|
|
87
|
+
<style>
|
|
88
|
+
.nav {
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 100%;
|
|
91
|
+
min-width: 12.5rem;
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.search-bar {
|
|
97
|
+
padding: 0.3125rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
input {
|
|
101
|
+
font-size: 0.75rem;
|
|
102
|
+
height: 1.875rem;
|
|
103
|
+
width: 100%;
|
|
104
|
+
padding: 0px 0.625rem;
|
|
105
|
+
box-sizing: border-box;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
input:focus {
|
|
109
|
+
outline: none;
|
|
110
|
+
}
|
|
111
|
+
</style>
|
|
@@ -1,50 +1,3 @@
|
|
|
1
|
-
<style>
|
|
2
|
-
.wrapper {
|
|
3
|
-
user-select: none;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.wrapper,
|
|
7
|
-
.sub,
|
|
8
|
-
.icon {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.header {
|
|
14
|
-
height: 30px;
|
|
15
|
-
display: grid;
|
|
16
|
-
grid-template-columns: 15px 1fr;
|
|
17
|
-
align-items: center;
|
|
18
|
-
cursor: pointer;
|
|
19
|
-
gap: 5px;
|
|
20
|
-
box-sizing: border-box;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.header:hover {
|
|
24
|
-
background-color: hsla(203, 98%, 50%, 0.07);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.header.selected {
|
|
28
|
-
background-color: hsla(203, 98%, 50%, 0.822);
|
|
29
|
-
color: black;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.icon {
|
|
33
|
-
justify-content: center;
|
|
34
|
-
height: 15px;
|
|
35
|
-
width: 15px;
|
|
36
|
-
transition: transform 350ms;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.icon.expanded {
|
|
40
|
-
transform: rotate(90deg);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.icon > div {
|
|
44
|
-
margin: auto;
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
47
|
-
|
|
48
1
|
<script>import { slide } from "svelte/transition";
|
|
49
2
|
import { sort } from "./utils/sort";
|
|
50
3
|
import { createEventDispatcher } from "svelte";
|
|
@@ -69,6 +22,7 @@ const click = (link) => {
|
|
|
69
22
|
}
|
|
70
23
|
};
|
|
71
24
|
</script>
|
|
25
|
+
|
|
72
26
|
<div class="wrapper">
|
|
73
27
|
<div
|
|
74
28
|
class="header"
|
|
@@ -101,3 +55,48 @@ const click = (link) => {
|
|
|
101
55
|
{/if}
|
|
102
56
|
</div>
|
|
103
57
|
|
|
58
|
+
<style>
|
|
59
|
+
.wrapper {
|
|
60
|
+
user-select: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.wrapper,
|
|
64
|
+
.sub,
|
|
65
|
+
.icon {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.header {
|
|
71
|
+
height: 1.875rem;
|
|
72
|
+
display: grid;
|
|
73
|
+
grid-template-columns: 1rem 1fr;
|
|
74
|
+
align-items: center;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
gap: 0.3125rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.header:hover {
|
|
80
|
+
background-color: var(--i-nil-doc-nav-hovered);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.header.selected {
|
|
84
|
+
background-color: var(--i-nil-doc-nav-selected);
|
|
85
|
+
color: var(--i-nil-doc-nav-selected-color);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.icon {
|
|
89
|
+
justify-content: center;
|
|
90
|
+
height: 1rem;
|
|
91
|
+
width: 1rem;
|
|
92
|
+
transition: transform var(--i-nil-doc-transition-time);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.icon.expanded {
|
|
96
|
+
transform: rotate(90deg);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.icon > div {
|
|
100
|
+
margin: auto;
|
|
101
|
+
}
|
|
102
|
+
</style>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
<script>import Node from "./Node.svelte";
|
|
3
2
|
import { sort } from "./utils/sort";
|
|
4
3
|
export let tree;
|
|
@@ -8,6 +7,7 @@ export let renamer;
|
|
|
8
7
|
export let expand;
|
|
9
8
|
export let selected;
|
|
10
9
|
</script>
|
|
10
|
+
|
|
11
11
|
{#each sort(tree, sorter) as [key, value] (key)}
|
|
12
12
|
<Node
|
|
13
13
|
{key}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>export let title = void 0;
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<div class="icon" on:click on:keypress {title}>
|
|
5
|
+
<slot />
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<style>
|
|
9
|
+
div {
|
|
10
|
+
width: 2.5rem;
|
|
11
|
+
height: 2.5rem;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
transition: transform var(--i-nil-doc-transition-time);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
div:hover {
|
|
17
|
+
transform: scale(1.5);
|
|
18
|
+
}
|
|
19
|
+
</style>
|