@nil-/doc 0.2.45 → 0.2.47

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/components/block/Controls.svelte +2 -1
  3. package/components/block/Controls.svelte.d.ts +3 -2
  4. package/components/block/Instance.svelte +39 -8
  5. package/components/block/Instance.svelte.d.ts +9 -7
  6. package/components/block/Template.svelte +2 -1
  7. package/components/block/Template.svelte.d.ts +1 -0
  8. package/components/block/context.d.ts +7 -2
  9. package/components/block/context.js +4 -1
  10. package/components/block/controls/events/Events.svelte +69 -0
  11. package/components/block/controls/events/Events.svelte.d.ts +21 -0
  12. package/components/block/controls/events/misc/Styler.svelte +83 -0
  13. package/components/block/controls/{misc → events/misc}/Styler.svelte.d.ts +0 -0
  14. package/components/block/controls/props/Component.svelte +49 -0
  15. package/components/block/controls/{Component.svelte.d.ts → props/Component.svelte.d.ts} +2 -2
  16. package/components/block/controls/{Number.svelte → props/Number.svelte} +4 -2
  17. package/components/block/controls/{Number.svelte.d.ts → props/Number.svelte.d.ts} +2 -2
  18. package/components/block/controls/{Object.svelte → props/Object.svelte} +5 -3
  19. package/components/block/controls/{Object.svelte.d.ts → props/Object.svelte.d.ts} +3 -3
  20. package/components/block/controls/props/Props.svelte +19 -0
  21. package/components/block/controls/props/Props.svelte.d.ts +22 -0
  22. package/components/block/controls/{Range.svelte → props/Range.svelte} +13 -5
  23. package/components/block/controls/{Range.svelte.d.ts → props/Range.svelte.d.ts} +2 -2
  24. package/components/block/controls/{Select.svelte → props/Select.svelte} +8 -4
  25. package/components/block/controls/{Select.svelte.d.ts → props/Select.svelte.d.ts} +2 -2
  26. package/components/block/controls/{Switch.svelte → props/Switch.svelte} +4 -2
  27. package/components/block/controls/{Switch.svelte.d.ts → props/Switch.svelte.d.ts} +2 -2
  28. package/components/block/controls/{Text.svelte → props/Text.svelte} +4 -2
  29. package/components/block/controls/{Text.svelte.d.ts → props/Text.svelte.d.ts} +2 -2
  30. package/components/block/controls/props/Tuple.svelte +39 -0
  31. package/components/block/controls/{Tuple.svelte.d.ts → props/Tuple.svelte.d.ts} +3 -3
  32. package/components/block/controls/{misc → props/misc}/GroupHeader.svelte +0 -0
  33. package/components/block/controls/{misc → props/misc}/GroupHeader.svelte.d.ts +0 -0
  34. package/components/block/controls/{misc → props/misc}/Name.svelte +0 -0
  35. package/components/block/controls/{misc → props/misc}/Name.svelte.d.ts +0 -0
  36. package/components/block/controls/{misc → props/misc}/Styler.svelte +25 -26
  37. package/components/block/controls/props/misc/Styler.svelte.d.ts +16 -0
  38. package/components/block/controls/props/misc/defaulter.d.ts +12 -0
  39. package/components/block/controls/props/misc/defaulter.js +71 -0
  40. package/components/block/controls/types.d.ts +55 -60
  41. package/components/etc/Container.svelte +4 -0
  42. package/components/navigation/types.d.ts +1 -1
  43. package/components/navigation/utils/renamer.d.ts +1 -5
  44. package/components/navigation/utils/renamer.js +2 -5
  45. package/components/navigation/utils/sorter.d.ts +1 -6
  46. package/components/navigation/utils/sorter.js +2 -6
  47. package/index.d.ts +1 -1
  48. package/package.json +5 -5
  49. package/components/block/controls/Component.svelte +0 -29
  50. package/components/block/controls/Controls.svelte +0 -13
  51. package/components/block/controls/Controls.svelte.d.ts +0 -19
  52. package/components/block/controls/Tuple.svelte +0 -27
  53. package/components/block/controls/misc/TopHeader.svelte +0 -12
  54. package/components/block/controls/misc/TopHeader.svelte.d.ts +0 -23
  55. package/components/block/controls/misc/defaulter.d.ts +0 -10
  56. package/components/block/controls/misc/defaulter.js +0 -36
