@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @nil-/doc
|
|
2
2
|
|
|
3
|
+
## 0.2.53
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [doc][break] removed "scale" prop ([#92](https://github.com/njaldea/mono/pull/92))
|
|
8
|
+
[doc][fix] better block scrollable handling
|
|
9
|
+
[doc][fix] better style to vanilla-color popup
|
|
10
|
+
|
|
11
|
+
## 0.2.52
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [doc][fix] fix layout scrollable sections ([#90](https://github.com/njaldea/mono/pull/90))
|
|
16
|
+
|
|
17
|
+
- [doc][patch] restructure code ([#90](https://github.com/njaldea/mono/pull/90))
|
|
18
|
+
|
|
19
|
+
- [doc][patch] use vannilla-color library for color picker ([#90](https://github.com/njaldea/mono/pull/90))
|
|
20
|
+
[doc][fix] removed position relative and overflow scroll for misc (controls)
|
|
21
|
+
|
|
22
|
+
- [doc][fix] content fill width/height ([#90](https://github.com/njaldea/mono/pull/90))
|
|
23
|
+
|
|
24
|
+
- [doc][new] added offset Layout.svelte and sveltekit for keeping state ([#90](https://github.com/njaldea/mono/pull/90))
|
|
25
|
+
|
|
3
26
|
## 0.2.51
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
<script>export let dark =
|
|
1
|
+
<script>export let dark = false;
|
|
2
|
+
export let fill = false;
|
|
2
3
|
</script>
|
|
3
4
|
|
|
4
|
-
<div class:dark>
|
|
5
|
+
<div class:dark class:fill>
|
|
5
6
|
<slot />
|
|
6
7
|
</div>
|
|
7
8
|
|
|
9
|
+
<!-- prettier-ignore -->
|
|
8
10
|
<style>
|
|
9
11
|
@import url("https://fonts.googleapis.com/css?family=Fira%20Code");
|
|
10
12
|
|
|
11
13
|
div {
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 100%;
|
|
14
14
|
font-family: "Fira Code", "Courier New", Courier, monospace;
|
|
15
|
+
}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
--i-nil-doc-transition-time: var(--nil-doc-transition-time, 350ms);
|
|
17
|
+
.fill {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
div {
|
|
@@ -41,10 +40,10 @@
|
|
|
41
40
|
div.dark {
|
|
42
41
|
--i-nil-doc-color: var(--nil-doc-color, hsl(0, 0%, 80%));
|
|
43
42
|
--i-nil-doc-color-scheme: var(--nil-doc-color-scheme, dark);
|
|
44
|
-
|
|
43
|
+
|
|
45
44
|
--i-nil-doc-bg-color: var(--nil-doc-bg-color, hsl(210, 6%, 7%));
|
|
46
45
|
--i-nil-doc-content-outline-color: var(--nil-doc-content-outline-color, hsla(0, 0%, 100%, 0.3));
|
|
47
|
-
|
|
46
|
+
|
|
48
47
|
--i-nil-doc-block-bg-color: var(--nil-doc-block-bg-color, hsla(200, 4%, 7%, 0.3));
|
|
49
48
|
--i-nil-doc-block-outline-color: var(--nil-doc-block-outline-color, hsla(0, 0%, 1000%, 0.3));
|
|
50
49
|
|
|
@@ -55,4 +54,12 @@
|
|
|
55
54
|
--i-nil-doc-controls-s: var(--nil-doc-controls-s, hsl(213, 26%, 11%));
|
|
56
55
|
--i-nil-doc-controls-hover: var(--nil-doc-controls-hover, hsl(203, 100%, 15%));
|
|
57
56
|
}
|
|
57
|
+
|
|
58
|
+
div {
|
|
59
|
+
--i-nil-doc-nav-hovered: var(--nil-doc-nav-hovered, hsla(203, 98%, 50%, 0.1));
|
|
60
|
+
--i-nil-doc-nav-page-hovered: var(--nil-doc-nav-page-hovered, hsla(203, 98%, 50%, 0.5));
|
|
61
|
+
--i-nil-doc-nav-selected: var(--nil-doc-nav-selected, hsla(203, 98%, 50%, 0.85));
|
|
62
|
+
|
|
63
|
+
--i-nil-doc-transition-time: var(--nil-doc-transition-time, 350ms);
|
|
64
|
+
}
|
|
58
65
|
</style>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
initControlsState,
|
|
6
6
|
initOrientation
|
|
7
7
|
} from "./context";
|
|
8
|
-
import Base from "../
|
|
8
|
+
import Base from "../Base.svelte";
|
|
9
9
|
import { getTheme, initTheme } from "../context";
|
|
10
10
|
import Button from "./icons/Button.svelte";
|
|
11
11
|
import Position from "./icons/Position.svelte";
|
|
@@ -51,7 +51,7 @@ const cycleMode = () => {
|
|
|
51
51
|
-->
|
|
52
52
|
|
|
53
53
|
<Base dark={$dark}>
|
|
54
|
-
<div class="
|
|
54
|
+
<div class="relative">
|
|
55
55
|
<div class="buttons">
|
|
56
56
|
<Button scale on:click={cycleMode} title={$state.mode}>
|
|
57
57
|
<ControlView mode={$state.mode} />
|
|
@@ -60,28 +60,52 @@ const cycleMode = () => {
|
|
|
60
60
|
<Position position={$state.position} />
|
|
61
61
|
</Button>
|
|
62
62
|
</div>
|
|
63
|
-
|
|
63
|
+
</div>
|
|
64
|
+
<div class="outer">
|
|
65
|
+
<div class="scrollable block" class:columns={$columns}>
|
|
66
|
+
<slot />
|
|
67
|
+
</div>
|
|
64
68
|
</div>
|
|
65
69
|
</Base>
|
|
66
70
|
|
|
67
71
|
<style>
|
|
68
72
|
.block {
|
|
69
73
|
display: grid;
|
|
70
|
-
border-radius: 0.3125rem;
|
|
71
74
|
grid-auto-rows: 1fr;
|
|
72
75
|
grid-auto-columns: auto;
|
|
73
76
|
grid-auto-flow: row;
|
|
77
|
+
}
|
|
74
78
|
|
|
79
|
+
.outer {
|
|
80
|
+
border-radius: 0.5rem;
|
|
81
|
+
padding: 1.75rem 0.2rem 0.75rem 0.2rem;
|
|
75
82
|
min-width: 10rem;
|
|
83
|
+
margin: 1px;
|
|
84
|
+
outline: solid 1px white;
|
|
85
|
+
}
|
|
76
86
|
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
.scrollable {
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 100%;
|
|
90
|
+
overflow: scroll;
|
|
91
|
+
/* Firefox */
|
|
92
|
+
scrollbar-width: none;
|
|
93
|
+
/* IE and Edge */
|
|
94
|
+
-ms-overflow-style: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.scrollable::-webkit-scrollbar {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.relative {
|
|
102
|
+
z-index: 10;
|
|
79
103
|
position: relative;
|
|
80
104
|
}
|
|
81
105
|
|
|
82
106
|
.buttons {
|
|
83
107
|
position: absolute;
|
|
84
|
-
width:
|
|
108
|
+
width: 3.5rem;
|
|
85
109
|
height: 1.75rem;
|
|
86
110
|
right: 1rem;
|
|
87
111
|
top: 0rem;
|
|
@@ -95,13 +119,17 @@ const cycleMode = () => {
|
|
|
95
119
|
grid-auto-flow: column;
|
|
96
120
|
}
|
|
97
121
|
|
|
98
|
-
.
|
|
122
|
+
.outer {
|
|
99
123
|
color: var(--i-nil-doc-color);
|
|
100
124
|
color-scheme: var(--i-nil-doc-color-scheme);
|
|
101
125
|
background-color: var(--i-nil-doc-block-bg-color);
|
|
102
|
-
box-shadow:
|
|
126
|
+
box-shadow: 0 0 0.5rem 0 var(--i-nil-doc-block-outline-color);
|
|
103
127
|
outline: 1px solid var(--i-nil-doc-block-outline-color);
|
|
104
128
|
transition: color var(--i-nil-doc-transition-time),
|
|
105
129
|
background-color var(--i-nil-doc-transition-time);
|
|
106
130
|
}
|
|
131
|
+
|
|
132
|
+
.block {
|
|
133
|
+
outline: 1px solid var(--i-nil-doc-block-outline-color);
|
|
134
|
+
}
|
|
107
135
|
</style>
|
|
@@ -9,7 +9,6 @@ $:
|
|
|
9
9
|
expanded = $controlsState.position !== "hidden";
|
|
10
10
|
export let defaults = void 0;
|
|
11
11
|
export let noreset = false;
|
|
12
|
-
export let scale = false;
|
|
13
12
|
let key = false;
|
|
14
13
|
beforeUpdate(() => key = !key);
|
|
15
14
|
const resolveArgs = resolve;
|
|
@@ -25,8 +24,8 @@ let handlers = {};
|
|
|
25
24
|
See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/1-Content/1-Instance) for more details.
|
|
26
25
|
-->
|
|
27
26
|
|
|
28
|
-
<div class="instance" class:
|
|
29
|
-
<div class="content
|
|
27
|
+
<div class="instance" class:cside={expanded && "right" === $controlsState.position}>
|
|
28
|
+
<div class="content">
|
|
30
29
|
{#if noreset}
|
|
31
30
|
<slot props={resolveArgs(defaults ?? {}, bound)} events={handlers} {key} />
|
|
32
31
|
{:else}
|
|
@@ -36,7 +35,7 @@ let handlers = {};
|
|
|
36
35
|
{/if}
|
|
37
36
|
</div>
|
|
38
37
|
{#if expanded}
|
|
39
|
-
<div class="misc
|
|
38
|
+
<div class="misc">
|
|
40
39
|
<Props
|
|
41
40
|
infos={$controls.props}
|
|
42
41
|
bind:values={bound}
|
|
@@ -64,36 +63,20 @@ let handlers = {};
|
|
|
64
63
|
|
|
65
64
|
<style>
|
|
66
65
|
.instance {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.instance.scale {
|
|
71
|
-
transition: transform var(--i-nil-doc-transition-time);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.instance.scale:hover {
|
|
75
|
-
transform: scale(1.015);
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
76
68
|
}
|
|
77
69
|
|
|
78
70
|
.cside {
|
|
79
71
|
display: grid;
|
|
80
|
-
grid-template-columns: 1fr
|
|
72
|
+
grid-template-columns: 1fr 35rem;
|
|
81
73
|
}
|
|
82
74
|
|
|
83
75
|
.content {
|
|
84
|
-
min-height:
|
|
85
|
-
border-radius: 0.3125rem;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
div:not(.cside) > .misc {
|
|
89
|
-
border-bottom-left-radius: 0.3125rem;
|
|
90
|
-
border-bottom-right-radius: 0.3125rem;
|
|
91
|
-
user-select: none;
|
|
76
|
+
min-height: 6.25rem;
|
|
92
77
|
}
|
|
93
78
|
|
|
94
|
-
.
|
|
95
|
-
border-top-right-radius: 0.3125rem;
|
|
96
|
-
border-bottom-right-radius: 0.3125rem;
|
|
79
|
+
.misc {
|
|
97
80
|
user-select: none;
|
|
98
81
|
}
|
|
99
82
|
|
|
@@ -102,22 +85,9 @@ let handlers = {};
|
|
|
102
85
|
border: 1px solid var(--i-nil-doc-block-outline-color);
|
|
103
86
|
}
|
|
104
87
|
|
|
105
|
-
/* scrollable */
|
|
106
|
-
.scrollable {
|
|
107
|
-
overflow: scroll;
|
|
108
|
-
/* Firefox */
|
|
109
|
-
scrollbar-width: none;
|
|
110
|
-
/* IE and Edge */
|
|
111
|
-
-ms-overflow-style: none;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.scrollable::-webkit-scrollbar {
|
|
115
|
-
display: none;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
88
|
/* colors */
|
|
119
89
|
.instance {
|
|
120
|
-
transition: background-color
|
|
90
|
+
transition: background-color var(--i-nil-doc-transition-time);
|
|
121
91
|
color: var(--i-nil-doc-color);
|
|
122
92
|
background-color: var(--i-nil-doc-bg-color);
|
|
123
93
|
}
|
|
@@ -8,7 +8,6 @@ const orientation = getOrientation();
|
|
|
8
8
|
export let defaults = void 0;
|
|
9
9
|
export let noreset = false;
|
|
10
10
|
export let columns = false;
|
|
11
|
-
export let scale = false;
|
|
12
11
|
$:
|
|
13
12
|
$defaultsStore = defaults ?? {};
|
|
14
13
|
$:
|
|
@@ -28,7 +27,6 @@ const cast = (t) => t;
|
|
|
28
27
|
<Instance
|
|
29
28
|
defaults={resolveArgs($defaultsStore, param.values)}
|
|
30
29
|
{noreset}
|
|
31
|
-
{scale}
|
|
32
30
|
let:key
|
|
33
31
|
let:props
|
|
34
32
|
let:events
|
|
@@ -1,35 +1,22 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
const dark = getTheme();
|
|
1
|
+
<script>export let type;
|
|
3
2
|
</script>
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
<div> this component
|
|
7
|
-
<div> Header
|
|
8
|
-
<div></div>
|
|
9
|
-
<div></div>
|
|
10
|
-
<div></div>
|
|
11
|
-
</div>
|
|
12
|
-
<div> Controls
|
|
13
|
-
<div></div>
|
|
14
|
-
<div></div>
|
|
15
|
-
<div></div>
|
|
16
|
-
</div>
|
|
17
|
-
...
|
|
18
|
-
</div>
|
|
19
|
-
-->
|
|
20
|
-
<div class:dark={$dark}>
|
|
4
|
+
<div class:props={type === "props"} class:events={type === "events"}>
|
|
21
5
|
<slot />
|
|
22
6
|
</div>
|
|
23
7
|
|
|
24
8
|
<style>
|
|
25
9
|
div {
|
|
26
10
|
display: grid;
|
|
27
|
-
overflow: hidden;
|
|
28
11
|
min-width: 31.25rem;
|
|
29
12
|
grid-auto-rows: 2rem;
|
|
30
13
|
box-sizing: border-box;
|
|
31
14
|
}
|
|
32
15
|
|
|
16
|
+
div.events {
|
|
17
|
+
height: 22rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
33
20
|
div :global(*),
|
|
34
21
|
div :global(*::before),
|
|
35
22
|
div :global(*::after) {
|
|
@@ -39,15 +26,23 @@ const dark = getTheme();
|
|
|
39
26
|
|
|
40
27
|
div > :global(div) {
|
|
41
28
|
display: grid;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
div.props > :global(div) {
|
|
42
32
|
grid-template-columns: minmax(15rem, 1fr) 12.5rem 2.5rem;
|
|
43
33
|
}
|
|
44
34
|
|
|
35
|
+
div.events > :global(div) {
|
|
36
|
+
grid-template-columns: 2fr 3fr;
|
|
37
|
+
align-items: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
45
40
|
div > :global(div:first-child) {
|
|
46
41
|
font-weight: bold;
|
|
47
42
|
place-items: center;
|
|
48
43
|
}
|
|
49
44
|
|
|
50
|
-
div > :global(div > div:not(:first-child)) {
|
|
45
|
+
div.props > :global(div > div:not(:first-child)) {
|
|
51
46
|
display: grid;
|
|
52
47
|
place-items: center;
|
|
53
48
|
}
|
|
@@ -55,7 +50,6 @@ const dark = getTheme();
|
|
|
55
50
|
div > :global(div > div:not(:first-child) > *) {
|
|
56
51
|
width: 100%;
|
|
57
52
|
height: 80%;
|
|
58
|
-
font-size: 1rem;
|
|
59
53
|
}
|
|
60
54
|
|
|
61
55
|
/* colors */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import Styler from "
|
|
1
|
+
<script>import Styler from "../Styler.svelte";
|
|
2
2
|
export let visible;
|
|
3
3
|
export let events;
|
|
4
4
|
export let handlers;
|
|
@@ -41,7 +41,7 @@ $:
|
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
{#if visible}
|
|
44
|
-
<Styler>
|
|
44
|
+
<Styler type={"events"}>
|
|
45
45
|
<slot />
|
|
46
46
|
{#each history as { count, detail, name }, i (i)}
|
|
47
47
|
<div>
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script context="module">import Picker from "vanilla-picker";
|
|
2
|
+
const colorSetter = (format, color) => {
|
|
3
|
+
switch (format) {
|
|
4
|
+
case "hex":
|
|
5
|
+
return color.hex.substring(0, 7);
|
|
6
|
+
case "hexa":
|
|
7
|
+
return color.hex.substring(0, 9);
|
|
8
|
+
case "hsl":
|
|
9
|
+
return color.hslString;
|
|
10
|
+
case "hsla":
|
|
11
|
+
return color.hslaString;
|
|
12
|
+
case "rgb":
|
|
13
|
+
return color.rgbString;
|
|
14
|
+
case "rgba":
|
|
15
|
+
return color.rgbaString;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script>import { getName, getFormat } from "./misc/utils";
|
|
2
21
|
import { defaulter } from "./misc/defaulter";
|
|
3
22
|
import NameHeader from "./misc/Name.svelte";
|
|
4
23
|
export let value;
|
|
@@ -8,6 +27,30 @@ export let disabled = false;
|
|
|
8
27
|
export let visible = false;
|
|
9
28
|
let ivalue = value ?? defaulter(info);
|
|
10
29
|
let enabled = value !== void 0;
|
|
30
|
+
const action = (d, format) => {
|
|
31
|
+
d.style.borderColor = ivalue;
|
|
32
|
+
const picker = new Picker({
|
|
33
|
+
parent: d,
|
|
34
|
+
popup: "left",
|
|
35
|
+
editorFormat: format.substring(0, 3),
|
|
36
|
+
editor: false,
|
|
37
|
+
alpha: format.length === 4,
|
|
38
|
+
onChange: (color) => {
|
|
39
|
+
ivalue = colorSetter(getFormat(info), color);
|
|
40
|
+
d.style.borderColor = ivalue;
|
|
41
|
+
},
|
|
42
|
+
color: ivalue
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
update: (format2) => {
|
|
46
|
+
picker.setOptions({
|
|
47
|
+
alpha: format2.length === 4,
|
|
48
|
+
editorFormat: format2.substring(0, 3)
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
destroy: () => picker.destroy()
|
|
52
|
+
};
|
|
53
|
+
};
|
|
11
54
|
$:
|
|
12
55
|
value = enabled && !disabled ? ivalue : void 0;
|
|
13
56
|
</script>
|
|
@@ -15,7 +58,37 @@ $:
|
|
|
15
58
|
{#if visible}
|
|
16
59
|
<div>
|
|
17
60
|
<NameHeader name={getName(info)} {depth} />
|
|
18
|
-
<
|
|
61
|
+
<button use:action={getFormat(info)} disabled={!enabled || disabled}>
|
|
62
|
+
{ivalue}
|
|
63
|
+
</button>
|
|
19
64
|
<div><input type="checkbox" bind:checked={enabled} {disabled} /></div>
|
|
20
65
|
</div>
|
|
21
66
|
{/if}
|
|
67
|
+
|
|
68
|
+
<style>
|
|
69
|
+
button {
|
|
70
|
+
font-size: 0.6rem;
|
|
71
|
+
border-top-width: 1px;
|
|
72
|
+
border-bottom-width: 1px;
|
|
73
|
+
border-left-width: 10px;
|
|
74
|
+
border-right-width: 10px;
|
|
75
|
+
border-style: solid;
|
|
76
|
+
background-color: var(--i-nil-doc-bg-color);
|
|
77
|
+
outline: 1px solid gray;
|
|
78
|
+
margin-top: 3px;
|
|
79
|
+
margin-bottom: 3px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
button :global(.picker_wrapper),
|
|
83
|
+
button :global(.picker_arrow),
|
|
84
|
+
button :global(.picker_arrow::before),
|
|
85
|
+
button :global(.picker_arrow::after) {
|
|
86
|
+
background-color: var(--i-nil-doc-bg-color) !important;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
button :global(.picker_done > button) {
|
|
90
|
+
background-image: initial;
|
|
91
|
+
background-color: var(--i-nil-doc-bg-color);
|
|
92
|
+
color: var(--i-nil-doc-color);
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script>import Component from "./Component.svelte";
|
|
2
|
-
import Styler from "
|
|
2
|
+
import Styler from "../Styler.svelte";
|
|
3
3
|
import { getName } from "./misc/utils";
|
|
4
4
|
export let infos;
|
|
5
5
|
export let values;
|
|
6
6
|
export let visible;
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
<Styler>
|
|
9
|
+
<Styler type={"props"}>
|
|
10
10
|
{#if visible}
|
|
11
11
|
<slot />
|
|
12
12
|
{/if}
|
|
13
13
|
{#each infos as info}
|
|
14
|
-
<Component {info} bind:value={values[getName(info)]} depth={
|
|
14
|
+
<Component {info} bind:value={values[getName(info)]} depth={1} {visible} />
|
|
15
15
|
{/each}
|
|
16
16
|
</Styler>
|
|
@@ -3,7 +3,7 @@ export let name;
|
|
|
3
3
|
export let expand = void 0;
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
|
-
<div class="override" style:padding-left={`${depth}
|
|
6
|
+
<div class="override" style:padding-left={`${depth}rem`} title={name}>
|
|
7
7
|
<div class="icon" class:expand={expand === true}>
|
|
8
8
|
<div>
|
|
9
9
|
{expand === undefined ? "-" : ">"}
|
|
@@ -17,10 +17,10 @@ export let expand = void 0;
|
|
|
17
17
|
overflow: hidden;
|
|
18
18
|
white-space: nowrap;
|
|
19
19
|
text-overflow: ellipsis;
|
|
20
|
-
padding-right:
|
|
20
|
+
padding-right: 0.5rem;
|
|
21
21
|
|
|
22
22
|
display: grid;
|
|
23
|
-
grid-template-columns:
|
|
23
|
+
grid-template-columns: 1.25rem 1fr;
|
|
24
24
|
align-items: center;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -28,8 +28,8 @@ export let expand = void 0;
|
|
|
28
28
|
display: flex;
|
|
29
29
|
flex-direction: column;
|
|
30
30
|
justify-content: center;
|
|
31
|
-
height:
|
|
32
|
-
width:
|
|
31
|
+
height: 1rem;
|
|
32
|
+
width: 1rem;
|
|
33
33
|
transition: transform var(--i-nil-doc-transition-time);
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -7,4 +7,5 @@ export declare function defaulter(i: Unionized<PropType<"range">>): number;
|
|
|
7
7
|
export declare function defaulter(i: Unionized<PropType<"select">>): string;
|
|
8
8
|
export declare function defaulter(i: Unionized<PropType<"text">>): string;
|
|
9
9
|
export declare function defaulter(i: Unionized<PropType<"switch">>): boolean;
|
|
10
|
+
export declare function defaulter(i: Unionized<PropType<"color">>): string;
|
|
10
11
|
export declare function defaulter(i: Prop): ValueType;
|
|
@@ -5,7 +5,8 @@ export declare function getValues(info: Unionized<PropType<"select">>): Values<"
|
|
|
5
5
|
export declare function getValues(info: Unionized<PropType<"object">>): Values<"object">;
|
|
6
6
|
export declare function getValues(info: Unionized<PropType<"tuple">>): Values<"tuple">;
|
|
7
7
|
export declare const getMin: (info: Unionized<PropType<"range">>) => number;
|
|
8
|
-
export declare const getType: (info: Prop) => "number" | "object" | "select" | "text" | "
|
|
8
|
+
export declare const getType: (info: Prop) => "number" | "object" | "select" | "text" | "switch" | "range" | "tuple" | "color";
|
|
9
|
+
export declare const getFormat: (info: Unionized<PropType<"color">>) => import("../../types").ColorFormat;
|
|
9
10
|
export declare const getName: (info: Prop) => string;
|
|
10
11
|
export declare const addName: (name: string, info: NonNamedProp) => Prop;
|
|
11
12
|
export {};
|
|
@@ -17,6 +17,12 @@ export const getType = (info) => {
|
|
|
17
17
|
}
|
|
18
18
|
return info.type;
|
|
19
19
|
};
|
|
20
|
+
export const getFormat = (info) => {
|
|
21
|
+
if (info instanceof Array) {
|
|
22
|
+
return info[2];
|
|
23
|
+
}
|
|
24
|
+
return info.format;
|
|
25
|
+
};
|
|
20
26
|
export const getName = (info) => {
|
|
21
27
|
if (info instanceof Array) {
|
|
22
28
|
return info[0];
|