@nil-/doc 0.2.36 → 0.2.38
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 +56 -50
- package/components/Layout.svelte +32 -18
- package/components/Layout.svelte.d.ts +1 -0
- package/components/block/Block.svelte +34 -17
- package/components/block/Block.svelte.d.ts +1 -0
- package/components/block/Controls.svelte +6 -1
- package/components/block/Controls.svelte.d.ts +1 -0
- package/components/block/Instance.svelte +111 -7
- package/components/block/Params.svelte +15 -18
- package/components/block/Params.svelte.d.ts +1 -0
- package/components/block/Template.svelte +17 -150
- package/components/block/Template.svelte.d.ts +1 -0
- package/components/block/context.d.ts +2 -2
- package/components/block/context.js +2 -1
- package/components/block/controls/misc/Styler.svelte +3 -2
- package/components/context.d.ts +0 -1
- package/components/context.js +0 -6
- package/components/etc/Container.svelte +19 -19
- package/components/etc/Container.svelte.d.ts +3 -3
- package/components/etc/ThemeIcon.svelte +1 -7
- package/components/navigation/Nav.svelte +12 -8
- package/components/navigation/Nav.svelte.d.ts +1 -3
- package/components/navigation/Node.svelte +1 -1
- package/components/navigation/Tree.svelte +1 -1
- package/components/navigation/utils/fuzz.d.ts +1 -0
- package/components/navigation/utils/fuzz.js +119 -0
- package/components/navigation/utils/renamer.d.ts +9 -0
- package/components/navigation/utils/renamer.js +15 -0
- package/components/navigation/utils/sort.d.ts +2 -0
- package/components/navigation/utils/sort.js +3 -0
- package/components/navigation/{utils.d.ts → utils/sorter.d.ts} +2 -12
- package/components/navigation/{utils.js → utils/sorter.js} +1 -17
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
# @nil-/doc
|
|
2
2
|
|
|
3
|
+
## 0.2.38
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [doc][new] added fuzzy match for nav filter ([#59](https://github.com/njaldea/mono/pull/59))
|
|
8
|
+
|
|
9
|
+
## 0.2.37
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [doc][fix] params prop is now reactive ([#57](https://github.com/njaldea/mono/pull/57))
|
|
14
|
+
- [doc][docu] added component documentation link to deployment ([#57](https://github.com/njaldea/mono/pull/57))
|
|
15
|
+
- [doc][patch] removed inRoot ([#57](https://github.com/njaldea/mono/pull/57))
|
|
16
|
+
- [doc][patch] refactored Instance/Template/Params ([#57](https://github.com/njaldea/mono/pull/57))
|
|
17
|
+
|
|
3
18
|
## 0.2.36
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
6
21
|
|
|
7
22
|
- [doc][fix] color changes and transition ([#55](https://github.com/njaldea/mono/pull/55))
|
|
8
|
-
|
|
9
|
-
- [all] added html meta details ([#55](https://github.com/njaldea/mono/pull/55))
|
|
23
|
+
- [doc][patch] added html meta details ([#55](https://github.com/njaldea/mono/pull/55))
|
|
10
24
|
|
|
11
25
|
## 0.2.35
|
|
12
26
|
|
|
13
27
|
### Patch Changes
|
|
14
28
|
|
|
15
|
-
- [doc] changed Control "side" flag to "position" prop ([#53](https://github.com/njaldea/mono/pull/53))
|
|
16
|
-
|
|
17
|
-
- [misc] added nil icon ([#53](https://github.com/njaldea/mono/pull/53))
|
|
29
|
+
- [doc][break] changed Control "side" flag to "position" prop ([#53](https://github.com/njaldea/mono/pull/53))
|
|
30
|
+
- [doc][new] added nil icon ([#53](https://github.com/njaldea/mono/pull/53))
|
|
18
31
|
|
|
19
32
|
## 0.2.34
|
|
20
33
|
|
|
@@ -28,21 +41,20 @@
|
|
|
28
41
|
|
|
29
42
|
### Patch Changes
|
|
30
43
|
|
|
31
|
-
- [doc] update formatting (camel case use) ([#49](https://github.com/njaldea/mono/pull/49))
|
|
44
|
+
- [doc][patch] update formatting (camel case use) ([#49](https://github.com/njaldea/mono/pull/49))
|
|
32
45
|
|
|
33
46
|
## 0.2.32
|
|
34
47
|
|
|
35
48
|
### Patch Changes
|
|
36
49
|
|
|
37
|
-
- [doc] relaxed file extension for sveltekit helper ([#47](https://github.com/njaldea/mono/pull/47))
|
|
50
|
+
- [doc][new] relaxed file extension for sveltekit helper ([#47](https://github.com/njaldea/mono/pull/47))
|
|
38
51
|
|
|
39
52
|
## 0.2.31
|
|
40
53
|
|
|
41
54
|
### Patch Changes
|
|
42
55
|
|
|
43
|
-
- [doc] better container style ([#45](https://github.com/njaldea/mono/pull/45))
|
|
44
|
-
|
|
45
|
-
- [doc] improved ThemeIcon ([#45](https://github.com/njaldea/mono/pull/45))
|
|
56
|
+
- [doc][patch] better container style ([#45](https://github.com/njaldea/mono/pull/45))
|
|
57
|
+
- [doc][patch] improved ThemeIcon ([#45](https://github.com/njaldea/mono/pull/45))
|
|
46
58
|
|
|
47
59
|
## 0.2.30
|
|
48
60
|
|
|
@@ -69,56 +81,56 @@
|
|
|
69
81
|
|
|
70
82
|
### Patch Changes
|
|
71
83
|
|
|
72
|
-
- [doc] fix fira code css import ([#35](https://github.com/njaldea/mono/pull/35))
|
|
84
|
+
- [doc][fix] fix fira code css import ([#35](https://github.com/njaldea/mono/pull/35))
|
|
73
85
|
|
|
74
86
|
## 0.2.26
|
|
75
87
|
|
|
76
88
|
### Patch Changes
|
|
77
89
|
|
|
78
|
-
- [doc] removed fallback page in documentation ([#30](https://github.com/njaldea/mono/pull/30))
|
|
90
|
+
- [doc][docu] removed fallback page in documentation ([#30](https://github.com/njaldea/mono/pull/30))
|
|
79
91
|
|
|
80
92
|
## 0.2.25
|
|
81
93
|
|
|
82
94
|
### Patch Changes
|
|
83
95
|
|
|
84
|
-
- 186187c: [doc][
|
|
85
|
-
- 186187c: [doc] fix range tooltip styling
|
|
86
|
-
- a82c0de: [doc] support dark/light mode
|
|
96
|
+
- 186187c: [doc][new] removed layout slot prop for content. all unnamed slots will be part of the default slot
|
|
97
|
+
- 186187c: [doc][fix] fix range tooltip styling
|
|
98
|
+
- a82c0de: [doc][new] support dark/light mode
|
|
87
99
|
|
|
88
100
|
## 0.2.24
|
|
89
101
|
|
|
90
102
|
### Patch Changes
|
|
91
103
|
|
|
92
|
-
- 782e6fa: [doc][
|
|
93
|
-
- 782e6fa: [doc] added documentation to public methods
|
|
104
|
+
- 782e6fa: [doc][new] simplified sveltekit glue layer
|
|
105
|
+
- 782e6fa: [doc][docu] added documentation to public methods
|
|
94
106
|
|
|
95
107
|
## 0.2.23
|
|
96
108
|
|
|
97
109
|
### Patch Changes
|
|
98
110
|
|
|
99
|
-
- 5655f86: [
|
|
100
|
-
- 5655f86: [
|
|
111
|
+
- 5655f86: [doc][new] added slot prop `key` to Template component
|
|
112
|
+
- 5655f86: [doc][patch] moved some devDependencies to peerDependencies
|
|
101
113
|
|
|
102
114
|
## 0.2.22
|
|
103
115
|
|
|
104
116
|
### Patch Changes
|
|
105
117
|
|
|
106
|
-
- 3ce0a62: [doc] support for touch event via pointerevent (draggable container)
|
|
118
|
+
- 3ce0a62: [doc][new] support for touch event via pointerevent (draggable container)
|
|
107
119
|
|
|
108
120
|
## 0.2.21
|
|
109
121
|
|
|
110
122
|
### Patch Changes
|
|
111
123
|
|
|
112
124
|
- 0398a72: [doc][fix] remove dependency on box-sizing
|
|
113
|
-
|
|
114
|
-
|
|
125
|
+
- 0398a72: [doc][fix] control min width
|
|
126
|
+
- 0398a72: [doc][new] made template configurable by column prop
|
|
115
127
|
|
|
116
128
|
## 0.2.20
|
|
117
129
|
|
|
118
130
|
### Patch Changes
|
|
119
131
|
|
|
120
132
|
- 3eee0ce: [doc][fix] removed setting of margin/padding
|
|
121
|
-
|
|
133
|
+
- 3eee0ce: [doc][fix] only propagate box-sizing (inherit)
|
|
122
134
|
|
|
123
135
|
## 0.2.19
|
|
124
136
|
|
|
@@ -136,68 +148,62 @@
|
|
|
136
148
|
|
|
137
149
|
### Patch Changes
|
|
138
150
|
|
|
139
|
-
- af86341: [doc] moved default mapping in a common lib
|
|
140
|
-
|
|
141
|
-
|
|
151
|
+
- af86341: [doc][fix] moved default mapping in a common lib
|
|
152
|
+
- af86341: [doc][fix] fix typing
|
|
153
|
+
- af86341: [doc][patch] if Param's tag is not provided, use stringified id
|
|
142
154
|
|
|
143
155
|
## 0.2.16
|
|
144
156
|
|
|
145
157
|
### Patch Changes
|
|
146
158
|
|
|
147
|
-
- 650eb4b: [doc] revived proper ordering of params
|
|
148
|
-
|
|
159
|
+
- 650eb4b: [doc][fix] revived proper ordering of params
|
|
160
|
+
- 650eb4b: [doc][new] each param now has its own defaults (which is resolved from template's default and pram's props)
|
|
149
161
|
|
|
150
162
|
## 0.2.15
|
|
151
163
|
|
|
152
164
|
### Patch Changes
|
|
153
165
|
|
|
154
|
-
- 44a7113: [doc] added documentation for internal Container
|
|
155
|
-
|
|
156
|
-
|
|
166
|
+
- 44a7113: [doc][docu] added documentation for internal Container
|
|
167
|
+
- 44a7113: [doc][new] adjusted api for load (now `routes`)
|
|
168
|
+
- 44a7113: [doc][fix] fix for layout group route
|
|
157
169
|
|
|
158
170
|
## 0.2.14
|
|
159
171
|
|
|
160
172
|
### Patch Changes
|
|
161
173
|
|
|
162
|
-
- 6265fa6: [doc] added Tuple and Object Controls
|
|
163
|
-
|
|
174
|
+
- 6265fa6: [doc][new] added Tuple and Object Controls
|
|
175
|
+
- 6265fa6: [doc][docu] added temporary internal doc
|
|
164
176
|
|
|
165
177
|
## 0.2.13
|
|
166
178
|
|
|
167
179
|
### Patch Changes
|
|
168
180
|
|
|
169
|
-
- 39dbce9: [doc] navigation now automatically opens when redirected to a route that is still collapsed
|
|
181
|
+
- 39dbce9: [doc][new] navigation now automatically opens when redirected to a route that is still collapsed
|
|
170
182
|
|
|
171
183
|
## 0.2.12
|
|
172
184
|
|
|
173
185
|
### Patch Changes
|
|
174
186
|
|
|
175
|
-
- 6c2d946: [fix] Nav now is not scrollable
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
## 0.2.11
|
|
184
|
-
|
|
185
|
-
### Patch Changes
|
|
186
|
-
|
|
187
|
-
- 8d16322: noop
|
|
187
|
+
- 6c2d946: [doc][fix] Nav now is not scrollable
|
|
188
|
+
- 6c2d946: [doc][fix] Removes Container's "reversed" flag
|
|
189
|
+
- 6c2d946: [doc][fix] Adds "secondary" flag to Container
|
|
190
|
+
- 6c2d946: [doc][fix] Changes Container slot name (primary is top or left, seconadry is bottom or right)
|
|
191
|
+
- 6c2d946: [doc][fix] load now removes routes with parameters
|
|
192
|
+
- 6c2d946: [doc][fix] Template now supports `noreset`
|
|
193
|
+
- 6c2d946: [doc][fix] Updates documentation
|
|
188
194
|
|
|
189
195
|
## 0.2.10
|
|
190
196
|
|
|
191
197
|
### Patch Changes
|
|
192
198
|
|
|
193
|
-
- c6de380: [
|
|
194
|
-
|
|
199
|
+
- c6de380: [doc][new] container collapsing now supported
|
|
200
|
+
- c6de380: [doc][patch] styling of container now uses grid for easier handling
|
|
195
201
|
|
|
196
202
|
## 0.2.9
|
|
197
203
|
|
|
198
204
|
### Patch Changes
|
|
199
205
|
|
|
200
|
-
- 5c10f11: [
|
|
206
|
+
- 5c10f11: [doc][patch] layout fill height
|
|
201
207
|
|
|
202
208
|
## 0.2.8
|
|
203
209
|
|
package/components/Layout.svelte
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
gap: 1px;
|
|
9
9
|
width: 100%;
|
|
10
10
|
height: 100%;
|
|
11
|
+
box-sizing: border-box;
|
|
11
12
|
font-family: "Fira Code", "Courier New", Courier, monospace;
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -26,6 +27,16 @@
|
|
|
26
27
|
overflow: hidden;
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
.icon {
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
transition: transform 350ms;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.icon:hover {
|
|
37
|
+
transform: scale(1.5);
|
|
38
|
+
}
|
|
39
|
+
|
|
29
40
|
.content {
|
|
30
41
|
height: 100%;
|
|
31
42
|
padding: 5px;
|
|
@@ -34,14 +45,6 @@
|
|
|
34
45
|
box-sizing: border-box;
|
|
35
46
|
}
|
|
36
47
|
|
|
37
|
-
/* reset block */
|
|
38
|
-
.reset {
|
|
39
|
-
width: 100%;
|
|
40
|
-
height: 100%;
|
|
41
|
-
box-sizing: border-box;
|
|
42
|
-
font-family: "Fira Code", "Courier New", Courier, monospace;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
48
|
/* scrollable */
|
|
46
49
|
.scrollable {
|
|
47
50
|
overflow: scroll;
|
|
@@ -81,7 +84,7 @@
|
|
|
81
84
|
</script>
|
|
82
85
|
<script>import Container from "./etc/Container.svelte";
|
|
83
86
|
import Nav from "./navigation/Nav.svelte";
|
|
84
|
-
import {
|
|
87
|
+
import { getTheme, initTheme, evalTheme } from "./context";
|
|
85
88
|
import ThemeIcon from "./etc/ThemeIcon.svelte";
|
|
86
89
|
import NilIcon from "./etc/NilIcon.svelte";
|
|
87
90
|
export let data;
|
|
@@ -89,21 +92,32 @@ export let current = null;
|
|
|
89
92
|
export let sorter = null;
|
|
90
93
|
export let renamer = null;
|
|
91
94
|
export let theme = void 0;
|
|
92
|
-
const r = inRoot();
|
|
93
95
|
const parentTheme = getTheme();
|
|
94
|
-
const
|
|
96
|
+
const dark = initTheme();
|
|
95
97
|
$:
|
|
96
|
-
$
|
|
98
|
+
$dark = evalTheme(parentTheme ? $parentTheme : true, theme);
|
|
97
99
|
</script>
|
|
98
|
-
|
|
100
|
+
<!--
|
|
101
|
+
@component
|
|
102
|
+
See [documentation](https://mono-doc.vercel.app/3-Components/1-Layout) for more details.
|
|
103
|
+
-->
|
|
104
|
+
<div class="layout" class:dark={$dark}>
|
|
99
105
|
<div class="top">
|
|
100
106
|
<slot name="title"><span>@nil-/doc</span></slot>
|
|
101
|
-
<
|
|
102
|
-
|
|
107
|
+
<div class="icon" on:click={() => ($dark = !$dark)} on:keypress={null}>
|
|
108
|
+
<ThemeIcon bind:dark={$dark} />
|
|
109
|
+
</div>
|
|
110
|
+
<div
|
|
111
|
+
class="icon"
|
|
112
|
+
title="Double click to open repo: https://github.com/njaldea/mono"
|
|
113
|
+
on:dblclick={() => window.open("https://github.com/njaldea/mono", "_blank")}
|
|
114
|
+
>
|
|
115
|
+
<NilIcon />
|
|
116
|
+
</div>
|
|
103
117
|
</div>
|
|
104
118
|
<div class="main">
|
|
105
|
-
<Container offset={250} vertical
|
|
106
|
-
<svelte:fragment slot="
|
|
119
|
+
<Container offset={250} vertical b>
|
|
120
|
+
<svelte:fragment slot="A">
|
|
107
121
|
<div class="content scrollable">
|
|
108
122
|
<Nav
|
|
109
123
|
info={data}
|
|
@@ -114,7 +128,7 @@ $:
|
|
|
114
128
|
/>
|
|
115
129
|
</div>
|
|
116
130
|
</svelte:fragment>
|
|
117
|
-
<svelte:fragment slot="
|
|
131
|
+
<svelte:fragment slot="B">
|
|
118
132
|
<div class="content scrollable">
|
|
119
133
|
{#key current}
|
|
120
134
|
<slot />
|
|
@@ -22,6 +22,7 @@ declare const __propDef: {
|
|
|
22
22
|
export type LayoutProps = typeof __propDef.props;
|
|
23
23
|
export type LayoutEvents = typeof __propDef.events;
|
|
24
24
|
export type LayoutSlots = typeof __propDef.slots;
|
|
25
|
+
/** See [documentation](https://mono-doc.vercel.app/3-Components/1-Layout) for more details. */
|
|
25
26
|
export default class Layout extends SvelteComponentTyped<LayoutProps, LayoutEvents, LayoutSlots> {
|
|
26
27
|
}
|
|
27
28
|
export {};
|
|
@@ -2,46 +2,63 @@
|
|
|
2
2
|
@import url("https://fonts.googleapis.com/css?family=Fira%20Code");
|
|
3
3
|
|
|
4
4
|
div {
|
|
5
|
-
display:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
display: grid;
|
|
6
|
+
border-radius: 5px;
|
|
7
|
+
grid-auto-rows: 1fr;
|
|
8
|
+
grid-auto-columns: auto;
|
|
9
|
+
grid-auto-flow: row;
|
|
9
10
|
|
|
10
|
-
/* reset block */
|
|
11
|
-
.reset {
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 100%;
|
|
14
11
|
box-sizing: border-box;
|
|
15
12
|
font-family: "Fira Code", "Courier New", Courier, monospace;
|
|
13
|
+
padding: 13px 3px;
|
|
14
|
+
gap: 3px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
div.columns {
|
|
18
|
+
grid-auto-rows: auto;
|
|
19
|
+
grid-auto-columns: 1fr;
|
|
20
|
+
grid-auto-flow: column;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
/* colors */
|
|
19
24
|
div {
|
|
20
25
|
color-scheme: light;
|
|
21
|
-
color: hsl(0,
|
|
22
|
-
|
|
26
|
+
color: hsl(0, 0%, 0%);
|
|
27
|
+
background-color: hsl(0, 2%, 70%);
|
|
28
|
+
transition: color 350ms, background-color 350ms;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
div.dark {
|
|
26
32
|
color-scheme: dark;
|
|
27
|
-
color: hsl(
|
|
33
|
+
color: hsl(0, 0%, 80%);
|
|
34
|
+
background-color: hsl(0, 2%, 40%);
|
|
28
35
|
}
|
|
29
36
|
</style>
|
|
30
37
|
|
|
31
|
-
<script>import {
|
|
32
|
-
|
|
38
|
+
<script>import {
|
|
39
|
+
initParams,
|
|
40
|
+
initDefaults,
|
|
41
|
+
initControls,
|
|
42
|
+
initControlsState,
|
|
43
|
+
initOrientation
|
|
44
|
+
} from "./context";
|
|
45
|
+
import { getTheme, initTheme, evalTheme } from "../context";
|
|
33
46
|
initParams();
|
|
34
47
|
initDefaults();
|
|
35
48
|
initControls();
|
|
36
49
|
initControlsState();
|
|
37
|
-
const
|
|
50
|
+
const columns = initOrientation();
|
|
38
51
|
export let theme = void 0;
|
|
39
52
|
const parentTheme = getTheme();
|
|
40
|
-
const
|
|
53
|
+
const dark = initTheme();
|
|
41
54
|
$:
|
|
42
|
-
$
|
|
55
|
+
$dark = evalTheme(parentTheme ? $parentTheme : false, theme);
|
|
43
56
|
</script>
|
|
44
|
-
|
|
57
|
+
<!--
|
|
58
|
+
@component
|
|
59
|
+
See [documentation](https://mono-doc.vercel.app/3-Components/2-Block) for more details.
|
|
60
|
+
-->
|
|
61
|
+
<div class:columns={$columns} class:dark={$dark}>
|
|
45
62
|
<slot />
|
|
46
63
|
</div>
|
|
47
64
|
|
|
@@ -14,6 +14,7 @@ declare const __propDef: {
|
|
|
14
14
|
export type BlockProps = typeof __propDef.props;
|
|
15
15
|
export type BlockEvents = typeof __propDef.events;
|
|
16
16
|
export type BlockSlots = typeof __propDef.slots;
|
|
17
|
+
/** See [documentation](https://mono-doc.vercel.app/3-Components/2-Block) for more details. */
|
|
17
18
|
export default class Block extends SvelteComponentTyped<BlockProps, BlockEvents, BlockSlots> {
|
|
18
19
|
}
|
|
19
20
|
export {};
|
|
@@ -4,10 +4,15 @@ export let props = [];
|
|
|
4
4
|
export let hide = false;
|
|
5
5
|
export let position = void 0;
|
|
6
6
|
const controls = getControls();
|
|
7
|
-
|
|
7
|
+
$:
|
|
8
|
+
$controls = props;
|
|
8
9
|
const state = getControlsState();
|
|
9
10
|
$:
|
|
10
11
|
$state.hide = hide;
|
|
11
12
|
$:
|
|
12
13
|
$state.position = position;
|
|
13
14
|
</script>
|
|
15
|
+
<!--
|
|
16
|
+
@component
|
|
17
|
+
See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/3-Controls) for more details.
|
|
18
|
+
-->
|
|
@@ -14,6 +14,7 @@ declare const __propDef: {
|
|
|
14
14
|
export type ControlsProps = typeof __propDef.props;
|
|
15
15
|
export type ControlsEvents = typeof __propDef.events;
|
|
16
16
|
export type ControlsSlots = typeof __propDef.slots;
|
|
17
|
+
/** See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/3-Controls) for more details. */
|
|
17
18
|
export default class Controls extends SvelteComponentTyped<ControlsProps, ControlsEvents, ControlsSlots> {
|
|
18
19
|
}
|
|
19
20
|
export {};
|
|
@@ -1,11 +1,115 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
div {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
}
|
|
1
5
|
|
|
2
|
-
|
|
3
|
-
|
|
6
|
+
.instance {
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.cside {
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-columns: 1fr 550px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.content {
|
|
16
|
+
min-height: 100px;
|
|
17
|
+
border-radius: 5px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
div:not(.cside) > .misc {
|
|
21
|
+
border-bottom-left-radius: 5px;
|
|
22
|
+
border-bottom-right-radius: 5px;
|
|
23
|
+
user-select: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.cside > .misc {
|
|
27
|
+
border-top-right-radius: 5px;
|
|
28
|
+
border-bottom-right-radius: 5px;
|
|
29
|
+
user-select: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.content,
|
|
33
|
+
.misc {
|
|
34
|
+
border-style: solid;
|
|
35
|
+
border-width: 1px;
|
|
36
|
+
padding: 2px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* scrollable */
|
|
40
|
+
.scrollable {
|
|
41
|
+
overflow: scroll;
|
|
42
|
+
scrollbar-width: none; /* Firefox */
|
|
43
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.scrollable::-webkit-scrollbar {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* colors */
|
|
51
|
+
.content,
|
|
52
|
+
.misc {
|
|
53
|
+
border-color: hsl(0, 2%, 60%);
|
|
54
|
+
background-color: hsl(0, 0%, 100%);
|
|
55
|
+
transition: border-color 350ms, background-color 350ms;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.dark.content,
|
|
59
|
+
.dark.misc {
|
|
60
|
+
border-color: hsl(0, 2%, 40%);
|
|
61
|
+
background-color: hsl(200, 4%, 14%);
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
64
|
+
|
|
65
|
+
<script>import { beforeUpdate } from "svelte";
|
|
66
|
+
import { cquery } from "./action";
|
|
67
|
+
import { getControls, getControlsState } from "./context";
|
|
68
|
+
import { getTheme } from "../context";
|
|
69
|
+
import Controls from "./controls/Controls.svelte";
|
|
70
|
+
import { resolve } from "./utils";
|
|
71
|
+
const controls = getControls();
|
|
72
|
+
const controlsState = getControlsState();
|
|
73
|
+
const dark = getTheme();
|
|
74
|
+
$:
|
|
75
|
+
expanded = $controls.length > 0 && !$controlsState.hide;
|
|
4
76
|
export let defaults = void 0;
|
|
5
77
|
export let noreset = false;
|
|
6
|
-
|
|
78
|
+
let key = false;
|
|
79
|
+
beforeUpdate(() => key = !key);
|
|
80
|
+
const resolveArgs = resolve;
|
|
81
|
+
let bound = {};
|
|
82
|
+
const updateBound = (d) => {
|
|
83
|
+
bound = resolve(d ?? {}, {});
|
|
84
|
+
};
|
|
85
|
+
$:
|
|
86
|
+
updateBound(defaults);
|
|
7
87
|
</script>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
88
|
+
<div
|
|
89
|
+
class="instance"
|
|
90
|
+
class:cside={expanded && "right" === $controlsState.position}
|
|
91
|
+
use:cquery={{
|
|
92
|
+
class: "cside",
|
|
93
|
+
min: 1000,
|
|
94
|
+
w: true,
|
|
95
|
+
enabled: expanded && $controlsState.position === undefined
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
{#if noreset}
|
|
99
|
+
<div class="content scrollable" class:dark={$dark}>
|
|
100
|
+
<slot props={resolveArgs(defaults ?? {}, bound)} {key} />
|
|
101
|
+
</div>
|
|
102
|
+
{:else}
|
|
103
|
+
{#key key}
|
|
104
|
+
<div class="content scrollable" class:dark={$dark}>
|
|
105
|
+
<slot props={resolveArgs(defaults ?? {}, bound)} {key} />
|
|
106
|
+
</div>
|
|
107
|
+
{/key}
|
|
108
|
+
{/if}
|
|
109
|
+
{#if expanded}
|
|
110
|
+
<div class="misc scrollable" class:dark={$dark}>
|
|
111
|
+
<Controls infos={$controls} bind:values={bound} />
|
|
112
|
+
</div>
|
|
113
|
+
{/if}
|
|
114
|
+
</div>
|
|
115
|
+
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
<script>import {
|
|
3
|
-
import { getParams, getDefaults } from "./context";
|
|
2
|
+
<script>import { getParams } from "./context";
|
|
4
3
|
import { resolve } from "./utils";
|
|
5
4
|
export let tag = void 0;
|
|
6
5
|
export let props = {};
|
|
7
|
-
const defaults = getDefaults();
|
|
8
6
|
const params = getParams();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
]);
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
);
|
|
7
|
+
const id = $params.length;
|
|
8
|
+
$params.push({
|
|
9
|
+
id,
|
|
10
|
+
tag: tag ?? `${id}`,
|
|
11
|
+
values: resolve(props, {})
|
|
12
|
+
});
|
|
13
|
+
$:
|
|
14
|
+
$params[id].tag = tag ?? `${id}`;
|
|
15
|
+
$:
|
|
16
|
+
$params[id].values = resolve(props, {});
|
|
24
17
|
</script>
|
|
18
|
+
<!--
|
|
19
|
+
@component
|
|
20
|
+
See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/2-Template/1-Params) for more details.
|
|
21
|
+
-->
|
|
@@ -13,6 +13,7 @@ declare const __propDef: {
|
|
|
13
13
|
export type ParamsProps = typeof __propDef.props;
|
|
14
14
|
export type ParamsEvents = typeof __propDef.events;
|
|
15
15
|
export type ParamsSlots = typeof __propDef.slots;
|
|
16
|
+
/** See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/2-Template/1-Params) for more details. */
|
|
16
17
|
export default class Params extends SvelteComponentTyped<ParamsProps, ParamsEvents, ParamsSlots> {
|
|
17
18
|
}
|
|
18
19
|
export {};
|