@@ -1,9 +1,9 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { ControlSelect } from "./types";
2
+ import type { Name, PropSelect, FlatPropSelect } from "../types";
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  value: string | undefined;
6
- info: ControlSelect;
6
+ info: (Name & PropSelect) | [string, ...FlatPropSelect];
7
7
  depth: number;
8
8
  disabled?: boolean | undefined;
9
9
  visible?: boolean | undefined;
@@ -1,6 +1,6 @@
1
1
 
2
2
  <script>import { getDefault } from "./misc/defaulter";
3
- import Name from "./misc/Name.svelte";
3
+ import NameHeader from "./misc/Name.svelte";
4
4
  export let value;
5
5
  export let info;
6
6
  export let depth;
@@ -10,10 +10,12 @@ let ivalue = value ?? getDefault(info);
10
10
  let enabled = value !== void 0;
11
11
  $:
12
12
  value = enabled && !disabled ? ivalue : void 0;
13
+ $:
14
+ name = info instanceof Array ? info[0] : info.name;
13
15
  </script>
14
16
  {#if visible}
15
17
  <div>
16
- <Name name={info.name} {depth} />
18
+ <NameHeader {name} {depth} />
17
19
  <div><input type="checkbox" bind:checked={ivalue} disabled={!enabled || disabled} /></div>
18
20
  <div><input type="checkbox" bind:checked={enabled} {disabled} /></div>
19
21
  </div>
@@ -1,9 +1,9 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { ControlSwitch } from "./types";
2
+ import type { Name, PropSwitch, FlatPropSwitch } from "../types";
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  value: boolean | undefined;
6
- info: ControlSwitch;
6
+ info: (Name & PropSwitch) | [string, ...FlatPropSwitch];
7
7
  depth: number;
8
8
  disabled?: boolean | undefined;
9
9
  visible?: boolean | undefined;
@@ -1,6 +1,6 @@
1
1
 
2
2
  <script>import { getDefault } from "./misc/defaulter";
3
- import Name from "./misc/Name.svelte";
3
+ import NameHeader from "./misc/Name.svelte";
4
4
  export let value;
5
5
  export let info;
6
6
  export let depth;
@@ -10,10 +10,12 @@ let ivalue = value ?? getDefault(info);
10
10
  let ienabled = value !== void 0;
11
11
  $:
12
12
  value = ienabled && !disabled ? ivalue : void 0;
13
+ $:
14
+ name = info instanceof Array ? info[0] : info.name;
13
15
  </script>
14
16
  {#if visible}
15
17
  <div>
16
- <Name name={info.name} {depth} />
18
+ <NameHeader {name} {depth} />
17
19
  <div><input type="text" bind:value={ivalue} disabled={!ienabled || disabled} /></div>
18
20
  <div><input type="checkbox" bind:checked={ienabled} {disabled} /></div>
19
21
  </div>
@@ -1,9 +1,9 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { ControlText } from "./types";
2
+ import type { Name, PropText, FlatPropText } from "../types";
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  value: string | undefined;
6
- info: ControlText;
6
+ info: (Name & PropText) | [string, ...FlatPropText];
7
7
  depth: number;
8
8
  disabled?: boolean | undefined;
9
9
  visible?: boolean | undefined;
@@ -0,0 +1,39 @@
1
+
2
+ <script>import Component from "./Component.svelte";
3
+ import Header from "./misc/GroupHeader.svelte";
4
+ import { getDefault } from "./misc/defaulter";
5
+ export let value;
6
+ export let info;
7
+ export let depth;
8
+ export let disabled = false;
9
+ export let visible = false;
10
+ let ivalue = value ?? getDefault(info);
11
+ let enabled = value !== void 0;
12
+ $:
13
+ 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
+ let expand = info.values.length > 0 ? true : void 0;
19
+ </script>
20
+ <Header {name} bind:expand bind:checked={enabled} {depth} {disabled} {visible} />
21
+ {#each values as v, i (i)}
22
+ {#if v instanceof Array}
23
+ <Component
24
+ info={[`${i}`, ...v]}
25
+ bind:value={ivalue[i]}
26
+ depth={depth + 10}
27
+ disabled={!enabled || disabled}
28
+ visible={visible && expand && enabled && !disabled}
29
+ />
30
+ {:else}
31
+ <Component
32
+ info={{ ...v, name: `${i}` }}
33
+ bind:value={ivalue[i]}
34
+ depth={depth + 10}
35
+ disabled={!enabled || disabled}
36
+ visible={visible && expand && enabled && !disabled}
37
+ />
38
+ {/if}
39
+ {/each}
@@ -1,10 +1,10 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { ValueType } from "../types";
3
- import type { ControlTuple } from "./types";
2
+ import type { ValueType } from "../../types";
3
+ import type { Name, PropTuple, FlatPropTuple } from "../types";
4
4
  declare const __propDef: {
5
5
  props: {
6
6
  value: ValueType[] | undefined;
7
- info: ControlTuple;
7
+ info: (Name & PropTuple) | [string, ...FlatPropTuple];
8
8
  depth: number;
9
9
  disabled?: boolean | undefined;
10
10
  visible?: boolean | undefined;
@@ -1,4 +1,4 @@
1
- <script>import { getTheme } from "../../../context";
1
+ <script>import { getTheme } from "../../../../context";
2
2
  const dark = getTheme();
3
3
  </script>
4
4
  <style>
@@ -24,45 +24,44 @@ const dark = getTheme();
24
24
  grid-template-columns: minmax(250px, 1fr) 200px 40px;
25
25
  }
26
26
 
27
+ div > :global(div:first-child) {
28
+ text-align: center;
29
+ }
30
+
27
31
  div > :global(div > div:not(:first-child) > *) {
28
32
  width: 100%;
29
33
  height: 100%;
30
34
  }
31
35
 
32
36
  /* colors */
33
- div > :global(div) {
34
- transition: background-color 150ms;
35
- background-color: hsl(0, 0%, 100%);
36
- }
37
-
38
- div > :global(div:nth-child(even)) {
39
- background-color: hsl(210, 29%, 97%);
40
- }
41
-
42
- div > :global(div:nth-child(n + 2):hover) {
43
- background-color: hsl(210, 100%, 90%);
44
- }
45
-
46
- div > :global(div:hover .tooltip) {
47
- background-color: hsl(0, 0%, 100%);
48
- outline: hsl(0, 100%, 0%) 1px solid;
37
+ div {
38
+ --pri-color: hsl(0, 0%, 100%);
39
+ --sec-color: hsl(210, 29%, 97%);
40
+ --hover-color: hsl(210, 100%, 90%);
41
+ --outline-color: hsl(0, 0%, 0%);
49
42
  }
50
43
 
51
- div.dark > :global(div) {
52
- background-color: hsl(213, 26%, 7%);
44
+ div.dark {
45
+ --pri-color: hsl(213, 26%, 7%);
46
+ --sec-color: hsl(213, 26%, 11%);
47
+ --hover-color: hsl(203, 100%, 15%);
48
+ --outline-color: hsl(200, 6%, 80%);
53
49
  }
54
50
 
55
- div.dark > :global(div:nth-child(even)) {
56
- background-color: hsl(213, 26%, 11%);
51
+ div {
52
+ transition: background-color 150ms;
53
+ background-repeat: repeat;
54
+ background-size: 100% 60px;
55
+ background-image: linear-gradient(to bottom, var(--pri-color) 30px, var(--sec-color) 30px);
57
56
  }
58
57
 
59
- div.dark > :global(div:nth-child(n + 2):hover) {
60
- background-color: hsl(203, 100%, 15%);
58
+ div > :global(div:nth-child(n + 2):hover) {
59
+ background-color: var(--hover-color);
61
60
  }
62
61
 
63
- div.dark > :global(div:hover .tooltip) {
64
- background-color: hsl(213, 26%, 7%);
65
- outline: hsl(200, 6%, 80%) 1px solid;
62
+ div > :global(div:hover .tooltip) {
63
+ background-color: var(--pri-color);
64
+ outline: var(--outline-color) 1px solid;
66
65
  }
67
66
  </style>
68
67
 
@@ -0,0 +1,16 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: Record<string, never>;
4
+ events: {
5
+ [evt: string]: CustomEvent<any>;
6
+ };
7
+ slots: {
8
+ default: {};
9
+ };
10
+ };
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
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { ValueType } from "../../../types";
2
+ import type { Prop, Name } from "../../types";
3
+ import type { PropNumber, PropRange, PropSelect, PropSwitch, PropText, PropTuple, PropObject } from "../../types";
4
+ import type { FlatPropNumber, FlatPropRange, FlatPropSelect, FlatPropSwitch, FlatPropText, FlatPropTuple, FlatPropObject } from "../../types";
5
+ export declare function getDefault(i: (Name & PropTuple) | [string, ...FlatPropTuple]): ValueType[];
6
+ export declare function getDefault(i: (Name & PropObject) | [string, ...FlatPropObject]): Record<string, ValueType>;
7
+ export declare function getDefault(i: (Name & PropNumber) | [string, ...FlatPropNumber]): number;
8
+ export declare function getDefault(i: (Name & PropRange) | [string, ...FlatPropRange]): number;
9
+ export declare function getDefault(i: (Name & PropSelect) | [string, ...FlatPropSelect]): string;
10
+ export declare function getDefault(i: (Name & PropText) | [string, ...FlatPropText]): string;
11
+ export declare function getDefault(i: (Name & PropSwitch) | [string, ...FlatPropSwitch]): boolean;
12
+ export declare function getDefault(i: Prop): ValueType;
@@ -0,0 +1,71 @@
1
+ // eslint-disable-next-line func-style
2
+ export function getDefault(i) {
3
+ if (i instanceof Array) {
4
+ switch (i[1]) {
5
+ case "object":
6
+ // eslint-disable-next-line no-use-before-define
7
+ return getObjectDefaults(i);
8
+ case "tuple":
9
+ // eslint-disable-next-line no-use-before-define
10
+ return getTupleDefaults(i);
11
+ case "text":
12
+ return "";
13
+ case "select":
14
+ return i[2].length > 0 ? i[2][0] : "";
15
+ case "number":
16
+ return 0;
17
+ case "range":
18
+ return i[2];
19
+ case "switch":
20
+ default:
21
+ return false;
22
+ }
23
+ }
24
+ else {
25
+ switch (i.type) {
26
+ case "object":
27
+ // eslint-disable-next-line no-use-before-define
28
+ return getObjectDefaults(i);
29
+ case "tuple":
30
+ // eslint-disable-next-line no-use-before-define
31
+ return getTupleDefaults(i);
32
+ case "text":
33
+ return "";
34
+ case "select":
35
+ return i.values.length > 0 ? i.values[0] : "";
36
+ case "number":
37
+ return 0;
38
+ case "range":
39
+ return i.min;
40
+ case "switch":
41
+ default:
42
+ return false;
43
+ }
44
+ }
45
+ }
46
+ const getObjectDefaults = (info) => {
47
+ const ret = {};
48
+ const values = info instanceof Array ? info[2] : info.values;
49
+ for (const v of values) {
50
+ if (v instanceof Array) {
51
+ ret[v[0]] = getDefault(v);
52
+ }
53
+ else {
54
+ ret[v.name] = getDefault(v);
55
+ }
56
+ }
57
+ return ret;
58
+ };
59
+ const getTupleDefaults = (info) => {
60
+ const ret = [];
61
+ const values = info instanceof Array ? info[2] : info.values;
62
+ values.forEach((v, i) => {
63
+ if (v instanceof Array) {
64
+ ret.push(getDefault([`${i}`, ...v]));
65
+ }
66
+ else {
67
+ ret.push(getDefault({ name: `${i}`, ...v }));
68
+ }
69
+ });
70
+ return ret;
71
+ };
@@ -1,60 +1,55 @@
1
- export type ControlTuple = {
2
- name: string;
3
- type: "tuple";
4
- // eslint-disable-next-line no-use-before-define
5
- values: NonNamedControl[];
6
- };
7
-
8
- export type ControlObject = {
9
- name: string;
10
- type: "object";
11
- // eslint-disable-next-line no-use-before-define
12
- values: Control[];
13
- };
14
-
15
- export type ControlText = {
16
- name: string;
17
- type: "text";
18
- };
19
-
20
- export type ControlNumber = {
21
- name: string;
22
- type: "number";
23
- };
24
-
25
- export type ControlRange = {
26
- name: string;
27
- type: "range";
28
- min: number;
29
- max: number;
30
- step: number;
31
- };
32
-
33
- export type ControlSelect = {
34
- name: string;
35
- type: "select";
36
- values: string[];
37
- };
38
-
39
- export type ControlSwitch = {
40
- name: string;
41
- type: "switch";
42
- };
43
-
44
- export type Control =
45
- | ControlTuple
46
- | ControlObject
47
- | ControlText
48
- | ControlNumber
49
- | ControlRange
50
- | ControlSelect
51
- | ControlSwitch;
52
-
53
- type NonNamedControl =
54
- | Omit<ControlTuple, "name">
55
- | Omit<ControlObject, "name">
56
- | Omit<ControlText, "name">
57
- | Omit<ControlNumber, "name">
58
- | Omit<ControlRange, "name">
59
- | Omit<ControlSelect, "name">
60
- | Omit<ControlSwitch, "name">;
1
+ // eslint-disable-next-line no-use-before-define
2
+ export type FlatPropTuple = ["tuple", NonNamedProp[]];
3
+ // eslint-disable-next-line no-use-before-define
4
+ export type FlatPropObject = ["object", Prop[]];
5
+ export type FlatPropText = ["text"];
6
+ export type FlatPropNumber = ["number"];
7
+ export type FlatPropRange = ["range", number, number, number];
8
+ export type FlatPropSelect = ["select", string[]];
9
+ export type FlatPropSwitch = ["switch"];
10
+
11
+ // eslint-disable-next-line no-use-before-define
12
+ export type PropTuple = { type: "tuple" } & { values: NonNamedProp[] };
13
+ // eslint-disable-next-line no-use-before-define
14
+ export type PropObject = { type: "object" } & { values: Prop[] };
15
+ export type PropText = { type: "text" };
16
+ export type PropNumber = { type: "number" };
17
+ export type PropSwitch = { type: "switch" };
18
+ export type PropSelect = { type: "select" } & { values: string[] };
19
+ export type PropRange = { type: "range" } & { min: number; max: number; step: number };
20
+
21
+ export type Name = { name: string };
22
+
23
+ export type Prop =
24
+ | (Name & PropTuple)
25
+ | (Name & PropObject)
26
+ | (Name & PropText)
27
+ | (Name & PropNumber)
28
+ | (Name & PropSwitch)
29
+ | (Name & PropSelect)
30
+ | (Name & PropRange)
31
+ | [string, ...FlatPropTuple]
32
+ | [string, ...FlatPropObject]
33
+ | [string, ...FlatPropText]
34
+ | [string, ...FlatPropNumber]
35
+ | [string, ...FlatPropSwitch]
36
+ | [string, ...FlatPropSelect]
37
+ | [string, ...FlatPropRange];
38
+
39
+ type NonNamedProp =
40
+ | PropTuple
41
+ | PropObject
42
+ | PropText
43
+ | PropNumber
44
+ | PropRange
45
+ | PropSelect
46
+ | PropSwitch
47
+ | FlatPropTuple
48
+ | FlatPropObject
49
+ | FlatPropText
50
+ | FlatPropNumber
51
+ | FlatPropRange
52
+ | FlatPropSelect
53
+ | FlatPropSwitch;
54
+
55
+ export type Event = string;
@@ -76,18 +76,22 @@
76
76
  background-color: var(--color-p);
77
77
  }
78
78
 
79
+ .container:not(.b):not(.vertical) > .divider:hover,
79
80
  .container.moving:not(.b):not(.vertical) > .divider {
80
81
  border-bottom: var(--color-s) solid 2.5px;
81
82
  }
82
83
 
84
+ .container.b:not(.vertical) > .divider:hover,
83
85
  .container.moving.b:not(.vertical) > .divider {
84
86
  border-top: var(--color-s) solid 2.5px;
85
87
  }
86
88
 
89
+ .container:not(.b).vertical > .divider:hover,
87
90
  .container.moving:not(.b).vertical > .divider {
88
91
  border-right: var(--color-s) solid 2.5px;
89
92
  }
90
93
 
94
+ .container.vertical.b > .divider:hover,
91
95
  .container.moving.vertical.b > .divider {
92
96
  border-left: var(--color-s) solid 2.5px;
93
97
  }
@@ -8,5 +8,5 @@ export type States = {
8
8
  sub: Record<string, States>;
9
9
  };
10
10
 
11
- export type Sorter = (l: string, r: string) => 1 | 0 | -1;
11
+ export type Sorter = (l: string, r: string) => -1 | 0 | 1;
12
12
  export type Renamer = (s: string) => string;
@@ -1,9 +1,5 @@
1
- import type { Renamer } from "../types";
2
1
  /**
3
2
  * If a text follows `<I>-<Name>` format,
4
3
  * this method simply removes the Prefix.
5
- *
6
- * @param text
7
- * @returns `<Name>`
8
4
  */
9
- export declare const renamer: Renamer;
5
+ export declare const renamer: (text: string) => string;
@@ -2,14 +2,11 @@ const match = /(\d+)-(.+)/;
2
2
  /**
3
3
  * If a text follows `<I>-<Name>` format,
4
4
  * this method simply removes the Prefix.
5
- *
6
- * @param text
7
- * @returns `<Name>`
8
5
  */
9
- export const renamer = (text) => {
6
+ export const renamer = ((text) => {
10
7
  const m = match.exec(text);
11
8
  if (m) {
12
9
  return m[2];
13
10
  }
14
11
  return text;
15
- };
12
+ });
@@ -1,4 +1,3 @@
1
- import type { Sorter } from "../types";
2
1
  /**
3
2
  * Compares two texts for sorting.
4
3
  *
@@ -9,9 +8,5 @@ import type { Sorter } from "../types";
9
8
  * the text that follows the format is considered as higher in order.
10
9
  *
11
10
  * Else comparison is done using built-in `string` comparison.
12
- *
13
- * @param l - left operand
14
- * @param r - right operand
15
- * @returns `-1 | 0 | +1`
16
11
  */
17
- export declare const sorter: Sorter;
12
+ export declare const sorter: (l: string, r: string) => -1 | 0 | 1;
@@ -18,12 +18,8 @@ const sorterT = (l, r) => {
18
18
  * the text that follows the format is considered as higher in order.
19
19
  *
20
20
  * Else comparison is done using built-in `string` comparison.
21
- *
22
- * @param l - left operand
23
- * @param r - right operand
24
- * @returns `-1 | 0 | +1`
25
21
  */
26
- export const sorter = (l, r) => {
22
+ export const sorter = ((l, r) => {
27
23
  const lmatch = match.exec(l);
28
24
  const rmatch = match.exec(r);
29
25
  if (null == lmatch && null == rmatch) {
@@ -36,4 +32,4 @@ export const sorter = (l, r) => {
36
32
  return -1;
37
33
  }
38
34
  return sorterT(parseInt(lmatch[1]), parseInt(rmatch[1])) || sorterT(lmatch[2], rmatch[2]);
39
- };
35
+ });
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { renamer } from "./components/navigation/utils/renamer";
2
2
  export { sorter } from "./components/navigation/utils/sorter";
3
- export type { Control } from "./components/block/controls/types";
3
+ export type { Prop, Event } from "./components/block/controls/types";
4
4
  export { default as Layout } from "./components/Layout.svelte";
5
5
  export { default as Instance } from "./components/block/Instance.svelte";
6
6
  export { default as Block } from "./components/block/Block.svelte";
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@nil-/doc",
3
- "version": "0.2.45",
3
+ "version": "0.2.47",
4
4
  "author": {
5
5
  "email": "njaldea@gmail.com",
6
6
  "name": "Neil Aldea"
7
7
  },
8
8
  "license": "ISC",
9
9
  "devDependencies": {
10
- "@sveltejs/adapter-vercel": "^1.0.0",
11
- "@sveltejs/kit": "^1.0.5",
10
+ "@sveltejs/adapter-vercel": "^1.0.5",
11
+ "@sveltejs/kit": "^1.3.2",
12
12
  "@sveltejs/package": "^1.0.2",
13
13
  "@vitest/coverage-c8": "^0.26.3",
14
14
  "mdsvex": "^0.10.6",
15
15
  "remark-admonitions": "^1.2.1",
16
16
  "svelte-check": "^2.10.3",
17
- "tslib": "^2.4.1",
17
+ "tslib": "^2.5.0",
18
18
  "typescript": "^4.9.4",
19
19
  "vite": "^4.0.4",
20
20
  "vitest": "^0.26.3"
21
21
  },
22
22
  "peerDependencies": {
23
- "svelte": "^3.55.0"
23
+ "svelte": "^3.55.1"
24
24
  },
25
25
  "publishConfig": {
26
26
  "linkDirectory": true
@@ -1,29 +0,0 @@
1
-
2
- <script>import Text from "./Text.svelte";
3
- import Number from "./Number.svelte";
4
- import Range from "./Range.svelte";
5
- import Switch from "./Switch.svelte";
6
- import Select from "./Select.svelte";
7
- import Tuple from "./Tuple.svelte";
8
- import Object from "./Object.svelte";
9
- export let value;
10
- export let info;
11
- export let depth;
12
- export let disabled = false;
13
- export let visible = false;
14
- </script>
15
- {#if "object" === info.type}
16
- <Object {info} bind:value {depth} {disabled} {visible} />
17
- {:else if "tuple" === info.type}
18
- <Tuple {info} bind:value {depth} {disabled} {visible} />
19
- {:else if "text" === info.type}
20
- <Text {info} bind:value {depth} {disabled} {visible} />
21
- {:else if "number" === info.type}
22
- <Number {info} bind:value {depth} {disabled} {visible} />
23
- {:else if "range" === info.type}
24
- <Range {info} bind:value {depth} {disabled} {visible} />
25
- {:else if "select" === info.type}
26
- <Select {info} bind:value {depth} {disabled} {visible} />
27
- {:else if "switch" === info.type}
28
- <Switch {info} bind:value {depth} {disabled} {visible} />
29
- {/if}
@@ -1,13 +0,0 @@
1
-
2
- <script>import Component from "./Component.svelte";
3
- import Header from "./misc/TopHeader.svelte";
4
- import Styler from "./misc/Styler.svelte";
5
- export let infos;
6
- export let values;
7
- </script>
8
- <Styler>
9
- <Header />
10
- {#each infos as info}
11
- <Component {info} bind:value={values[info.name]} depth={10} visible />
12
- {/each}
13
- </Styler>
@@ -1,19 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { ValueType } from "../types";
3
- import type { Control } from "./types";
4
- declare const __propDef: {
5
- props: {
6
- infos: Control[];
7
- values: Record<string, ValueType>;
8
- };
9
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {};
13
- };
14
- export type ControlsProps = typeof __propDef.props;
15
- export type ControlsEvents = typeof __propDef.events;
16
- export type ControlsSlots = typeof __propDef.slots;
17
- export default class Controls extends SvelteComponentTyped<ControlsProps, ControlsEvents, ControlsSlots> {
18
- }
19
- export {};