@nil-/doc 0.2.51 → 0.2.53
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 +23 -0
- package/components/{etc/Base.svelte → Base.svelte} +18 -11
- package/components/{etc/Base.svelte.d.ts → Base.svelte.d.ts} +1 -0
- package/components/block/Block.svelte +37 -9
- package/components/block/Instance.svelte +9 -39
- package/components/block/Instance.svelte.d.ts +0 -1
- package/components/block/Template.svelte +0 -2
- package/components/block/Template.svelte.d.ts +0 -1
- package/components/block/controls/{props/misc/Styler.svelte → Styler.svelte} +15 -21
- package/components/block/controls/{props/misc/Styler.svelte.d.ts → Styler.svelte.d.ts} +3 -1
- package/components/block/controls/events/Events.svelte +2 -2
- package/components/block/controls/props/Color.svelte +75 -2
- package/components/block/controls/props/Object.svelte +1 -1
- package/components/block/controls/props/Props.svelte +3 -3
- package/components/block/controls/props/Range.svelte +1 -1
- package/components/block/controls/props/Tuple.svelte +1 -1
- package/components/block/controls/props/misc/Name.svelte +5 -5
- package/components/block/controls/props/misc/defaulter.d.ts +1 -0
- package/components/block/controls/props/misc/defaulter.js +1 -1
- package/components/block/controls/props/misc/utils.d.ts +2 -1
- package/components/block/controls/props/misc/utils.js +6 -0
- package/components/block/controls/types.d.ts +8 -6
- package/components/block/icons/ControlView.svelte +22 -6
- package/components/block/icons/Position.svelte +18 -38
- package/components/{etc → layout}/Container.svelte +1 -1
- package/components/{etc → layout}/Container.svelte.d.ts +0 -0
- package/components/layout/Content.svelte +23 -0
- package/components/{etc → layout}/Content.svelte.d.ts +15 -6
- package/components/{Layout.svelte → layout/Layout.svelte} +32 -25
- package/components/{Layout.svelte.d.ts → layout/Layout.svelte.d.ts} +3 -2
- package/components/layout/Scrollable.svelte +19 -0
- package/components/layout/Scrollable.svelte.d.ts +27 -0
- package/components/layout/VerticalPanel.svelte +12 -0
- package/components/layout/VerticalPanel.svelte.d.ts +27 -0
- package/components/{etc → layout}/action.d.ts +0 -0
- package/components/{etc → layout}/action.js +0 -0
- package/components/{title → layout/icons}/Icon.svelte +0 -0
- package/components/{title → layout/icons}/Icon.svelte.d.ts +0 -0
- package/components/{icons/NilDoc.svelte → layout/icons/Nil.svelte} +2 -2
- package/components/layout/icons/Nil.svelte.d.ts +14 -0
- package/components/{icons → layout/icons}/Theme.svelte +41 -23
- package/components/{icons → layout/icons}/Theme.svelte.d.ts +1 -1
- package/components/navigation/Nav.svelte +3 -3
- package/components/navigation/Node.svelte +14 -5
- package/index.d.ts +4 -4
- package/index.js +4 -4
- package/package.json +8 -5
- package/sveltekit/index.d.ts +7 -1
- package/sveltekit/index.js +9 -5
- package/components/block/controls/events/misc/Styler.svelte +0 -57
- package/components/block/controls/events/misc/Styler.svelte.d.ts +0 -16
- package/components/etc/Content.svelte +0 -45
- package/components/icons/NilDoc.svelte.d.ts +0 -14
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
type Types = "text" | "color" | "number" | "select" | "range" | "switch" | "tuple" | "object";
|
|
2
2
|
|
|
3
|
+
type ColorFormat = "hsl" | "hsla" | "rgb" | "rgba" | "hex" | "hexa";
|
|
4
|
+
|
|
3
5
|
// prettier-ignore
|
|
4
6
|
export type PropType<T extends Types> =
|
|
5
7
|
T extends "text" ? [
|
|
@@ -7,8 +9,8 @@ export type PropType<T extends Types> =
|
|
|
7
9
|
{ name: string; type: T; }
|
|
8
10
|
]
|
|
9
11
|
: T extends "color" ? [
|
|
10
|
-
[ name: string, type: T ],
|
|
11
|
-
{ name: string; type: T; }
|
|
12
|
+
[ name: string, type: T, format: ColorFormat ],
|
|
13
|
+
{ name: string; type: T; format: ColorFormat; }
|
|
12
14
|
]
|
|
13
15
|
: T extends "number" ? [
|
|
14
16
|
[ name: string, type: T ],
|
|
@@ -48,8 +50,8 @@ export type Unionized<T extends PropTyoe> = T[number];
|
|
|
48
50
|
export type Prop =
|
|
49
51
|
| [ name: string, type: "text" ]
|
|
50
52
|
| { name: string; type: "text"; }
|
|
51
|
-
| [ name: string, type: "color" ]
|
|
52
|
-
| { name: string; type: "color"; }
|
|
53
|
+
| [ name: string, type: "color", format: ColorFormat ]
|
|
54
|
+
| { name: string; type: "color"; format: ColorFormat; }
|
|
53
55
|
| [ name: string, type: "number" ]
|
|
54
56
|
| { name: string; type: "number"; }
|
|
55
57
|
| [ name: string, type: "switch" ]
|
|
@@ -69,8 +71,8 @@ export type Prop =
|
|
|
69
71
|
export type NonNamedProp =
|
|
70
72
|
| [ type: "text" ]
|
|
71
73
|
| { type: "text"; }
|
|
72
|
-
| [ type: "color" ]
|
|
73
|
-
| { type: "color"; }
|
|
74
|
+
| [ type: "color", format: ColorFormat ]
|
|
75
|
+
| { type: "color"; format: ColorFormat; }
|
|
74
76
|
| [ type: "number" ]
|
|
75
77
|
| { type: "number"; }
|
|
76
78
|
| [ type: "switch" ]
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
|
-
<script>
|
|
4
|
-
export let mode = "prop";
|
|
5
|
-
const v = tweened(mode === "event" ? 1 : 0, { duration: 150 });
|
|
6
|
-
$:
|
|
7
|
-
$v = mode === "event" ? 1 : 0;
|
|
3
|
+
<script>export let mode = "prop";
|
|
8
4
|
</script>
|
|
9
5
|
|
|
10
6
|
<svg viewBox="-50 -50 100 100">
|
|
11
7
|
<rect width="60" height="60" x="-30" y="-30" fill="transparent" />
|
|
12
|
-
<rect
|
|
8
|
+
<rect
|
|
9
|
+
class:right={mode === "prop"}
|
|
10
|
+
class="mv"
|
|
11
|
+
height="40"
|
|
12
|
+
width="20"
|
|
13
|
+
y="-20"
|
|
14
|
+
rx="2"
|
|
15
|
+
ry="2"
|
|
16
|
+
fill="transparent"
|
|
17
|
+
/>
|
|
13
18
|
<polygon transform="translate(5, 0)" points="-15,-2 1,-2, 1,-6 6,0 1,6 1,2 -15,2" />
|
|
14
19
|
</svg>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
.mv {
|
|
23
|
+
transition: x var(--i-nil-doc-transition-time);
|
|
24
|
+
x: -20px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.mv.right {
|
|
28
|
+
x: 0px;
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
@@ -1,45 +1,10 @@
|
|
|
1
|
-
<script
|
|
2
|
-
width: 60,
|
|
3
|
-
height: 20,
|
|
4
|
-
x: -30,
|
|
5
|
-
y: 10
|
|
6
|
-
};
|
|
7
|
-
const right = {
|
|
8
|
-
width: 20,
|
|
9
|
-
height: 60,
|
|
10
|
-
x: 10,
|
|
11
|
-
y: -30
|
|
12
|
-
};
|
|
13
|
-
const nobottom = {
|
|
14
|
-
width: 60,
|
|
15
|
-
height: 0,
|
|
16
|
-
x: -30,
|
|
17
|
-
y: 30
|
|
18
|
-
};
|
|
19
|
-
const noright = {
|
|
20
|
-
width: 0,
|
|
21
|
-
height: 60,
|
|
22
|
-
x: 30,
|
|
23
|
-
y: -30
|
|
24
|
-
};
|
|
25
|
-
const settings = {
|
|
26
|
-
hidden: [nobottom, noright],
|
|
27
|
-
bottom: [bottom, noright],
|
|
28
|
-
right: [nobottom, right]
|
|
29
|
-
};
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<script>import { tweened } from "svelte/motion";
|
|
33
|
-
export let position = "hidden";
|
|
34
|
-
const offset = tweened(settings[position], { duration: 150 });
|
|
35
|
-
$:
|
|
36
|
-
$offset = settings[position];
|
|
1
|
+
<script>export let position = "hidden";
|
|
37
2
|
</script>
|
|
38
3
|
|
|
39
4
|
<svg viewBox="-50 -50 100 100">
|
|
40
5
|
<rect width="60" height="60" x="-30" y="-30" fill="transparent" />
|
|
41
|
-
<rect {
|
|
42
|
-
<rect {
|
|
6
|
+
<rect class:show={position === "bottom"} />
|
|
7
|
+
<rect class:show={position === "right"} transform="rotate(-90)" />
|
|
43
8
|
</svg>
|
|
44
9
|
|
|
45
10
|
<style>
|
|
@@ -47,4 +12,19 @@ $:
|
|
|
47
12
|
stroke-width: 3;
|
|
48
13
|
fill: currentColor;
|
|
49
14
|
}
|
|
15
|
+
|
|
16
|
+
rect:not(:first-child) {
|
|
17
|
+
transition: height var(--i-nil-doc-transition-time), x var(--i-nil-doc-transition-time),
|
|
18
|
+
y var(--i-nil-doc-transition-time);
|
|
19
|
+
width: 60px;
|
|
20
|
+
height: 0px;
|
|
21
|
+
x: -30px;
|
|
22
|
+
y: 30px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
rect:not(:first-child).show {
|
|
26
|
+
height: 20px;
|
|
27
|
+
x: -30px;
|
|
28
|
+
y: 10px;
|
|
29
|
+
}
|
|
50
30
|
</style>
|
|
@@ -70,7 +70,7 @@ const check = (v, flag, s) => {
|
|
|
70
70
|
<div class="divider">
|
|
71
71
|
<div
|
|
72
72
|
class="overlay"
|
|
73
|
-
title={`Collapse ${vertical ? (b ? "left" : "right"):
|
|
73
|
+
title={`Collapse ${vertical ? (b ? "left" : "right") : b ? "top" : "bottom"}`}
|
|
74
74
|
use:draggable={{
|
|
75
75
|
reset: () => offset,
|
|
76
76
|
reversed: !b,
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<slot />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<style>
|
|
6
|
+
div {
|
|
7
|
+
display: flex;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
margin: 0.5rem;
|
|
10
|
+
padding: 0.5rem;
|
|
11
|
+
border-radius: 0.5rem;
|
|
12
|
+
width: min-content;
|
|
13
|
+
height: min-content;
|
|
14
|
+
min-width: calc(100% - 1rem);
|
|
15
|
+
min-height: calc(100% - 1rem);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* color */
|
|
19
|
+
div {
|
|
20
|
+
border: solid 1px var(--i-nil-doc-content-outline-color);
|
|
21
|
+
box-shadow: 0 0 0.5rem 0 var(--i-nil-doc-content-outline-color);
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ContentProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ContentEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ContentSlots */
|
|
4
|
+
export default class Content extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type ContentProps = typeof __propDef.props;
|
|
13
|
+
export type ContentEvents = typeof __propDef.events;
|
|
14
|
+
export type ContentSlots = typeof __propDef.slots;
|
|
1
15
|
import { SvelteComponentTyped } from "svelte";
|
|
2
16
|
declare const __propDef: {
|
|
3
17
|
props: {
|
|
4
|
-
|
|
18
|
+
[x: string]: never;
|
|
5
19
|
};
|
|
6
20
|
events: {
|
|
7
21
|
[evt: string]: CustomEvent<any>;
|
|
@@ -10,9 +24,4 @@ declare const __propDef: {
|
|
|
10
24
|
default: {};
|
|
11
25
|
};
|
|
12
26
|
};
|
|
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
27
|
export {};
|
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
const defaultRenamer = (s) => s;
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
|
-
<script>import Base from "
|
|
6
|
-
import Container from "./
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
5
|
+
<script>import Base from "../Base.svelte";
|
|
6
|
+
import Container from "./Container.svelte";
|
|
7
|
+
import Content from "./Content.svelte";
|
|
8
|
+
import Scrollable from "./Scrollable.svelte";
|
|
9
|
+
import VerticalPanel from "./VerticalPanel.svelte";
|
|
10
|
+
import Nav from "../navigation/Nav.svelte";
|
|
11
|
+
import Icon from "./icons/Icon.svelte";
|
|
12
|
+
import { getTheme, initTheme } from "../context";
|
|
10
13
|
import ThemeIcon from "./icons/Theme.svelte";
|
|
11
|
-
import Content from "./etc/Content.svelte";
|
|
12
14
|
export let data;
|
|
13
15
|
export let current = null;
|
|
14
16
|
export let sorter = null;
|
|
15
17
|
export let renamer = null;
|
|
16
18
|
export let theme = void 0;
|
|
19
|
+
export let offset = 250;
|
|
17
20
|
const parentTheme = getTheme();
|
|
18
21
|
const dark = initTheme();
|
|
19
22
|
$:
|
|
@@ -32,7 +35,7 @@ const toggle = () => {
|
|
|
32
35
|
See [documentation](https://mono-doc.vercel.app/3-Components/1-Layout) for more details.
|
|
33
36
|
-->
|
|
34
37
|
|
|
35
|
-
<Base dark={$dark}>
|
|
38
|
+
<Base dark={$dark} fill>
|
|
36
39
|
<div class="fill layout">
|
|
37
40
|
<div class="top">
|
|
38
41
|
<div class="title">
|
|
@@ -44,24 +47,28 @@ const toggle = () => {
|
|
|
44
47
|
</Icon>
|
|
45
48
|
</slot>
|
|
46
49
|
</div>
|
|
47
|
-
<Container offset
|
|
50
|
+
<Container bind:offset vertical b>
|
|
48
51
|
<svelte:fragment slot="A">
|
|
49
|
-
<
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
<Scrollable>
|
|
53
|
+
<VerticalPanel>
|
|
54
|
+
<Nav
|
|
55
|
+
info={data}
|
|
56
|
+
selected={current ?? ""}
|
|
57
|
+
sorter={sorter ?? defaultSorter}
|
|
58
|
+
renamer={renamer ?? defaultRenamer}
|
|
59
|
+
on:navigate
|
|
60
|
+
/>
|
|
61
|
+
</VerticalPanel>
|
|
62
|
+
</Scrollable>
|
|
58
63
|
</svelte:fragment>
|
|
59
64
|
<svelte:fragment slot="B">
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
<Scrollable>
|
|
66
|
+
<Content>
|
|
67
|
+
{#key current}
|
|
68
|
+
<slot />
|
|
69
|
+
{/key}
|
|
70
|
+
</Content>
|
|
71
|
+
</Scrollable>
|
|
65
72
|
</svelte:fragment>
|
|
66
73
|
</Container>
|
|
67
74
|
</div>
|
|
@@ -87,8 +94,8 @@ const toggle = () => {
|
|
|
87
94
|
grid-auto-columns: 2.5rem;
|
|
88
95
|
grid-template-columns: 1fr;
|
|
89
96
|
align-items: center;
|
|
90
|
-
padding-left: 0.
|
|
91
|
-
padding-right: 0.
|
|
97
|
+
padding-left: 0.5rem;
|
|
98
|
+
padding-right: 0.5rem;
|
|
92
99
|
border-bottom-width: 1px;
|
|
93
100
|
border-bottom-style: solid;
|
|
94
101
|
user-select: none;
|
|
@@ -99,7 +106,7 @@ const toggle = () => {
|
|
|
99
106
|
grid-auto-flow: column;
|
|
100
107
|
align-items: center;
|
|
101
108
|
justify-content: left;
|
|
102
|
-
gap: 0.
|
|
109
|
+
gap: 0.25rem;
|
|
103
110
|
}
|
|
104
111
|
|
|
105
112
|
.layout {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { Sorter, Renamer } from "
|
|
3
|
-
import { type Theme } from "
|
|
2
|
+
import type { Sorter, Renamer } from "../navigation/types";
|
|
3
|
+
import { type Theme } from "../context";
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
data: string[];
|
|
@@ -8,6 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
sorter?: Sorter | null | undefined;
|
|
9
9
|
renamer?: Renamer | null | undefined;
|
|
10
10
|
theme?: Theme;
|
|
11
|
+
offset?: number | undefined;
|
|
11
12
|
};
|
|
12
13
|
events: {
|
|
13
14
|
navigate: CustomEvent<any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<slot />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<style>
|
|
6
|
+
div {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
overflow: scroll;
|
|
10
|
+
/* Firefox */
|
|
11
|
+
scrollbar-width: none;
|
|
12
|
+
/* IE and Edge */
|
|
13
|
+
-ms-overflow-style: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
div::-webkit-scrollbar {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ScrollableProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ScrollableEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ScrollableSlots */
|
|
4
|
+
export default class Scrollable extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type ScrollableProps = typeof __propDef.props;
|
|
13
|
+
export type ScrollableEvents = typeof __propDef.events;
|
|
14
|
+
export type ScrollableSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
[x: string]: never;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} VerticalPanelProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} VerticalPanelEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} VerticalPanelSlots */
|
|
4
|
+
export default class VerticalPanel extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type VerticalPanelProps = typeof __propDef.props;
|
|
13
|
+
export type VerticalPanelEvents = typeof __propDef.events;
|
|
14
|
+
export type VerticalPanelSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
[x: string]: never;
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -21,10 +21,10 @@ $:
|
|
|
21
21
|
|
|
22
22
|
<svg viewBox="-35 -35 70 70" on:pointerenter={trigger}>
|
|
23
23
|
<g transform="rotate(45 0 0)">
|
|
24
|
-
<path {d} use:action={$length} />
|
|
24
|
+
<path {d} use:action={$length} pathLength={100} />
|
|
25
25
|
</g>
|
|
26
26
|
<g transform="rotate(225 0 0)">
|
|
27
|
-
<path {d} use:action={$length} />
|
|
27
|
+
<path {d} use:action={$length} pathLength={100} />
|
|
28
28
|
</g>
|
|
29
29
|
</svg>
|
|
30
30
|
|
|
@@ -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 NilProps = typeof __propDef.props;
|
|
10
|
+
export type NilEvents = typeof __propDef.events;
|
|
11
|
+
export type NilSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Nil extends SvelteComponentTyped<NilProps, NilEvents, NilSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1,35 +1,17 @@
|
|
|
1
1
|
<script context="module">let indexer = 0;
|
|
2
|
-
const vlight = {
|
|
3
|
-
rotate: 40,
|
|
4
|
-
mcy: -8,
|
|
5
|
-
cr: 10,
|
|
6
|
-
v: 0
|
|
7
|
-
};
|
|
8
|
-
const vdark = {
|
|
9
|
-
rotate: 180,
|
|
10
|
-
mcy: -24,
|
|
11
|
-
cr: 5,
|
|
12
|
-
v: 1
|
|
13
|
-
};
|
|
14
2
|
</script>
|
|
15
3
|
|
|
16
|
-
<script>
|
|
17
|
-
export let theme = "dark";
|
|
18
|
-
$:
|
|
19
|
-
dark = theme === "dark";
|
|
20
|
-
const values = tweened(dark ? vdark : vlight);
|
|
21
|
-
$:
|
|
22
|
-
$values = dark ? vdark : vlight;
|
|
4
|
+
<script>export let theme = "dark";
|
|
23
5
|
const index = indexer++;
|
|
24
6
|
</script>
|
|
25
7
|
|
|
26
|
-
<svg
|
|
8
|
+
<svg viewBox="-25 -25 50 50" class:dark={theme === "light"}>
|
|
27
9
|
<mask id={`nil_doc_theme_icon_${index}`}>
|
|
28
10
|
<rect x="-25" y="-25" fill="white" />
|
|
29
|
-
<circle
|
|
11
|
+
<circle r="11" fill="black" stroke="black" />
|
|
30
12
|
</mask>
|
|
31
|
-
<circle
|
|
32
|
-
<g
|
|
13
|
+
<circle mask={`url(#nil_doc_theme_icon_${index})`} />
|
|
14
|
+
<g>
|
|
33
15
|
<g>
|
|
34
16
|
<line x1="0" y1="9" x2="0" y2="11" />
|
|
35
17
|
<line x1="9" y1="0" x2="11" y2="0" />
|
|
@@ -62,4 +44,40 @@ const index = indexer++;
|
|
|
62
44
|
stroke-linecap: round;
|
|
63
45
|
stroke-linejoin: round;
|
|
64
46
|
}
|
|
47
|
+
|
|
48
|
+
svg {
|
|
49
|
+
transition: transform var(--i-nil-doc-transition-time);
|
|
50
|
+
transform: rotate(40deg);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
svg > g {
|
|
54
|
+
transition: opacity var(--i-nil-doc-transition-time);
|
|
55
|
+
opacity: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
svg > mask > circle {
|
|
59
|
+
transition: cy var(--i-nil-doc-transition-time);
|
|
60
|
+
cy: -8px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
svg > circle {
|
|
64
|
+
transition: r var(--i-nil-doc-transition-time);
|
|
65
|
+
r: 10px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
svg.dark {
|
|
69
|
+
transform: rotate(180deg);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
svg.dark > g {
|
|
73
|
+
opacity: 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
svg.dark > mask > circle {
|
|
77
|
+
cy: -24px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
svg.dark > circle {
|
|
81
|
+
r: 5px;
|
|
82
|
+
}
|
|
65
83
|
</style>
|
|
@@ -94,14 +94,14 @@ $:
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
.search-bar {
|
|
97
|
-
padding: 0.
|
|
97
|
+
padding: 0.25rem;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
input {
|
|
101
101
|
font-size: 0.75rem;
|
|
102
|
-
height: 1.
|
|
102
|
+
height: 1.75rem;
|
|
103
103
|
width: 100%;
|
|
104
|
-
padding: 0px 0.
|
|
104
|
+
padding: 0px 0.5rem;
|
|
105
105
|
box-sizing: border-box;
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -11,12 +11,15 @@ export let sorter;
|
|
|
11
11
|
export let renamer;
|
|
12
12
|
const dispatch = createEventDispatcher();
|
|
13
13
|
$:
|
|
14
|
-
style = `padding-left: ${
|
|
14
|
+
style = `padding-left: ${0.5 + depth}rem; padding-right: 0.5rem`;
|
|
15
15
|
$:
|
|
16
16
|
hasChildren = Object.keys(value.sub).length > 0;
|
|
17
17
|
const click = (link) => {
|
|
18
18
|
if (link != null && selected !== link) {
|
|
19
19
|
dispatch("navigate", link);
|
|
20
|
+
if (hasChildren && !states.expanded) {
|
|
21
|
+
states.expanded = true;
|
|
22
|
+
}
|
|
20
23
|
} else if (hasChildren) {
|
|
21
24
|
states.expanded = !states.expanded;
|
|
22
25
|
}
|
|
@@ -30,6 +33,7 @@ const click = (link) => {
|
|
|
30
33
|
on:keypress={null}
|
|
31
34
|
{style}
|
|
32
35
|
class:selected={selected === value.url}
|
|
36
|
+
class:paged={value.url != null}
|
|
33
37
|
>
|
|
34
38
|
<div class="icon" class:expanded={hasChildren && (expand || states.expanded)}>
|
|
35
39
|
<div>{Object.keys(value.sub).length > 0 ? ">" : "-"}</div>
|
|
@@ -68,21 +72,26 @@ const click = (link) => {
|
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
.header {
|
|
71
|
-
height: 1.
|
|
75
|
+
height: 1.75rem;
|
|
72
76
|
display: grid;
|
|
73
77
|
grid-template-columns: 1rem 1fr;
|
|
74
78
|
align-items: center;
|
|
75
79
|
cursor: pointer;
|
|
76
|
-
gap: 0.
|
|
80
|
+
gap: 0.25rem;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
padding-right: 0.5rem;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
.header:hover {
|
|
80
86
|
background-color: var(--i-nil-doc-nav-hovered);
|
|
81
87
|
}
|
|
82
88
|
|
|
89
|
+
.header.paged:hover {
|
|
90
|
+
background-color: var(--i-nil-doc-nav-page-hovered);
|
|
91
|
+
}
|
|
92
|
+
|
|
83
93
|
.header.selected {
|
|
84
|
-
background-color: var(--i-nil-doc-nav-selected);
|
|
85
|
-
color: var(--i-nil-doc-nav-selected-color);
|
|
94
|
+
background-color: var(--i-nil-doc-nav-selected) !important;
|
|
86
95
|
}
|
|
87
96
|
|
|
88
97
|
.icon {
|
package/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { renamer } from "./components/navigation/utils/renamer";
|
|
2
2
|
export { sorter } from "./components/navigation/utils/sorter";
|
|
3
3
|
export type { Prop, Event, PropType, Detailed, Flattened, Unionized } from "./components/block/controls/types";
|
|
4
|
-
export { default as Layout } from "./components/Layout.svelte";
|
|
4
|
+
export { default as Layout } from "./components/layout/Layout.svelte";
|
|
5
5
|
export { default as Instance } from "./components/block/Instance.svelte";
|
|
6
6
|
export { default as Block } from "./components/block/Block.svelte";
|
|
7
7
|
export { default as Template } from "./components/block/Template.svelte";
|
|
8
8
|
export { default as Controls } from "./components/block/Controls.svelte";
|
|
9
9
|
export { default as Params } from "./components/block/Params.svelte";
|
|
10
|
-
export { default as Icon } from "./components/
|
|
11
|
-
export { default as
|
|
12
|
-
export { default as Theme } from "./components/icons/Theme.svelte";
|
|
10
|
+
export { default as Icon } from "./components/layout/icons/Icon.svelte";
|
|
11
|
+
export { default as Nil } from "./components/layout/icons/Nil.svelte";
|
|
12
|
+
export { default as Theme } from "./components/layout/icons/Theme.svelte";
|
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { renamer } from "./components/navigation/utils/renamer";
|
|
2
2
|
export { sorter } from "./components/navigation/utils/sorter";
|
|
3
|
-
export { default as Layout } from "./components/Layout.svelte";
|
|
3
|
+
export { default as Layout } from "./components/layout/Layout.svelte";
|
|
4
4
|
export { default as Instance } from "./components/block/Instance.svelte";
|
|
5
5
|
export { default as Block } from "./components/block/Block.svelte";
|
|
6
6
|
export { default as Template } from "./components/block/Template.svelte";
|
|
7
7
|
export { default as Controls } from "./components/block/Controls.svelte";
|
|
8
8
|
export { default as Params } from "./components/block/Params.svelte";
|
|
9
|
-
export { default as Icon } from "./components/
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as Theme } from "./components/icons/Theme.svelte";
|
|
9
|
+
export { default as Icon } from "./components/layout/icons/Icon.svelte";
|
|
10
|
+
export { default as Nil } from "./components/layout/icons/Nil.svelte";
|
|
11
|
+
export { default as Theme } from "./components/layout/icons/Theme.svelte";
|