@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
package/components/Base.svelte
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
1
|
+
<script lang="ts">let {
|
|
2
|
+
dark = false,
|
|
3
|
+
fill = false,
|
|
4
|
+
children
|
|
5
|
+
} = $props();
|
|
3
6
|
</script>
|
|
4
7
|
|
|
5
8
|
<div class:dark class:fill>
|
|
6
|
-
|
|
9
|
+
{@render children?.()}
|
|
7
10
|
</div>
|
|
8
11
|
|
|
9
12
|
<!-- prettier-ignore -->
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
};
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
dark?: boolean;
|
|
4
|
+
fill?: boolean;
|
|
5
|
+
children?: Snippet;
|
|
13
6
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export default class Base extends SvelteComponentTyped<BaseProps, BaseEvents, BaseSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
7
|
+
declare const Base: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type Base = ReturnType<typeof Base>;
|
|
9
|
+
export default Base;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { initParams, initDefaults, initControls, initOrientation } from "./context";
|
|
1
|
+
<script lang="ts">import { initParams, initDefaults, initControls, initOrientation } from "./context";
|
|
2
2
|
import Base from "../Base.svelte";
|
|
3
3
|
import { getTheme } from "../context";
|
|
4
4
|
initParams();
|
|
@@ -6,6 +6,7 @@ initDefaults();
|
|
|
6
6
|
initControls();
|
|
7
7
|
const columns = initOrientation();
|
|
8
8
|
const dark = getTheme();
|
|
9
|
+
let { children } = $props();
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<!--
|
|
@@ -18,7 +19,7 @@ const dark = getTheme();
|
|
|
18
19
|
<Base dark={$dark}>
|
|
19
20
|
<div class="outer">
|
|
20
21
|
<div class="scrollable block" class:columns={$columns}>
|
|
21
|
-
|
|
22
|
+
{@render children?.()}
|
|
22
23
|
</div>
|
|
23
24
|
</div>
|
|
24
25
|
</Base>
|
|
@@ -66,7 +67,8 @@ const dark = getTheme();
|
|
|
66
67
|
background-color: var(--i-nil-doc-block-bg-color);
|
|
67
68
|
box-shadow: 0 0 0.5rem 0 var(--i-nil-doc-block-outline-color);
|
|
68
69
|
outline: 1px solid var(--i-nil-doc-block-outline-color);
|
|
69
|
-
transition:
|
|
70
|
+
transition:
|
|
71
|
+
color var(--i-nil-doc-transition-time),
|
|
70
72
|
background-color var(--i-nil-doc-transition-time);
|
|
71
73
|
}
|
|
72
74
|
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
events: {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
};
|
|
7
|
-
slots: {
|
|
8
|
-
default: {};
|
|
9
|
-
};
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
children: Snippet;
|
|
10
4
|
};
|
|
11
|
-
export type BlockProps = typeof __propDef.props;
|
|
12
|
-
export type BlockEvents = typeof __propDef.events;
|
|
13
|
-
export type BlockSlots = typeof __propDef.slots;
|
|
14
5
|
/**
|
|
15
6
|
* 3-Block
|
|
16
7
|
* See [documentation](https://mono-doc.vercel.app/3-Components/2-Block) for more details.
|
|
17
8
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export
|
|
9
|
+
declare const Block: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type Block = ReturnType<typeof Block>;
|
|
11
|
+
export default Block;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
<script>import { getControls } from "./context";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<script lang="ts">import { getControls } from "./context";
|
|
2
|
+
let {
|
|
3
|
+
props = [],
|
|
4
|
+
events = []
|
|
5
|
+
} = $props();
|
|
4
6
|
const controls = getControls();
|
|
5
|
-
|
|
6
|
-
$controls = { props, events };
|
|
7
|
+
$effect(() => controls.set({ props, events }));
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
10
|
<!--
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
props?: (Prop | SpecialProp)[] | undefined;
|
|
6
|
-
events?: string[] | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
1
|
+
import type { SpecialProp, Prop, Event } from "./controls/types";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
props?: (Prop | SpecialProp)[];
|
|
4
|
+
events?: Event[];
|
|
12
5
|
};
|
|
13
|
-
export type ControlsProps = typeof __propDef.props;
|
|
14
|
-
export type ControlsEvents = typeof __propDef.events;
|
|
15
|
-
export type ControlsSlots = typeof __propDef.slots;
|
|
16
6
|
/** See [documentation](https://mono-doc.vercel.app/3-Components/3-Block/2-Controls) for more details. */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export
|
|
7
|
+
declare const Controls: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type Controls = ReturnType<typeof Controls>;
|
|
9
|
+
export default Controls;
|
|
@@ -1,26 +1,37 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script lang="ts" module></script>
|
|
2
|
+
|
|
3
|
+
<script lang="ts" generics="Args">import { onDestroy } from "svelte";
|
|
2
4
|
import { writable } from "svelte/store";
|
|
3
5
|
import { resolve } from "./utils";
|
|
4
6
|
import { getControls, getControlInfo, getControlValue } from "./context";
|
|
5
7
|
const controls = getControls();
|
|
6
8
|
const cc = getControlInfo();
|
|
7
9
|
const vv = getControlValue();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
let {
|
|
11
|
+
defaults,
|
|
12
|
+
noreset = false,
|
|
13
|
+
children
|
|
14
|
+
} = $props();
|
|
15
|
+
let key = $state(false);
|
|
16
|
+
$effect(() => {
|
|
17
|
+
key;
|
|
18
|
+
return () => {
|
|
19
|
+
key = !key;
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
const s_values = writable({ props: {}, events: [] });
|
|
23
|
+
const updateBound = (d) => $s_values.props = resolve(d ?? {}, {});
|
|
24
|
+
$effect(() => {
|
|
15
25
|
updateBound(defaults);
|
|
26
|
+
});
|
|
16
27
|
const focus = () => {
|
|
17
|
-
if ($vv !==
|
|
28
|
+
if ($vv !== s_values) {
|
|
18
29
|
$cc = controls;
|
|
19
|
-
$vv =
|
|
30
|
+
$vv = s_values;
|
|
20
31
|
}
|
|
21
32
|
};
|
|
22
33
|
const unfocus = () => {
|
|
23
|
-
if ($vv ===
|
|
34
|
+
if ($vv === s_values) {
|
|
24
35
|
$cc = null;
|
|
25
36
|
$vv = null;
|
|
26
37
|
}
|
|
@@ -39,30 +50,32 @@ const populate = (ext) => {
|
|
|
39
50
|
};
|
|
40
51
|
if (null != ext) {
|
|
41
52
|
for (const name of ext) {
|
|
42
|
-
obj[name] = (
|
|
43
|
-
const detail = stringify(
|
|
44
|
-
if ($
|
|
45
|
-
const last = $
|
|
53
|
+
obj[name] = (param) => {
|
|
54
|
+
const detail = stringify(param);
|
|
55
|
+
if ($s_values.events.length > 0) {
|
|
56
|
+
const last = $s_values.events[0];
|
|
46
57
|
if (last.name === name && last.detail === detail && last.count < 99) {
|
|
47
58
|
last.count += 1;
|
|
48
|
-
$
|
|
59
|
+
$s_values.events = $s_values.events;
|
|
49
60
|
return;
|
|
50
61
|
}
|
|
51
62
|
}
|
|
52
|
-
$
|
|
53
|
-
if ($
|
|
54
|
-
$
|
|
63
|
+
$s_values.events.unshift({ name, detail, count: 1 });
|
|
64
|
+
if ($s_values.events.length > 50) {
|
|
65
|
+
$s_values.events.pop();
|
|
55
66
|
}
|
|
56
|
-
$
|
|
67
|
+
$s_values.events = $s_values.events;
|
|
57
68
|
};
|
|
58
69
|
}
|
|
59
70
|
}
|
|
60
71
|
return obj;
|
|
61
72
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
let values = $state(resolve(defaults ?? {}, $s_values.props));
|
|
74
|
+
let events = $state(populate($controls.events));
|
|
75
|
+
const unsubs = [];
|
|
76
|
+
unsubs.push(s_values.subscribe((v) => values = resolve(defaults ?? {}, v.props)));
|
|
77
|
+
unsubs.push(controls.subscribe((v) => events = populate(v.events)));
|
|
78
|
+
onDestroy(() => unsubs.forEach((v) => v()));
|
|
66
79
|
</script>
|
|
67
80
|
|
|
68
81
|
<!--
|
|
@@ -72,19 +85,21 @@ $:
|
|
|
72
85
|
|
|
73
86
|
<div
|
|
74
87
|
class="instance"
|
|
75
|
-
class:selected={$vv ===
|
|
88
|
+
class:selected={$vv === s_values}
|
|
76
89
|
class:controls={$controls.events.length > 0 || $controls.props.length > 0}
|
|
77
90
|
role="none"
|
|
78
|
-
|
|
79
|
-
|
|
91
|
+
onclick={focus}
|
|
92
|
+
onkeypress={null}
|
|
80
93
|
>
|
|
81
94
|
<div class="content">
|
|
82
|
-
{#if
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{
|
|
86
|
-
|
|
87
|
-
|
|
95
|
+
{#if children}
|
|
96
|
+
{#if noreset}
|
|
97
|
+
{@render children({ values, events, key })}
|
|
98
|
+
{:else}
|
|
99
|
+
{#key key}
|
|
100
|
+
{@render children({ values, events, key })}
|
|
101
|
+
{/key}
|
|
102
|
+
{/if}
|
|
88
103
|
{/if}
|
|
89
104
|
</div>
|
|
90
105
|
</div>
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare class __sveltets_Render<
|
|
1
|
+
import { type Snippet } from "svelte";
|
|
2
|
+
declare class __sveltets_Render<Args> {
|
|
3
3
|
props(): {
|
|
4
|
-
defaults?:
|
|
5
|
-
noreset?: boolean
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
slots(): {
|
|
11
|
-
default: {
|
|
12
|
-
props: PropArgs;
|
|
13
|
-
events: Record<string, (ev: CustomEvent<unknown>) => void>;
|
|
4
|
+
defaults?: Args | undefined;
|
|
5
|
+
noreset?: boolean;
|
|
6
|
+
children?: Snippet<[{
|
|
7
|
+
values: Args;
|
|
8
|
+
events: Record<string, (ev?: any) => void>;
|
|
14
9
|
key: boolean;
|
|
15
|
-
};
|
|
10
|
+
}]> | undefined;
|
|
16
11
|
};
|
|
12
|
+
events(): {};
|
|
13
|
+
slots(): {};
|
|
14
|
+
bindings(): "";
|
|
15
|
+
exports(): {};
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
interface $$IsomorphicComponent {
|
|
18
|
+
new <Args>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Args>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Args>['props']>, ReturnType<__sveltets_Render<Args>['events']>, ReturnType<__sveltets_Render<Args>['slots']>> & {
|
|
19
|
+
$$bindings?: ReturnType<__sveltets_Render<Args>['bindings']>;
|
|
20
|
+
} & ReturnType<__sveltets_Render<Args>['exports']>;
|
|
21
|
+
<Args>(internal: unknown, props: ReturnType<__sveltets_Render<Args>['props']> & {}): ReturnType<__sveltets_Render<Args>['exports']>;
|
|
22
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
/** See [documentation](https://mono-doc.vercel.app/3-Components/3-Block/1-Content/1-Instance) for more details. */
|
|
25
|
+
declare const Instance: $$IsomorphicComponent;
|
|
26
|
+
type Instance<Args> = InstanceType<typeof Instance<Args>>;
|
|
27
|
+
export default Instance;
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
<script>import { getParams } from "./context";
|
|
1
|
+
<script lang="ts">import { getParams } from "./context";
|
|
2
2
|
import { resolve } from "./utils";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { get } from "svelte/store";
|
|
4
|
+
let {
|
|
5
|
+
tag,
|
|
6
|
+
props = {}
|
|
7
|
+
} = $props();
|
|
5
8
|
const params = getParams();
|
|
6
|
-
const id =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const id = get(params).length;
|
|
10
|
+
params.update((p) => {
|
|
11
|
+
p.push({
|
|
12
|
+
id,
|
|
13
|
+
tag: `${id}`,
|
|
14
|
+
values: {}
|
|
15
|
+
});
|
|
16
|
+
return p;
|
|
11
17
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
$effect(() => params.update((p) => {
|
|
19
|
+
p[id].tag = tag ?? `${id}`;
|
|
20
|
+
return p;
|
|
21
|
+
}));
|
|
22
|
+
$effect(() => params.update((p) => {
|
|
23
|
+
p[id].values = resolve(props, {});
|
|
24
|
+
return p;
|
|
25
|
+
}));
|
|
16
26
|
</script>
|
|
17
27
|
|
|
18
28
|
<!--
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import type { ValueType } from "./types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
props?: Record<string, ValueType> | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
tag?: string | undefined;
|
|
4
|
+
props?: Record<string, ValueType>;
|
|
12
5
|
};
|
|
13
|
-
export type ParamsProps = typeof __propDef.props;
|
|
14
|
-
export type ParamsEvents = typeof __propDef.events;
|
|
15
|
-
export type ParamsSlots = typeof __propDef.slots;
|
|
16
6
|
/** See [documentation](https://mono-doc.vercel.app/3-Components/3-Block/1-Content/2-Template/1-Params) for more details. */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export
|
|
7
|
+
declare const Params: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type Params = ReturnType<typeof Params>;
|
|
9
|
+
export default Params;
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
1
|
+
<script lang="ts" module></script>
|
|
2
|
+
|
|
3
|
+
<script lang="ts" generics="Args">import { getDefaults, getParams, getOrientation } from "./context";
|
|
3
4
|
import { resolve } from "./utils";
|
|
4
5
|
import Instance from "./Instance.svelte";
|
|
6
|
+
import {} from "svelte";
|
|
5
7
|
const params = getParams();
|
|
6
8
|
const defaultsStore = getDefaults();
|
|
7
9
|
const orientation = getOrientation();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
let {
|
|
11
|
+
defaults,
|
|
12
|
+
noreset = false,
|
|
13
|
+
columns = false,
|
|
14
|
+
children: cc
|
|
15
|
+
} = $props();
|
|
16
|
+
$effect(() => {
|
|
17
|
+
defaultsStore?.set(defaults ?? {});
|
|
18
|
+
});
|
|
19
|
+
$effect(() => {
|
|
20
|
+
orientation.set(columns);
|
|
21
|
+
});
|
|
22
|
+
let key = $state(false);
|
|
23
|
+
$effect(() => {
|
|
24
|
+
key;
|
|
25
|
+
return () => {
|
|
26
|
+
key = !key;
|
|
27
|
+
};
|
|
28
|
+
});
|
|
17
29
|
const resolveArgs = resolve;
|
|
18
30
|
</script>
|
|
19
31
|
|
|
@@ -26,10 +38,15 @@ const resolveArgs = resolve;
|
|
|
26
38
|
<Instance
|
|
27
39
|
defaults={resolveArgs($defaultsStore, param.values)}
|
|
28
40
|
{noreset}
|
|
29
|
-
let:key
|
|
30
|
-
let:props
|
|
31
|
-
let:events
|
|
32
41
|
>
|
|
33
|
-
|
|
42
|
+
{#snippet children({ values, events, key })}
|
|
43
|
+
{@render cc?.({
|
|
44
|
+
id: param.id,
|
|
45
|
+
tag: param.tag,
|
|
46
|
+
values: values,
|
|
47
|
+
events: events,
|
|
48
|
+
key: key
|
|
49
|
+
})}
|
|
50
|
+
{/snippet}
|
|
34
51
|
</Instance>
|
|
35
52
|
{/each}
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Snippet } from "svelte";
|
|
2
2
|
declare class __sveltets_Render<Args> {
|
|
3
3
|
props(): {
|
|
4
4
|
defaults?: Args | undefined;
|
|
5
|
-
noreset?: boolean
|
|
6
|
-
columns?: boolean
|
|
7
|
-
|
|
8
|
-
events(): {} & {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots(): {
|
|
12
|
-
default: {
|
|
5
|
+
noreset?: boolean;
|
|
6
|
+
columns?: boolean;
|
|
7
|
+
children?: Snippet<[{
|
|
13
8
|
id: number;
|
|
14
9
|
tag: string;
|
|
15
|
-
|
|
16
|
-
events: Record<string, (ev
|
|
10
|
+
values: Args;
|
|
11
|
+
events: Record<string, (ev?: any) => void>;
|
|
17
12
|
key: boolean;
|
|
18
|
-
};
|
|
13
|
+
}]> | undefined;
|
|
19
14
|
};
|
|
15
|
+
events(): {};
|
|
16
|
+
slots(): {};
|
|
17
|
+
bindings(): "";
|
|
18
|
+
exports(): {};
|
|
20
19
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
interface $$IsomorphicComponent {
|
|
21
|
+
new <Args>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Args>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Args>['props']>, ReturnType<__sveltets_Render<Args>['events']>, ReturnType<__sveltets_Render<Args>['slots']>> & {
|
|
22
|
+
$$bindings?: ReturnType<__sveltets_Render<Args>['bindings']>;
|
|
23
|
+
} & ReturnType<__sveltets_Render<Args>['exports']>;
|
|
24
|
+
<Args>(internal: unknown, props: ReturnType<__sveltets_Render<Args>['props']> & {}): ReturnType<__sveltets_Render<Args>['exports']>;
|
|
25
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
/** See [documentation](https://mono-doc.vercel.app/3-Components/3-Block/1-Content/2-Template) for more details. */
|
|
28
|
+
declare const Template: $$IsomorphicComponent;
|
|
29
|
+
type Template<Args> = InstanceType<typeof Template<Args>>;
|
|
30
|
+
export default Template;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
<script>import Styler from "./Styler.svelte";
|
|
1
|
+
<script lang="ts">import Styler from "./Styler.svelte";
|
|
2
2
|
import Props from "./props/Props.svelte";
|
|
3
3
|
import Events from "./events/Events.svelte";
|
|
4
4
|
import { getControlInfo, getControlValue } from "../context";
|
|
5
5
|
import Button from "../icons/Button.svelte";
|
|
6
6
|
import ControlView from "../icons/ControlView.svelte";
|
|
7
7
|
import Position from "../icons/Position.svelte";
|
|
8
|
+
import { onDestroy } from "svelte";
|
|
8
9
|
const controls = getControlInfo();
|
|
9
10
|
const values = getControlValue();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
let cc = $state($controls);
|
|
12
|
+
let vv = $state($values);
|
|
13
|
+
const unsubs = [];
|
|
14
|
+
unsubs.push(controls.subscribe((v) => cc = v));
|
|
15
|
+
unsubs.push(values.subscribe((v) => vv = v));
|
|
16
|
+
let {
|
|
17
|
+
mode = $bindable("props"),
|
|
18
|
+
position = $bindable("bottom")
|
|
19
|
+
} = $props();
|
|
16
20
|
const cyclePosition = () => {
|
|
17
21
|
switch (position) {
|
|
18
22
|
case "bottom":
|
|
@@ -33,15 +37,16 @@ const cycleMode = () => {
|
|
|
33
37
|
break;
|
|
34
38
|
}
|
|
35
39
|
};
|
|
40
|
+
onDestroy(() => unsubs.forEach((v) => v()));
|
|
36
41
|
</script>
|
|
37
42
|
|
|
38
43
|
<Styler type={mode}>
|
|
39
44
|
<div class="header">
|
|
40
45
|
<div class="buttons">
|
|
41
|
-
<Button scale
|
|
46
|
+
<Button scale onclick={cyclePosition} title={position}>
|
|
42
47
|
<Position {position} />
|
|
43
48
|
</Button>
|
|
44
|
-
<Button scale
|
|
49
|
+
<Button scale onclick={cycleMode} title={mode}>
|
|
45
50
|
<ControlView {mode} />
|
|
46
51
|
</Button>
|
|
47
52
|
</div>
|
|
@@ -56,7 +61,7 @@ const cycleMode = () => {
|
|
|
56
61
|
</div>
|
|
57
62
|
{#key $values && $controls}
|
|
58
63
|
{#if cc != null && $cc != null && vv != null && $vv != null}
|
|
59
|
-
<Props infos={$cc.props} visible={"props" === mode}
|
|
64
|
+
<Props values={vv} infos={$cc.props} visible={"props" === mode} />
|
|
60
65
|
<Events events={$vv.events} visible={"events" === mode} />
|
|
61
66
|
{/if}
|
|
62
67
|
{/key}
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
mode?: "props" | "events" | undefined;
|
|
5
|
-
position?: "right" | "bottom" | undefined;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
mode: "props" | "events";
|
|
3
|
+
position: "bottom" | "right";
|
|
11
4
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
export default class Controls extends SvelteComponentTyped<ControlsProps, ControlsEvents, ControlsSlots> {
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
5
|
+
declare const Controls: import("svelte").Component<$$ComponentProps, {}, "position" | "mode">;
|
|
6
|
+
type Controls = ReturnType<typeof Controls>;
|
|
7
|
+
export default Controls;
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {
|
|
10
|
-
default: {};
|
|
11
|
-
};
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
type: "props" | "events";
|
|
4
|
+
children?: Snippet;
|
|
12
5
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
export default class Styler extends SvelteComponentTyped<StylerProps, StylerEvents, StylerSlots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
6
|
+
declare const Styler: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type Styler = ReturnType<typeof Styler>;
|
|
8
|
+
export default Styler;
|