@nil-/doc 1.0.0 → 2.0.1
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/components/Base.svelte +6 -3
- package/components/Base.svelte.d.ts +8 -18
- package/components/block/Block.svelte +5 -3
- package/components/block/Block.svelte.d.ts +6 -15
- package/components/block/Controls.svelte +6 -5
- package/components/block/Controls.svelte.d.ts +7 -17
- package/components/block/Instance.svelte +48 -33
- package/components/block/Instance.svelte.d.ts +22 -19
- package/components/block/Params.svelte +22 -12
- package/components/block/Params.svelte.d.ts +6 -16
- package/components/block/Template.svelte +32 -15
- package/components/block/Template.svelte.d.ts +21 -18
- package/components/block/controls/Controls.svelte +15 -10
- package/components/block/controls/Controls.svelte.d.ts +6 -16
- package/components/block/controls/Styler.svelte +5 -2
- package/components/block/controls/Styler.svelte.d.ts +7 -17
- package/components/block/controls/events/Events.svelte +4 -2
- package/components/block/controls/events/Events.svelte.d.ts +10 -20
- package/components/block/controls/props/Button.svelte +7 -6
- package/components/block/controls/props/Button.svelte.d.ts +6 -16
- package/components/block/controls/props/Color.svelte +15 -12
- package/components/block/controls/props/Color.svelte.d.ts +9 -19
- package/components/block/controls/props/Component.svelte +13 -11
- package/components/block/controls/props/Component.svelte.d.ts +9 -19
- package/components/block/controls/props/Number.svelte +14 -10
- package/components/block/controls/props/Number.svelte.d.ts +9 -19
- package/components/block/controls/props/Props.svelte +12 -5
- package/components/block/controls/props/Props.svelte.d.ts +9 -18
- package/components/block/controls/props/Range.svelte +23 -20
- package/components/block/controls/props/Range.svelte.d.ts +9 -19
- package/components/block/controls/props/Select.svelte +14 -10
- package/components/block/controls/props/Select.svelte.d.ts +9 -19
- package/components/block/controls/props/{Object.svelte → Table.svelte} +15 -11
- package/components/block/controls/props/Table.svelte.d.ts +12 -0
- package/components/block/controls/props/Text.svelte +14 -10
- package/components/block/controls/props/Text.svelte.d.ts +9 -19
- package/components/block/controls/props/Toggle.svelte +14 -10
- package/components/block/controls/props/Toggle.svelte.d.ts +10 -19
- package/components/block/controls/props/Tuple.svelte +15 -11
- package/components/block/controls/props/Tuple.svelte.d.ts +9 -19
- package/components/block/controls/props/misc/GroupHeader.svelte +12 -11
- package/components/block/controls/props/misc/GroupHeader.svelte.d.ts +10 -20
- package/components/block/controls/props/misc/Name.svelte +5 -3
- package/components/block/controls/props/misc/Name.svelte.d.ts +7 -17
- package/components/block/controls/props/misc/Toggle.svelte +10 -6
- package/components/block/controls/props/misc/Toggle.svelte.d.ts +7 -18
- package/components/block/controls/props/misc/defaulter.d.ts +1 -1
- package/components/block/controls/props/misc/defaulter.js +1 -1
- package/components/block/controls/props/misc/utils.d.ts +3 -3
- package/components/block/controls/types.d.ts +6 -6
- package/components/block/icons/Button.svelte +9 -5
- package/components/block/icons/Button.svelte.d.ts +10 -34
- package/components/block/icons/ControlView.svelte +3 -1
- package/components/block/icons/ControlView.svelte.d.ts +5 -15
- package/components/block/icons/Position.svelte +8 -6
- package/components/block/icons/Position.svelte.d.ts +5 -15
- package/components/layout/Container.svelte +28 -25
- package/components/layout/Container.svelte.d.ts +11 -21
- package/components/layout/Content.svelte +4 -1
- package/components/layout/Content.svelte.d.ts +6 -26
- package/components/layout/DocLayout.svelte +15 -21
- package/components/layout/DocLayout.svelte.d.ts +11 -25
- package/components/layout/Layout.svelte +42 -32
- package/components/layout/Layout.svelte.d.ts +18 -27
- package/components/layout/Scrollable.svelte +4 -1
- package/components/layout/Scrollable.svelte.d.ts +6 -26
- package/components/layout/ThemeToggle.svelte +5 -3
- package/components/layout/ThemeToggle.svelte.d.ts +5 -15
- package/components/layout/VerticalPanel.svelte +4 -1
- package/components/layout/VerticalPanel.svelte.d.ts +6 -26
- package/components/layout/icons/Icon.svelte +8 -3
- package/components/layout/icons/Icon.svelte.d.ts +9 -20
- package/components/layout/icons/Nil.svelte +16 -13
- package/components/layout/icons/Nil.svelte.d.ts +3 -14
- package/components/layout/icons/Theme.svelte +2 -2
- package/components/layout/icons/Theme.svelte.d.ts +5 -15
- package/components/navigation/Nav.svelte +14 -12
- package/components/navigation/Nav.svelte.d.ts +11 -20
- package/components/navigation/Node.svelte +22 -22
- package/components/navigation/Node.svelte.d.ts +16 -24
- package/components/navigation/Tree.svelte +11 -8
- package/components/navigation/Tree.svelte.d.ts +13 -22
- package/package.json +3 -3
- package/components/block/controls/props/Object.svelte.d.ts +0 -22
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
<script>import { getName } from "./misc/utils";
|
|
1
|
+
<script lang="ts">import { getName } from "./misc/utils";
|
|
2
2
|
import { defaulter } from "./misc/defaulter";
|
|
3
3
|
import NameHeader from "./misc/Name.svelte";
|
|
4
4
|
import Toggle from "./misc/Toggle.svelte";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
let {
|
|
6
|
+
value = $bindable(),
|
|
7
|
+
info,
|
|
8
|
+
depth,
|
|
9
|
+
disabled = false,
|
|
10
|
+
visible = false
|
|
11
|
+
} = $props();
|
|
12
|
+
let ivalue = $state(value ?? defaulter(info));
|
|
13
|
+
let enabled = $state(value !== void 0);
|
|
14
|
+
const set_value = (v) => {
|
|
15
|
+
value = v;
|
|
16
|
+
};
|
|
17
|
+
$effect(() => set_value(enabled && !disabled ? ivalue : void 0));
|
|
14
18
|
</script>
|
|
15
19
|
|
|
16
20
|
{#if visible}
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Toggle from "./misc/Toggle.svelte";
|
|
2
2
|
import type { Unionized, PropType } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
visible?: boolean | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
value: boolean | undefined;
|
|
5
|
+
info: Unionized<PropType<"toggle">>;
|
|
6
|
+
depth: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
visible?: boolean;
|
|
15
9
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export default class Toggle extends SvelteComponentTyped<ToggleProps, ToggleEvents, ToggleSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
10
|
+
declare const Toggle: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
11
|
+
type Toggle = ReturnType<typeof Toggle>;
|
|
12
|
+
export default Toggle;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
<script>import Component from "./Component.svelte";
|
|
1
|
+
<script lang="ts">import Component from "./Component.svelte";
|
|
2
2
|
import Header from "./misc/GroupHeader.svelte";
|
|
3
3
|
import { defaulter } from "./misc/defaulter";
|
|
4
4
|
import { getValues, getName, addName } from "./misc/utils";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
let {
|
|
6
|
+
value = $bindable(),
|
|
7
|
+
info,
|
|
8
|
+
depth,
|
|
9
|
+
disabled = false,
|
|
10
|
+
visible = false
|
|
11
|
+
} = $props();
|
|
12
|
+
let ivalue = $state(value ?? defaulter(info));
|
|
13
|
+
let enabled = $state(value !== void 0);
|
|
14
|
+
let expand = $state(getValues(info).length > 0 ? true : void 0);
|
|
15
|
+
const set_value = (v) => {
|
|
16
|
+
value = v;
|
|
17
|
+
};
|
|
18
|
+
$effect(() => set_value(enabled && !disabled ? ivalue : void 0));
|
|
15
19
|
</script>
|
|
16
20
|
|
|
17
21
|
<Header name={getName(info)} bind:expand bind:checked={enabled} {depth} {disabled} {visible} />
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import type { ValueType } from "../../types";
|
|
3
2
|
import type { Unionized, PropType } from "../types";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
visible?: boolean | undefined;
|
|
11
|
-
};
|
|
12
|
-
events: {
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
};
|
|
15
|
-
slots: {};
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
value: ValueType[] | undefined;
|
|
5
|
+
info: Unionized<PropType<"tuple">>;
|
|
6
|
+
depth: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
visible?: boolean;
|
|
16
9
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
export default class Tuple extends SvelteComponentTyped<TupleProps, TupleEvents, TupleSlots> {
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
10
|
+
declare const Tuple: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
11
|
+
type Tuple = ReturnType<typeof Tuple>;
|
|
12
|
+
export default Tuple;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<script>import Name from "./Name.svelte";
|
|
1
|
+
<script lang="ts">import Name from "./Name.svelte";
|
|
2
2
|
import Toggle from "./Toggle.svelte";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
let {
|
|
4
|
+
name,
|
|
5
|
+
depth,
|
|
6
|
+
checked = $bindable(),
|
|
7
|
+
disabled = false,
|
|
8
|
+
expand = $bindable(false),
|
|
9
|
+
visible = false
|
|
10
|
+
} = $props();
|
|
9
11
|
const flip = () => {
|
|
10
12
|
if (!disabled && checked) {
|
|
11
|
-
|
|
12
|
-
expand = !expand;
|
|
13
|
-
}
|
|
13
|
+
expand = !expand;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
{#if visible}
|
|
19
|
-
<div
|
|
19
|
+
<div onclick={flip} onkeypress={null} role="none">
|
|
20
20
|
<Name
|
|
21
21
|
expand={expand === undefined ? undefined : expand && checked && !disabled}
|
|
22
22
|
{name}
|
|
@@ -32,3 +32,4 @@ const flip = () => {
|
|
|
32
32
|
color: hsl(0, 0%, 50%);
|
|
33
33
|
}
|
|
34
34
|
</style>
|
|
35
|
+
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
expand?: boolean | undefined;
|
|
9
|
-
visible?: boolean | undefined;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {};
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
name: string;
|
|
3
|
+
depth: number;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
expand?: boolean;
|
|
7
|
+
visible?: boolean;
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export default class GroupHeader extends SvelteComponentTyped<GroupHeaderProps, GroupHeaderEvents, GroupHeaderSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
9
|
+
declare const GroupHeader: import("svelte").Component<$$ComponentProps, {}, "expand" | "checked">;
|
|
10
|
+
type GroupHeader = ReturnType<typeof GroupHeader>;
|
|
11
|
+
export default GroupHeader;
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
name: string;
|
|
6
|
-
expand?: boolean | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
depth: number;
|
|
3
|
+
name: string;
|
|
4
|
+
expand?: boolean;
|
|
12
5
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
export default class Name extends SvelteComponentTyped<NameProps, NameEvents, NameSlots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
6
|
+
declare const Name: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type Name = ReturnType<typeof Name>;
|
|
8
|
+
export default Name;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
<script>import { getTheme } from "../../../../context";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<script lang="ts">import { getTheme } from "../../../../context";
|
|
2
|
+
let {
|
|
3
|
+
disabled = false,
|
|
4
|
+
toggled = $bindable(false),
|
|
5
|
+
onkeypress
|
|
6
|
+
} = $props();
|
|
7
|
+
const onclick = (e) => {
|
|
8
|
+
e.stopPropagation();
|
|
5
9
|
if (!disabled) {
|
|
6
10
|
toggled = !toggled;
|
|
7
11
|
}
|
|
@@ -12,8 +16,8 @@ const dark = getTheme();
|
|
|
12
16
|
<div>
|
|
13
17
|
<svg
|
|
14
18
|
viewBox="-30 -30 60 60"
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
{onclick}
|
|
20
|
+
{onkeypress}
|
|
17
21
|
role="none"
|
|
18
22
|
class:disabled
|
|
19
23
|
class:dark={$dark}
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
toggled?: boolean | undefined;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
keypress: KeyboardEvent;
|
|
9
|
-
} & {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
toggled?: boolean;
|
|
4
|
+
onkeypress?: (e: KeyboardEvent) => void;
|
|
13
5
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export default class Toggle extends SvelteComponentTyped<ToggleProps, ToggleEvents, ToggleSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
6
|
+
declare const Toggle: import("svelte").Component<$$ComponentProps, {}, "toggled">;
|
|
7
|
+
type Toggle = ReturnType<typeof Toggle>;
|
|
8
|
+
export default Toggle;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ValueType } from "../../../types";
|
|
2
2
|
import type { Unionized, PropType, Prop } from "../../types";
|
|
3
3
|
export declare function defaulter(i: Unionized<PropType<"tuple">>): ValueType[];
|
|
4
|
-
export declare function defaulter(i: Unionized<PropType<"
|
|
4
|
+
export declare function defaulter(i: Unionized<PropType<"table">>): Record<string, ValueType>;
|
|
5
5
|
export declare function defaulter(i: Unionized<PropType<"number">>): number;
|
|
6
6
|
export declare function defaulter(i: Unionized<PropType<"range">>): number;
|
|
7
7
|
export declare function defaulter(i: Unionized<PropType<"select">>): string;
|
|
@@ -2,7 +2,7 @@ import { getType, getValues, getMin } from "./utils";
|
|
|
2
2
|
// eslint-disable-next-line func-style
|
|
3
3
|
export function defaulter(i) {
|
|
4
4
|
switch (getType(i)) {
|
|
5
|
-
case "
|
|
5
|
+
case "table":
|
|
6
6
|
// eslint-disable-next-line no-use-before-define
|
|
7
7
|
return defaulterO(i);
|
|
8
8
|
case "tuple":
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Detailed, Unionized, PropType, Prop, NonNamedProp, SpecialProp } from "../../types";
|
|
2
|
-
type TypesWithValue = "
|
|
2
|
+
type TypesWithValue = "table" | "tuple" | "select";
|
|
3
3
|
type Values<T extends TypesWithValue> = Detailed<PropType<T>>["values"];
|
|
4
4
|
export declare function getValues(info: Unionized<PropType<"select">>): Values<"select">;
|
|
5
|
-
export declare function getValues(info: Unionized<PropType<"
|
|
5
|
+
export declare function getValues(info: Unionized<PropType<"table">>): Values<"table">;
|
|
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 | SpecialProp) => "number" | "
|
|
8
|
+
export declare const getType: (info: Prop | SpecialProp) => "number" | "select" | "toggle" | "button" | "table" | "tuple" | "text" | "color" | "range";
|
|
9
9
|
export declare const getFormat: (info: Unionized<PropType<"color">>) => import("../../types").ColorFormat;
|
|
10
10
|
export declare const getName: (info: Prop | SpecialProp) => string;
|
|
11
11
|
export declare const getClick: (info: SpecialProp) => () => () => void;
|
|
@@ -6,7 +6,7 @@ type Types =
|
|
|
6
6
|
| "range"
|
|
7
7
|
| "toggle"
|
|
8
8
|
| "tuple"
|
|
9
|
-
| "
|
|
9
|
+
| "table"
|
|
10
10
|
| "button";
|
|
11
11
|
type ColorFormat = "hsl" | "hsla" | "rgb" | "rgba" | "hex" | "hexa";
|
|
12
12
|
|
|
@@ -42,7 +42,7 @@ export type PropType<T extends Types> =
|
|
|
42
42
|
// eslint-disable-next-line no-use-before-define
|
|
43
43
|
{ name: string; type: T; values: NonNamedProp[]; }
|
|
44
44
|
]
|
|
45
|
-
: T extends "
|
|
45
|
+
: T extends "table" ? [
|
|
46
46
|
// eslint-disable-next-line no-use-before-define
|
|
47
47
|
[ name: string, type: T, values: Prop[] ],
|
|
48
48
|
// eslint-disable-next-line no-use-before-define
|
|
@@ -76,8 +76,8 @@ export type Prop =
|
|
|
76
76
|
| [ name: string, type: "tuple", values: NonNamedProp[] ]
|
|
77
77
|
// eslint-disable-next-line no-use-before-define
|
|
78
78
|
| { name: string; type: "tuple"; values: NonNamedProp[]; }
|
|
79
|
-
| [ name: string, type: "
|
|
80
|
-
| { name: string; type: "
|
|
79
|
+
| [ name: string, type: "table", values: Prop[] ]
|
|
80
|
+
| { name: string; type: "table"; values: Prop[]; };
|
|
81
81
|
|
|
82
82
|
export type SpecialProp =
|
|
83
83
|
| [name: string, type: "button", click: () => () => void]
|
|
@@ -99,7 +99,7 @@ export type NonNamedProp =
|
|
|
99
99
|
| { type: "range"; min: number; max: number; step: number; }
|
|
100
100
|
| [ type: "tuple", values: NonNamedProp[] ]
|
|
101
101
|
| { type: "tuple"; values: NonNamedProp[]; }
|
|
102
|
-
| [ type: "
|
|
103
|
-
| { type: "
|
|
102
|
+
| [ type: "table", values: Prop[] ]
|
|
103
|
+
| { type: "table"; values: Prop[]; };
|
|
104
104
|
|
|
105
105
|
export type Event = string;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<script lang="ts">let {
|
|
2
|
+
title = "",
|
|
3
|
+
scale = false,
|
|
4
|
+
onclick,
|
|
5
|
+
onkeypress,
|
|
6
|
+
children
|
|
7
|
+
} = $props();
|
|
4
8
|
</script>
|
|
5
9
|
|
|
6
|
-
<div
|
|
7
|
-
|
|
10
|
+
<div onclick={onclick} onkeypress={onkeypress} role="none" {title} class:scale>
|
|
11
|
+
{@render children?.()}
|
|
8
12
|
</div>
|
|
9
13
|
|
|
10
14
|
<style>
|
|
@@ -1,35 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
click: MouseEvent;
|
|
9
|
-
keypress: KeyboardEvent;
|
|
10
|
-
} & {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
}, {
|
|
13
|
-
default: {};
|
|
14
|
-
}> {
|
|
15
|
-
}
|
|
16
|
-
export type ButtonProps = typeof __propDef.props;
|
|
17
|
-
export type ButtonEvents = typeof __propDef.events;
|
|
18
|
-
export type ButtonSlots = typeof __propDef.slots;
|
|
19
|
-
import { SvelteComponentTyped } from "svelte";
|
|
20
|
-
declare const __propDef: {
|
|
21
|
-
props: {
|
|
22
|
-
title?: string | undefined;
|
|
23
|
-
scale?: boolean | undefined;
|
|
24
|
-
};
|
|
25
|
-
events: {
|
|
26
|
-
click: MouseEvent;
|
|
27
|
-
keypress: KeyboardEvent;
|
|
28
|
-
} & {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
};
|
|
31
|
-
slots: {
|
|
32
|
-
default: {};
|
|
33
|
-
};
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
title?: string;
|
|
4
|
+
scale?: boolean;
|
|
5
|
+
onclick?: (e: MouseEvent) => void;
|
|
6
|
+
onkeypress?: (e: KeyboardEvent) => void;
|
|
7
|
+
children?: Snippet;
|
|
34
8
|
};
|
|
35
|
-
|
|
9
|
+
declare const Button: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type Button = ReturnType<typeof Button>;
|
|
11
|
+
export default Button;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
props: {
|
|
4
|
-
mode?: "props" | "events" | undefined;
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
mode: "props" | "events";
|
|
10
3
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
export default class ControlView extends SvelteComponentTyped<ControlViewProps, ControlViewEvents, ControlViewSlots> {
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
4
|
+
declare const ControlView: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
5
|
+
type ControlView = ReturnType<typeof ControlView>;
|
|
6
|
+
export default ControlView;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<script lang="ts">let {
|
|
2
|
+
position = "hidden"
|
|
3
|
+
} = $props();
|
|
4
|
+
let bottom = $derived("bottom" === position);
|
|
5
|
+
let right = $derived("right" === position);
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<svg viewBox="-50 -50 100 100">
|
|
@@ -24,7 +24,9 @@ $:
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
rect:nth-child(n + 2) {
|
|
27
|
-
transition:
|
|
27
|
+
transition:
|
|
28
|
+
height var(--i-nil-doc-transition-time),
|
|
29
|
+
x var(--i-nil-doc-transition-time),
|
|
28
30
|
y var(--i-nil-doc-transition-time);
|
|
29
31
|
}
|
|
30
32
|
</style>
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
props: {
|
|
4
|
-
position?: "right" | "bottom" | "hidden" | undefined;
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
position: "hidden" | "bottom" | "right";
|
|
10
3
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
export default class Position extends SvelteComponentTyped<PositionProps, PositionEvents, PositionSlots> {
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
4
|
+
declare const Position: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
5
|
+
type Position = ReturnType<typeof Position>;
|
|
6
|
+
export default Position;
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
<script>import { writable } from "svelte/store";
|
|
2
|
-
import {
|
|
1
|
+
<script lang="ts">import { writable } from "svelte/store";
|
|
2
|
+
import { Tween } from "svelte/motion";
|
|
3
3
|
import { createDraggable } from "./action";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
let {
|
|
5
|
+
vertical = false,
|
|
6
|
+
offset = $bindable(4),
|
|
7
|
+
b = false,
|
|
8
|
+
persistent = false,
|
|
9
|
+
side_a,
|
|
10
|
+
side_b
|
|
11
|
+
} = $props();
|
|
12
|
+
let width = $state(null);
|
|
13
|
+
let height = $state(null);
|
|
10
14
|
const { position, draggable } = createDraggable(offset);
|
|
11
|
-
|
|
12
|
-
span = vertical ? width : height;
|
|
15
|
+
let span = $derived(vertical ? width : height);
|
|
13
16
|
const update = (limit, value) => {
|
|
14
17
|
if (null == span) {
|
|
15
18
|
return;
|
|
16
19
|
}
|
|
17
20
|
offset = Math.max(Math.min(value, span - limit), limit);
|
|
18
21
|
};
|
|
19
|
-
const off =
|
|
22
|
+
const off = new Tween(offset, { duration: 50 });
|
|
20
23
|
const min = 4;
|
|
21
24
|
let last = [];
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
style = !b ? `auto 0.2rem ${$off}px` : `${$off}px 0.2rem auto`;
|
|
25
|
+
$effect(() => update(min, $position));
|
|
26
|
+
$effect(() => {
|
|
27
|
+
off.set(offset);
|
|
28
|
+
});
|
|
29
|
+
let style = $derived(!b ? `auto 0.2rem ${off.current}px` : `${off.current}px 0.2rem auto`);
|
|
28
30
|
const moving = writable(false);
|
|
29
31
|
const addLast = (v) => {
|
|
30
32
|
if (v > min) {
|
|
@@ -36,7 +38,7 @@ const addLast = (v) => {
|
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
40
|
const dbltap = () => {
|
|
39
|
-
if (
|
|
41
|
+
if (off.current > min) {
|
|
40
42
|
addLast(offset);
|
|
41
43
|
offset = min;
|
|
42
44
|
} else if (last.length > 0) {
|
|
@@ -72,8 +74,8 @@ const title = (v, b2) => {
|
|
|
72
74
|
>
|
|
73
75
|
{#if width != null && height != null}
|
|
74
76
|
<div style:grid-area="A">
|
|
75
|
-
{#if persistent || check(
|
|
76
|
-
|
|
77
|
+
{#if persistent || check(off.current, !b, span ?? 0)}
|
|
78
|
+
{@render side_a()}
|
|
77
79
|
{/if}
|
|
78
80
|
</div>
|
|
79
81
|
<div class="divider">
|
|
@@ -85,14 +87,14 @@ const title = (v, b2) => {
|
|
|
85
87
|
reversed: !b,
|
|
86
88
|
vertical,
|
|
87
89
|
dbltap: dbltap,
|
|
88
|
-
tap: () => addLast(
|
|
90
|
+
tap: () => addLast(off.current),
|
|
89
91
|
moving
|
|
90
92
|
}}
|
|
91
|
-
|
|
93
|
+
></div>
|
|
92
94
|
</div>
|
|
93
95
|
<div style:grid-area="B">
|
|
94
|
-
{#if persistent || check(
|
|
95
|
-
|
|
96
|
+
{#if persistent || check(off.current, b, span ?? 0)}
|
|
97
|
+
{@render side_b()}
|
|
96
98
|
{/if}
|
|
97
99
|
</div>
|
|
98
100
|
{/if}
|
|
@@ -147,7 +149,8 @@ const title = (v, b2) => {
|
|
|
147
149
|
|
|
148
150
|
/* colors */
|
|
149
151
|
.divider {
|
|
150
|
-
transition:
|
|
152
|
+
transition:
|
|
153
|
+
border-color var(--i-nil-doc-transition-time),
|
|
151
154
|
background-color var(--i-nil-doc-transition-time);
|
|
152
155
|
--width: 0.0625rem;
|
|
153
156
|
}
|