@nil-/doc 0.2.51 → 0.2.52
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 +15 -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 +12 -7
- package/components/block/Instance.svelte +8 -25
- package/components/block/controls/events/misc/Styler.svelte +1 -6
- package/components/block/controls/events/misc/Styler.svelte.d.ts +17 -6
- package/components/block/controls/props/Color.svelte +67 -2
- package/components/block/controls/props/Object.svelte +1 -1
- package/components/block/controls/props/Props.svelte +1 -1
- 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/Styler.svelte +1 -6
- package/components/block/controls/props/misc/Styler.svelte.d.ts +17 -6
- 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 +17 -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 +20 -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/etc/Content.svelte +0 -45
- package/components/icons/NilDoc.svelte.d.ts +0 -14
|
@@ -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,18 @@ $:
|
|
|
47
12
|
stroke-width: 3;
|
|
48
13
|
fill: currentColor;
|
|
49
14
|
}
|
|
15
|
+
|
|
16
|
+
rect:not(:first-child) {
|
|
17
|
+
transition: height 350ms, x 350ms, y 350ms;
|
|
18
|
+
width: 60px;
|
|
19
|
+
height: 0px;
|
|
20
|
+
x: -30px;
|
|
21
|
+
y: 30px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
rect:not(:first-child).show {
|
|
25
|
+
height: 20px;
|
|
26
|
+
x: -30px;
|
|
27
|
+
y: 10px;
|
|
28
|
+
}
|
|
50
29
|
</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,20 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<slot />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<style>
|
|
6
|
+
/* scrollable */
|
|
7
|
+
div {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
overflow: scroll;
|
|
11
|
+
/* Firefox */
|
|
12
|
+
scrollbar-width: none;
|
|
13
|
+
/* IE and Edge */
|
|
14
|
+
-ms-overflow-style: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
div::-webkit-scrollbar {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
</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 350ms;
|
|
50
|
+
transform: rotate(40deg);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
svg > g {
|
|
54
|
+
transition: opacity 350ms;
|
|
55
|
+
opacity: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
svg > mask > circle {
|
|
59
|
+
transition: cy 350ms;
|
|
60
|
+
cy: -8px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
svg > circle {
|
|
64
|
+
transition: r 350ms;
|
|
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";
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nil-/doc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.52",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "njaldea@gmail.com",
|
|
6
6
|
"name": "Neil Aldea"
|
|
7
7
|
},
|
|
8
8
|
"license": "ISC",
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@sveltejs/adapter-vercel": "^1.0.
|
|
11
|
-
"@sveltejs/kit": "^1.
|
|
10
|
+
"@sveltejs/adapter-vercel": "^1.0.6",
|
|
11
|
+
"@sveltejs/kit": "^1.5.5",
|
|
12
12
|
"@sveltejs/package": "^1.0.2",
|
|
13
13
|
"@vitest/coverage-c8": "^0.26.3",
|
|
14
14
|
"mdsvex": "^0.10.6",
|
|
15
15
|
"remark-admonitions": "^1.2.1",
|
|
16
16
|
"svelte-check": "^2.10.3",
|
|
17
17
|
"tslib": "^2.5.0",
|
|
18
|
-
"typescript": "^4.9.
|
|
19
|
-
"vite": "^4.
|
|
18
|
+
"typescript": "^4.9.5",
|
|
19
|
+
"vite": "^4.1.1",
|
|
20
20
|
"vitest": "^0.26.3"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
"component"
|
|
32
32
|
],
|
|
33
33
|
"type": "module",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"vanilla-picker": "^2.12.1"
|
|
36
|
+
},
|
|
34
37
|
"exports": {
|
|
35
38
|
"./package.json": "./package.json",
|
|
36
39
|
".": "./index.js",
|
package/sveltekit/index.d.ts
CHANGED
|
@@ -19,10 +19,16 @@ type Settings = {
|
|
|
19
19
|
* Default is "dark"
|
|
20
20
|
*/
|
|
21
21
|
theme: Writable<Exclude<Theme, undefined>>;
|
|
22
|
+
/**
|
|
23
|
+
* A store that is responsible in keeping the offset in localStorage
|
|
24
|
+
* offset is the width of the navigation panel.
|
|
25
|
+
* Default is 250px
|
|
26
|
+
*/
|
|
27
|
+
offset: Writable<number>;
|
|
22
28
|
};
|
|
23
29
|
/**
|
|
24
30
|
* Dedicated helper method to be used for sveltekit
|
|
25
|
-
* @param detail - vite's `import.meta.glob(
|
|
31
|
+
* @param detail - vite's `import.meta.glob(...)`
|
|
26
32
|
* @param prefix - only use when layout is not in the root route
|
|
27
33
|
* @returns Settings
|
|
28
34
|
*/
|