@nil-/doc 0.2.14 → 0.2.15
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 +8 -0
- package/components/block/controls/Controls.svelte +5 -34
- package/components/block/controls/Object.svelte +3 -8
- package/components/block/controls/Tuple.svelte +3 -8
- package/components/block/controls/misc/GroupHeader.svelte +19 -0
- package/components/block/controls/misc/GroupHeader.svelte.d.ts +19 -0
- package/components/block/controls/misc/Styler.svelte +34 -0
- package/components/block/controls/misc/Styler.svelte.d.ts +27 -0
- package/components/block/controls/{Header.svelte → misc/TopHeader.svelte} +0 -0
- package/components/block/controls/misc/TopHeader.svelte.d.ts +23 -0
- package/components/block/controls/{defaulter.d.ts → misc/defaulter.d.ts} +1 -1
- package/components/block/controls/{defaulter.js → misc/defaulter.js} +0 -0
- package/components/routes.d.ts +6 -0
- package/components/{load.js → routes.js} +9 -6
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/components/block/controls/Header.svelte.d.ts +0 -23
- package/components/load.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,42 +1,13 @@
|
|
|
1
|
-
<style>
|
|
2
|
-
.controls {
|
|
3
|
-
width: 100%;
|
|
4
|
-
display: grid;
|
|
5
|
-
grid-auto-rows: 1fr;
|
|
6
|
-
}
|
|
7
1
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
padding: 2px 0px;
|
|
12
|
-
grid-template-columns: 1fr 200px 75px;
|
|
13
|
-
background-color: hsl(205, 50%, 5%);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.controls > :global(div:nth-child(even)) {
|
|
17
|
-
background-color: hsl(205, 15%, 15%);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.controls > :global(div > div) {
|
|
21
|
-
display: grid;
|
|
22
|
-
align-items: center;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.controls > :global(div > div > *) {
|
|
26
|
-
width: 100%;
|
|
27
|
-
height: 100%;
|
|
28
|
-
}
|
|
29
|
-
</style>
|
|
30
|
-
|
|
31
|
-
<script>import Header from "./Header.svelte";
|
|
32
|
-
import Component from "./Component.svelte";
|
|
2
|
+
<script>import Component from "./Component.svelte";
|
|
3
|
+
import Header from "./misc/TopHeader.svelte";
|
|
4
|
+
import Styler from "./misc/Styler.svelte";
|
|
33
5
|
export let infos;
|
|
34
6
|
export let values;
|
|
35
7
|
</script>
|
|
36
|
-
<
|
|
8
|
+
<Styler>
|
|
37
9
|
<Header />
|
|
38
10
|
{#each infos as info}
|
|
39
11
|
<Component {info} bind:value={values[info.name]} />
|
|
40
12
|
{/each}
|
|
41
|
-
</
|
|
42
|
-
|
|
13
|
+
</Styler>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
<script>import Component from "./Component.svelte";
|
|
3
|
-
import
|
|
3
|
+
import Header from "./misc/GroupHeader.svelte";
|
|
4
|
+
import { getObjectDefaults } from "./misc/defaulter";
|
|
4
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
6
|
export let value;
|
|
6
7
|
export let info;
|
|
@@ -10,13 +11,7 @@ let ivalue = value ?? getObjectDefaults(info);
|
|
|
10
11
|
let enabled = value !== undefined;
|
|
11
12
|
$: value = !disabled && enabled ? ivalue : undefined;
|
|
12
13
|
</script>
|
|
13
|
-
<
|
|
14
|
-
<div style:padding-left={`${depth}px`}>
|
|
15
|
-
> {info.name}
|
|
16
|
-
</div>
|
|
17
|
-
<div>-</div>
|
|
18
|
-
<div><input type="checkbox" bind:checked={enabled} {disabled} /></div>
|
|
19
|
-
</div>
|
|
14
|
+
<Header name={info.name} bind:checked={enabled} {depth} {disabled} />
|
|
20
15
|
{#if enabled && !disabled}
|
|
21
16
|
{#each info.values as info, i (i)}
|
|
22
17
|
<Component
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
<script>import Component from "./Component.svelte";
|
|
3
|
-
import
|
|
3
|
+
import Header from "./misc/GroupHeader.svelte";
|
|
4
|
+
import { getTupleDefaults } from "./misc/defaulter";
|
|
4
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
6
|
export let value;
|
|
6
7
|
export let info;
|
|
@@ -10,13 +11,7 @@ let ivalue = value ?? getTupleDefaults(info);
|
|
|
10
11
|
let enabled = value !== undefined;
|
|
11
12
|
$: value = !disabled && enabled ? ivalue : undefined;
|
|
12
13
|
</script>
|
|
13
|
-
<
|
|
14
|
-
<div style:padding-left={`${depth}px`}>
|
|
15
|
-
> {info.name}
|
|
16
|
-
</div>
|
|
17
|
-
<div>-</div>
|
|
18
|
-
<div><input type="checkbox" bind:checked={enabled} {disabled} /></div>
|
|
19
|
-
</div>
|
|
14
|
+
<Header name={info.name} bind:checked={enabled} {depth} {disabled} />
|
|
20
15
|
{#if enabled && !disabled}
|
|
21
16
|
{#each info.values as info, i (i)}
|
|
22
17
|
<Component
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.value {
|
|
3
|
+
text-align: center;
|
|
4
|
+
}
|
|
5
|
+
</style>
|
|
6
|
+
|
|
7
|
+
<script>export let name;
|
|
8
|
+
export let depth;
|
|
9
|
+
export let checked;
|
|
10
|
+
export let disabled = false;
|
|
11
|
+
</script>
|
|
12
|
+
<div>
|
|
13
|
+
<div style:padding-left={`${depth}px`}>
|
|
14
|
+
{`> ${name}`}
|
|
15
|
+
</div>
|
|
16
|
+
<div class="value">-</div>
|
|
17
|
+
<div><input type="checkbox" bind:checked {disabled} /></div>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
name: string;
|
|
5
|
+
depth: number;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export type GroupHeaderProps = typeof __propDef.props;
|
|
15
|
+
export type GroupHeaderEvents = typeof __propDef.events;
|
|
16
|
+
export type GroupHeaderSlots = typeof __propDef.slots;
|
|
17
|
+
export default class GroupHeader extends SvelteComponentTyped<GroupHeaderProps, GroupHeaderEvents, GroupHeaderSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
div {
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: grid;
|
|
5
|
+
grid-auto-rows: 30px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
div > :global(div) {
|
|
9
|
+
width: 100%;
|
|
10
|
+
display: grid;
|
|
11
|
+
padding: 2px 0px;
|
|
12
|
+
grid-template-columns: 1fr 200px 75px;
|
|
13
|
+
background-color: hsl(205, 50%, 5%);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
div > :global(div:nth-child(even)) {
|
|
17
|
+
background-color: hsl(205, 15%, 15%);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
div > :global(div > div) {
|
|
21
|
+
display: grid;
|
|
22
|
+
align-items: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
div > :global(div > div > *) {
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
|
|
31
|
+
<div>
|
|
32
|
+
<slot />
|
|
33
|
+
</div>
|
|
34
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
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;
|
|
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
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TopHeaderProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TopHeaderEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TopHeaderSlots */
|
|
4
|
+
export default class TopHeader extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {}> {
|
|
9
|
+
}
|
|
10
|
+
export type TopHeaderProps = typeof __propDef.props;
|
|
11
|
+
export type TopHeaderEvents = typeof __propDef.events;
|
|
12
|
+
export type TopHeaderSlots = typeof __propDef.slots;
|
|
13
|
+
import { SvelteComponentTyped } from "svelte";
|
|
14
|
+
declare const __propDef: {
|
|
15
|
+
props: {
|
|
16
|
+
[x: string]: never;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Control, ControlTuple, ControlObject } from "
|
|
1
|
+
import type { Control, ControlTuple, ControlObject } from "../types";
|
|
2
2
|
export declare function getObjectDefaults(info: ControlObject): Record<string, any>;
|
|
3
3
|
export declare function getTupleDefaults(i: ControlTuple): any[];
|
|
4
4
|
export declare function getDefault(i: Control): any;
|
|
File without changes
|
|
@@ -17,10 +17,13 @@ const route_rest_match = /.*\[.*\].*/;
|
|
|
17
17
|
function isRouteDynamic(p) {
|
|
18
18
|
return route_rest_match.exec(p) == null;
|
|
19
19
|
}
|
|
20
|
-
export function
|
|
21
|
-
return
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
export function routes(files_from_import_meta) {
|
|
21
|
+
return {
|
|
22
|
+
data: Object.keys(files_from_import_meta)
|
|
23
|
+
.map(toRoute)
|
|
24
|
+
.map(collapseLayout)
|
|
25
|
+
.filter(isNotRoot)
|
|
26
|
+
.filter(isRouteDynamic),
|
|
27
|
+
process: (r) => (r ? collapseLayout(r) : null)
|
|
28
|
+
};
|
|
26
29
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { routes } from "./components/routes";
|
|
2
2
|
export { renamer, sorter } from "./components/navigation/utils";
|
|
3
3
|
export type { Control } from "./components/block/controls/types";
|
|
4
4
|
export { default as Layout } from "./components/Layout.svelte";
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { routes } from "./components/routes";
|
|
2
2
|
export { renamer, sorter } from "./components/navigation/utils";
|
|
3
3
|
export { default as Layout } from "./components/Layout.svelte";
|
|
4
4
|
export { default as Block } from "./components/block/Block.svelte";
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} HeaderProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} HeaderEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} HeaderSlots */
|
|
4
|
-
export default class Header extends SvelteComponentTyped<{
|
|
5
|
-
[x: string]: never;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {}> {
|
|
9
|
-
}
|
|
10
|
-
export type HeaderProps = typeof __propDef.props;
|
|
11
|
-
export type HeaderEvents = typeof __propDef.events;
|
|
12
|
-
export type HeaderSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponentTyped } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
[x: string]: never;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
};
|
|
23
|
-
export {};
|
package/components/load.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function load(files_from_import_meta: Record<string, unknown>): string[];
|