@nil-/doc 0.2.50 → 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 +29 -0
- package/components/Base.svelte +65 -0
- package/components/Base.svelte.d.ts +19 -0
- package/components/block/Block.svelte +71 -24
- package/components/block/Controls.svelte +3 -5
- package/components/block/Controls.svelte.d.ts +2 -2
- package/components/block/Instance.svelte +39 -89
- package/components/block/context.d.ts +2 -2
- package/components/block/context.js +2 -1
- package/components/block/controls/events/Events.svelte +14 -5
- package/components/block/controls/events/misc/Styler.svelte +16 -46
- package/components/block/controls/events/misc/Styler.svelte.d.ts +17 -6
- package/components/block/controls/props/Color.svelte +86 -0
- package/components/block/controls/props/Color.svelte.d.ts +21 -0
- package/components/block/controls/props/Component.svelte +5 -0
- package/components/block/controls/props/Number.svelte +4 -5
- package/components/block/controls/props/Object.svelte +9 -12
- package/components/block/controls/props/Props.svelte +2 -5
- package/components/block/controls/props/Range.svelte +5 -4
- package/components/block/controls/props/Select.svelte +5 -8
- package/components/block/controls/props/Switch.svelte +4 -5
- package/components/block/controls/props/Text.svelte +8 -9
- package/components/block/controls/props/Tuple.svelte +13 -26
- package/components/block/controls/props/misc/Name.svelte +6 -7
- package/components/block/controls/props/misc/Styler.svelte +22 -34
- package/components/block/controls/props/misc/Styler.svelte.d.ts +17 -6
- package/components/block/controls/props/misc/defaulter.d.ts +9 -8
- package/components/block/controls/props/misc/defaulter.js +28 -48
- package/components/block/controls/props/misc/utils.d.ts +12 -0
- package/components/block/controls/props/misc/utils.js +37 -0
- package/components/block/controls/types.d.ts +12 -2
- package/components/block/icons/Button.svelte +30 -0
- package/components/block/icons/Button.svelte.d.ts +35 -0
- package/components/block/icons/ControlView.svelte +30 -0
- package/components/block/icons/ControlView.svelte.d.ts +16 -0
- package/components/block/icons/Position.svelte +29 -0
- package/components/block/icons/Position.svelte.d.ts +16 -0
- package/components/{etc → layout}/Container.svelte +24 -37
- package/components/{etc → layout}/Container.svelte.d.ts +0 -0
- package/components/layout/Content.svelte +23 -0
- package/components/layout/Content.svelte.d.ts +27 -0
- package/components/layout/Layout.svelte +124 -0
- 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 +3 -3
- package/components/{title → layout/icons}/Icon.svelte.d.ts +0 -0
- package/components/{icons/NilDoc.svelte → layout/icons/Nil.svelte} +3 -3
- package/components/layout/icons/Nil.svelte.d.ts +14 -0
- package/components/{icons → layout/icons}/Theme.svelte +41 -28
- package/components/{icons → layout/icons}/Theme.svelte.d.ts +1 -1
- package/components/navigation/Nav.svelte +6 -10
- package/components/navigation/Node.svelte +19 -11
- 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/Layout.svelte +0 -151
- package/components/icons/NilDoc.svelte.d.ts +0 -14
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script context="module">const colorSetter = (format, color) => {
|
|
2
|
+
switch (format) {
|
|
3
|
+
case "hex":
|
|
4
|
+
return color.hex.substring(0, 7);
|
|
5
|
+
case "hexa":
|
|
6
|
+
return color.hex.substring(0, 9);
|
|
7
|
+
case "hsl":
|
|
8
|
+
return color.hslString;
|
|
9
|
+
case "hsla":
|
|
10
|
+
return color.hslaString;
|
|
11
|
+
case "rgb":
|
|
12
|
+
return color.rgbString;
|
|
13
|
+
case "rgba":
|
|
14
|
+
return color.rgbaString;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const formatter = (format) => {
|
|
18
|
+
switch (format) {
|
|
19
|
+
case "hex":
|
|
20
|
+
return "hex";
|
|
21
|
+
case "hsl":
|
|
22
|
+
return "hsl";
|
|
23
|
+
case "rgb":
|
|
24
|
+
return "rgb";
|
|
25
|
+
case "hexa":
|
|
26
|
+
return "hex";
|
|
27
|
+
case "hsla":
|
|
28
|
+
return "hsl";
|
|
29
|
+
case "rgba":
|
|
30
|
+
return "rgb";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<script>import { getName, getFormat } from "./misc/utils";
|
|
36
|
+
import { defaulter } from "./misc/defaulter";
|
|
37
|
+
import NameHeader from "./misc/Name.svelte";
|
|
38
|
+
import Picker from "vanilla-picker";
|
|
39
|
+
export let value;
|
|
40
|
+
export let info;
|
|
41
|
+
export let depth;
|
|
42
|
+
export let disabled = false;
|
|
43
|
+
export let visible = false;
|
|
44
|
+
let ivalue = value ?? defaulter(info);
|
|
45
|
+
let enabled = value !== void 0;
|
|
46
|
+
const action = (div, format) => {
|
|
47
|
+
const picker = new Picker({
|
|
48
|
+
parent: div,
|
|
49
|
+
popup: "left",
|
|
50
|
+
editorFormat: formatter(format),
|
|
51
|
+
editor: false,
|
|
52
|
+
alpha: format.length === 4,
|
|
53
|
+
onChange: (color) => ivalue = colorSetter(getFormat(info), color),
|
|
54
|
+
color: ivalue
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
update: (format2) => {
|
|
58
|
+
picker.setOptions({
|
|
59
|
+
alpha: format2.length === 4,
|
|
60
|
+
editorFormat: formatter(format2)
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
destroy: () => picker.destroy()
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
$:
|
|
67
|
+
value = enabled && !disabled ? ivalue : void 0;
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
{#if visible}
|
|
71
|
+
<div>
|
|
72
|
+
<NameHeader name={getName(info)} {depth} />
|
|
73
|
+
<div>
|
|
74
|
+
<button use:action={getFormat(info)} disabled={!enabled || disabled}>
|
|
75
|
+
{value}
|
|
76
|
+
</button>
|
|
77
|
+
</div>
|
|
78
|
+
<div><input type="checkbox" bind:checked={enabled} {disabled} /></div>
|
|
79
|
+
</div>
|
|
80
|
+
{/if}
|
|
81
|
+
|
|
82
|
+
<style>
|
|
83
|
+
div > div > button {
|
|
84
|
+
font-size: 0.7rem;
|
|
85
|
+
}
|
|
86
|
+
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Unionized, PropType } from "../types";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
value: string | undefined;
|
|
6
|
+
info: Unionized<PropType<"color">>;
|
|
7
|
+
depth: number;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
visible?: boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type ColorProps = typeof __propDef.props;
|
|
17
|
+
export type ColorEvents = typeof __propDef.events;
|
|
18
|
+
export type ColorSlots = typeof __propDef.slots;
|
|
19
|
+
export default class Color extends SvelteComponentTyped<ColorProps, ColorEvents, ColorSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -5,6 +5,7 @@ import Switch from "./Switch.svelte";
|
|
|
5
5
|
import Select from "./Select.svelte";
|
|
6
6
|
import Tuple from "./Tuple.svelte";
|
|
7
7
|
import Object from "./Object.svelte";
|
|
8
|
+
import Color from "./Color.svelte";
|
|
8
9
|
export let value;
|
|
9
10
|
export let info;
|
|
10
11
|
export let depth;
|
|
@@ -20,6 +21,8 @@ export let visible = false;
|
|
|
20
21
|
<Tuple {info} bind:value {depth} {disabled} {visible} />
|
|
21
22
|
{:else if "text" === type}
|
|
22
23
|
<Text {info} bind:value {depth} {disabled} {visible} />
|
|
24
|
+
{:else if "color" === type}
|
|
25
|
+
<Color {info} bind:value {depth} {disabled} {visible} />
|
|
23
26
|
{:else if "number" === type}
|
|
24
27
|
<Number {info} bind:value {depth} {disabled} {visible} />
|
|
25
28
|
{:else if "range" === type}
|
|
@@ -37,6 +40,8 @@ export let visible = false;
|
|
|
37
40
|
<Tuple {info} bind:value {depth} {disabled} {visible} />
|
|
38
41
|
{:else if "text" === type}
|
|
39
42
|
<Text {info} bind:value {depth} {disabled} {visible} />
|
|
43
|
+
{:else if "color" === type}
|
|
44
|
+
<Color {info} bind:value {depth} {disabled} {visible} />
|
|
40
45
|
{:else if "number" === type}
|
|
41
46
|
<Number {info} bind:value {depth} {disabled} {visible} />
|
|
42
47
|
{:else if "range" === type}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { getName } from "./misc/utils";
|
|
2
|
+
import { defaulter } from "./misc/defaulter";
|
|
2
3
|
import NameHeader from "./misc/Name.svelte";
|
|
3
4
|
export let value;
|
|
4
5
|
export let info;
|
|
5
6
|
export let depth;
|
|
6
7
|
export let disabled = false;
|
|
7
8
|
export let visible = false;
|
|
8
|
-
let ivalue = value ??
|
|
9
|
+
let ivalue = value ?? defaulter(info);
|
|
9
10
|
let enabled = value !== void 0;
|
|
10
11
|
$:
|
|
11
12
|
value = enabled && !disabled ? ivalue : void 0;
|
|
12
|
-
$:
|
|
13
|
-
name = info instanceof Array ? info[0] : info.name;
|
|
14
13
|
</script>
|
|
15
14
|
|
|
16
15
|
{#if visible}
|
|
17
16
|
<div>
|
|
18
|
-
<NameHeader {
|
|
17
|
+
<NameHeader name={getName(info)} {depth} />
|
|
19
18
|
<div><input type="number" bind:value={ivalue} disabled={!enabled || disabled} /></div>
|
|
20
19
|
<div><input type="checkbox" bind:checked={enabled} {disabled} /></div>
|
|
21
20
|
</div>
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
<script>import Component from "./Component.svelte";
|
|
2
2
|
import Header from "./misc/GroupHeader.svelte";
|
|
3
|
-
import {
|
|
3
|
+
import { defaulter } from "./misc/defaulter";
|
|
4
|
+
import { getValues, getName } from "./misc/utils";
|
|
4
5
|
export let value;
|
|
5
6
|
export let info;
|
|
6
7
|
export let depth;
|
|
7
8
|
export let disabled = false;
|
|
8
9
|
export let visible = false;
|
|
9
|
-
let ivalue = value ??
|
|
10
|
+
let ivalue = value ?? defaulter(info);
|
|
10
11
|
let enabled = value !== void 0;
|
|
11
|
-
let expand = info.
|
|
12
|
+
let expand = getValues(info).length > 0 ? true : void 0;
|
|
12
13
|
$:
|
|
13
14
|
value = !disabled && enabled ? ivalue : void 0;
|
|
14
|
-
$:
|
|
15
|
-
values = info instanceof Array ? info[2] : info.values;
|
|
16
|
-
$:
|
|
17
|
-
name = info instanceof Array ? info[0] : info.name;
|
|
18
15
|
</script>
|
|
19
16
|
|
|
20
|
-
<Header {
|
|
17
|
+
<Header name={getName(info)} bind:expand bind:checked={enabled} {depth} {disabled} {visible} />
|
|
21
18
|
|
|
22
|
-
{#each
|
|
19
|
+
{#each getValues(info) as v, i (i)}
|
|
23
20
|
<Component
|
|
24
|
-
{
|
|
25
|
-
bind:value={ivalue[
|
|
26
|
-
depth={depth +
|
|
21
|
+
info={v}
|
|
22
|
+
bind:value={ivalue[getName(v)]}
|
|
23
|
+
depth={depth + 1}
|
|
27
24
|
disabled={!enabled || disabled}
|
|
28
25
|
visible={visible && expand && enabled && !disabled}
|
|
29
26
|
/>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>import Component from "./Component.svelte";
|
|
2
2
|
import Styler from "./misc/Styler.svelte";
|
|
3
|
+
import { getName } from "./misc/utils";
|
|
3
4
|
export let infos;
|
|
4
5
|
export let values;
|
|
5
6
|
export let visible;
|
|
@@ -10,10 +11,6 @@ export let visible;
|
|
|
10
11
|
<slot />
|
|
11
12
|
{/if}
|
|
12
13
|
{#each infos as info}
|
|
13
|
-
{
|
|
14
|
-
<Component {info} bind:value={values[info[0]]} depth={10} {visible} />
|
|
15
|
-
{:else}
|
|
16
|
-
<Component {info} bind:value={values[info.name]} depth={10} {visible} />
|
|
17
|
-
{/if}
|
|
14
|
+
<Component {info} bind:value={values[getName(info)]} depth={1} {visible} />
|
|
18
15
|
{/each}
|
|
19
16
|
</Styler>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { defaulter } from "./misc/defaulter";
|
|
2
2
|
import NameHeader from "./misc/Name.svelte";
|
|
3
3
|
import { nformat } from "./misc/nformat";
|
|
4
4
|
export let value;
|
|
@@ -6,7 +6,7 @@ export let info;
|
|
|
6
6
|
export let depth;
|
|
7
7
|
export let disabled = false;
|
|
8
8
|
export let visible = false;
|
|
9
|
-
let ivalue = value ??
|
|
9
|
+
let ivalue = value ?? defaulter(info);
|
|
10
10
|
let enabled = value !== void 0;
|
|
11
11
|
$:
|
|
12
12
|
value = enabled && !disabled ? ivalue : void 0;
|
|
@@ -49,9 +49,10 @@ $:
|
|
|
49
49
|
.input {
|
|
50
50
|
width: 100%;
|
|
51
51
|
display: grid;
|
|
52
|
-
grid-template-columns:
|
|
53
|
-
gap:
|
|
52
|
+
grid-template-columns: 4rem 1fr;
|
|
53
|
+
gap: 0.25rem;
|
|
54
54
|
position: relative;
|
|
55
|
+
box-sizing: border-box;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
.input > div {
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { defaulter } from "./misc/defaulter";
|
|
2
|
+
import { getValues, getName } from "./misc/utils";
|
|
2
3
|
import NameHeader from "./misc/Name.svelte";
|
|
3
4
|
export let value;
|
|
4
5
|
export let info;
|
|
5
6
|
export let depth;
|
|
6
7
|
export let disabled = false;
|
|
7
8
|
export let visible = false;
|
|
8
|
-
let ivalue = value ??
|
|
9
|
+
let ivalue = value ?? defaulter(info);
|
|
9
10
|
let enabled = value !== void 0;
|
|
10
11
|
$:
|
|
11
12
|
value = enabled && !disabled ? ivalue : void 0;
|
|
12
|
-
$:
|
|
13
|
-
name = info instanceof Array ? info[0] : info.name;
|
|
14
|
-
$:
|
|
15
|
-
values = info instanceof Array ? info[2] : info.values;
|
|
16
13
|
</script>
|
|
17
14
|
|
|
18
15
|
{#if visible}
|
|
19
16
|
<div>
|
|
20
|
-
<NameHeader {
|
|
17
|
+
<NameHeader name={getName(info)} {depth} />
|
|
21
18
|
<div>
|
|
22
19
|
<select bind:value={ivalue} disabled={!enabled || disabled}>
|
|
23
|
-
{#each
|
|
20
|
+
{#each getValues(info) as v}
|
|
24
21
|
<option value={v}>{v}</option>
|
|
25
22
|
{/each}
|
|
26
23
|
</select>
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { getName } from "./misc/utils";
|
|
2
|
+
import { defaulter } from "./misc/defaulter";
|
|
2
3
|
import NameHeader from "./misc/Name.svelte";
|
|
3
4
|
export let value;
|
|
4
5
|
export let info;
|
|
5
6
|
export let depth;
|
|
6
7
|
export let disabled = false;
|
|
7
8
|
export let visible = false;
|
|
8
|
-
let ivalue = value ??
|
|
9
|
+
let ivalue = value ?? defaulter(info);
|
|
9
10
|
let enabled = value !== void 0;
|
|
10
11
|
$:
|
|
11
12
|
value = enabled && !disabled ? ivalue : void 0;
|
|
12
|
-
$:
|
|
13
|
-
name = info instanceof Array ? info[0] : info.name;
|
|
14
13
|
</script>
|
|
15
14
|
|
|
16
15
|
{#if visible}
|
|
17
16
|
<div>
|
|
18
|
-
<NameHeader {
|
|
17
|
+
<NameHeader name={getName(info)} {depth} />
|
|
19
18
|
<div><input type="checkbox" bind:checked={ivalue} disabled={!enabled || disabled} /></div>
|
|
20
19
|
<div><input type="checkbox" bind:checked={enabled} {disabled} /></div>
|
|
21
20
|
</div>
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { getName } from "./misc/utils";
|
|
2
|
+
import { defaulter } from "./misc/defaulter";
|
|
2
3
|
import NameHeader from "./misc/Name.svelte";
|
|
3
4
|
export let value;
|
|
4
5
|
export let info;
|
|
5
6
|
export let depth;
|
|
6
7
|
export let disabled = false;
|
|
7
8
|
export let visible = false;
|
|
8
|
-
let ivalue = value ??
|
|
9
|
-
let
|
|
9
|
+
let ivalue = value ?? defaulter(info);
|
|
10
|
+
let enabled = value !== void 0;
|
|
10
11
|
$:
|
|
11
|
-
value =
|
|
12
|
-
$:
|
|
13
|
-
name = info instanceof Array ? info[0] : info.name;
|
|
12
|
+
value = enabled && !disabled ? ivalue : void 0;
|
|
14
13
|
</script>
|
|
15
14
|
|
|
16
15
|
{#if visible}
|
|
17
16
|
<div>
|
|
18
|
-
<NameHeader {
|
|
19
|
-
<div><input type="text" bind:value={ivalue} disabled={!
|
|
20
|
-
<div><input type="checkbox" bind:checked={
|
|
17
|
+
<NameHeader name={getName(info)} {depth} />
|
|
18
|
+
<div><input type="text" bind:value={ivalue} disabled={!enabled || disabled} /></div>
|
|
19
|
+
<div><input type="checkbox" bind:checked={enabled} {disabled} /></div>
|
|
21
20
|
</div>
|
|
22
21
|
{/if}
|
|
@@ -1,40 +1,27 @@
|
|
|
1
1
|
<script>import Component from "./Component.svelte";
|
|
2
2
|
import Header from "./misc/GroupHeader.svelte";
|
|
3
|
-
import {
|
|
3
|
+
import { defaulter } from "./misc/defaulter";
|
|
4
|
+
import { getValues, getName, addName } from "./misc/utils";
|
|
4
5
|
export let value;
|
|
5
6
|
export let info;
|
|
6
7
|
export let depth;
|
|
7
8
|
export let disabled = false;
|
|
8
9
|
export let visible = false;
|
|
9
|
-
let ivalue = value ??
|
|
10
|
+
let ivalue = value ?? defaulter(info);
|
|
10
11
|
let enabled = value !== void 0;
|
|
12
|
+
let expand = getValues(info).length > 0 ? true : void 0;
|
|
11
13
|
$:
|
|
12
14
|
value = !disabled && enabled ? ivalue : void 0;
|
|
13
|
-
$:
|
|
14
|
-
values = info instanceof Array ? info[2] : info.values;
|
|
15
|
-
$:
|
|
16
|
-
name = info instanceof Array ? info[0] : info.name;
|
|
17
|
-
let expand = info.values.length > 0 ? true : void 0;
|
|
18
15
|
</script>
|
|
19
16
|
|
|
20
|
-
<Header {
|
|
17
|
+
<Header name={getName(info)} bind:expand bind:checked={enabled} {depth} {disabled} {visible} />
|
|
21
18
|
|
|
22
|
-
{#each
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/>
|
|
31
|
-
{:else}
|
|
32
|
-
<Component
|
|
33
|
-
info={{ ...v, name: `${i}` }}
|
|
34
|
-
bind:value={ivalue[i]}
|
|
35
|
-
depth={depth + 10}
|
|
36
|
-
disabled={!enabled || disabled}
|
|
37
|
-
visible={visible && expand && enabled && !disabled}
|
|
38
|
-
/>
|
|
39
|
-
{/if}
|
|
19
|
+
{#each getValues(info) as v, i (i)}
|
|
20
|
+
<Component
|
|
21
|
+
info={addName(`${i}`, v)}
|
|
22
|
+
bind:value={ivalue[i]}
|
|
23
|
+
depth={depth + 1}
|
|
24
|
+
disabled={!enabled || disabled}
|
|
25
|
+
visible={visible && expand && enabled && !disabled}
|
|
26
|
+
/>
|
|
40
27
|
{/each}
|
|
@@ -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,21 +17,20 @@ 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
|
-
box-sizing: border-box;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
.icon {
|
|
29
28
|
display: flex;
|
|
30
29
|
flex-direction: column;
|
|
31
30
|
justify-content: center;
|
|
32
|
-
height:
|
|
33
|
-
width:
|
|
34
|
-
transition: transform
|
|
31
|
+
height: 1rem;
|
|
32
|
+
width: 1rem;
|
|
33
|
+
transition: transform var(--i-nil-doc-transition-time);
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
.icon.expand {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
<script>import { getTheme } from "../../../../context";
|
|
2
|
-
const dark = getTheme();
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
1
|
<!--
|
|
6
2
|
<div> this component
|
|
7
3
|
<div> Header
|
|
@@ -17,17 +13,15 @@ const dark = getTheme();
|
|
|
17
13
|
...
|
|
18
14
|
</div>
|
|
19
15
|
-->
|
|
20
|
-
<div
|
|
16
|
+
<div>
|
|
21
17
|
<slot />
|
|
22
18
|
</div>
|
|
23
19
|
|
|
24
20
|
<style>
|
|
25
21
|
div {
|
|
26
|
-
width: 100%;
|
|
27
|
-
min-width: 500px;
|
|
28
|
-
overflow: hidden;
|
|
29
22
|
display: grid;
|
|
30
|
-
|
|
23
|
+
min-width: 31.25rem;
|
|
24
|
+
grid-auto-rows: 2rem;
|
|
31
25
|
box-sizing: border-box;
|
|
32
26
|
}
|
|
33
27
|
|
|
@@ -40,49 +34,43 @@ const dark = getTheme();
|
|
|
40
34
|
|
|
41
35
|
div > :global(div) {
|
|
42
36
|
display: grid;
|
|
43
|
-
|
|
44
|
-
padding: 2px 0px;
|
|
45
|
-
grid-template-columns: minmax(250px, 1fr) 200px 40px;
|
|
37
|
+
grid-template-columns: minmax(15rem, 1fr) 12.5rem 2.5rem;
|
|
46
38
|
}
|
|
47
39
|
|
|
48
40
|
div > :global(div:first-child) {
|
|
49
|
-
text-align: center;
|
|
50
41
|
font-weight: bold;
|
|
42
|
+
place-items: center;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
div > :global(div > div:not(:first-child)) {
|
|
46
|
+
display: grid;
|
|
47
|
+
place-items: center;
|
|
51
48
|
}
|
|
52
49
|
|
|
53
50
|
div > :global(div > div:not(:first-child) > *) {
|
|
54
51
|
width: 100%;
|
|
55
|
-
height:
|
|
52
|
+
height: 80%;
|
|
53
|
+
font-size: 1rem;
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
/* colors */
|
|
59
57
|
div {
|
|
60
|
-
|
|
61
|
-
--sec-color: hsl(210, 29%, 97%);
|
|
62
|
-
--hover-color: hsl(210, 100%, 90%);
|
|
63
|
-
--outline-color: hsl(0, 0%, 0%);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
div.dark {
|
|
67
|
-
--pri-color: hsl(213, 26%, 7%);
|
|
68
|
-
--sec-color: hsl(213, 26%, 11%);
|
|
69
|
-
--hover-color: hsl(203, 100%, 15%);
|
|
70
|
-
--outline-color: hsl(200, 6%, 80%);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
div {
|
|
74
|
-
transition: background-color 150ms;
|
|
58
|
+
transition: background-color var(--i-nil-doc-transition-time);
|
|
75
59
|
background-repeat: repeat;
|
|
76
|
-
background-size: 100%
|
|
77
|
-
background-image: linear-gradient(
|
|
60
|
+
background-size: 100% 4rem;
|
|
61
|
+
background-image: linear-gradient(
|
|
62
|
+
to bottom,
|
|
63
|
+
var(--i-nil-doc-controls-p) 2rem,
|
|
64
|
+
var(--i-nil-doc-controls-s) 2rem
|
|
65
|
+
);
|
|
78
66
|
}
|
|
79
67
|
|
|
80
68
|
div > :global(div:nth-child(n + 2):hover) {
|
|
81
|
-
background-color: var(--hover
|
|
69
|
+
background-color: var(--i-nil-doc-controls-hover);
|
|
82
70
|
}
|
|
83
71
|
|
|
84
72
|
div > :global(div:hover .tooltip) {
|
|
85
|
-
background-color: var(--
|
|
86
|
-
outline: var(--outline-color)
|
|
73
|
+
background-color: var(--i-nil-doc-controls-p);
|
|
74
|
+
outline: 1px solid var(--i-nil-doc-block-outline-color);
|
|
87
75
|
}
|
|
88
76
|
</style>
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} StylerProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} StylerEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} StylerSlots */
|
|
4
|
+
export default class Styler extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type StylerProps = typeof __propDef.props;
|
|
13
|
+
export type StylerEvents = typeof __propDef.events;
|
|
14
|
+
export type StylerSlots = typeof __propDef.slots;
|
|
1
15
|
import { SvelteComponentTyped } from "svelte";
|
|
2
16
|
declare const __propDef: {
|
|
3
|
-
props:
|
|
17
|
+
props: {
|
|
18
|
+
[x: string]: never;
|
|
19
|
+
};
|
|
4
20
|
events: {
|
|
5
21
|
[evt: string]: CustomEvent<any>;
|
|
6
22
|
};
|
|
@@ -8,9 +24,4 @@ declare const __propDef: {
|
|
|
8
24
|
default: {};
|
|
9
25
|
};
|
|
10
26
|
};
|
|
11
|
-
export type StylerProps = typeof __propDef.props;
|
|
12
|
-
export type StylerEvents = typeof __propDef.events;
|
|
13
|
-
export type StylerSlots = typeof __propDef.slots;
|
|
14
|
-
export default class Styler extends SvelteComponentTyped<StylerProps, StylerEvents, StylerSlots> {
|
|
15
|
-
}
|
|
16
27
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ValueType } from "../../../types";
|
|
2
2
|
import type { Unionized, PropType, Prop } from "../../types";
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
3
|
+
export declare function defaulter(i: Unionized<PropType<"tuple">>): ValueType[];
|
|
4
|
+
export declare function defaulter(i: Unionized<PropType<"object">>): Record<string, ValueType>;
|
|
5
|
+
export declare function defaulter(i: Unionized<PropType<"number">>): number;
|
|
6
|
+
export declare function defaulter(i: Unionized<PropType<"range">>): number;
|
|
7
|
+
export declare function defaulter(i: Unionized<PropType<"select">>): string;
|
|
8
|
+
export declare function defaulter(i: Unionized<PropType<"text">>): string;
|
|
9
|
+
export declare function defaulter(i: Unionized<PropType<"switch">>): boolean;
|
|
10
|
+
export declare function defaulter(i: Unionized<PropType<"color">>): string;
|
|
11
|
+
export declare function defaulter(i: Prop): ValueType;
|