@nil-/doc 0.2.39 → 0.2.41
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 +20 -0
- package/components/Layout.svelte +9 -8
- package/components/block/Controls.svelte +1 -1
- package/components/block/Controls.svelte.d.ts +1 -1
- package/components/block/Instance.svelte +10 -0
- package/components/block/Instance.svelte.d.ts +1 -0
- package/components/block/Params.svelte +1 -1
- package/components/block/Params.svelte.d.ts +1 -1
- package/components/block/Template.svelte +9 -2
- package/components/block/Template.svelte.d.ts +2 -1
- package/components/etc/NilIcon.svelte +1 -1
- package/components/navigation/Nav.svelte +1 -1
- package/components/navigation/Node.svelte +5 -2
- package/components/navigation/utils/fuzz.d.ts +1 -0
- package/components/navigation/utils/fuzz.js +7 -4
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @nil-/doc
|
|
2
2
|
|
|
3
|
+
## 0.2.41
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [doc][docu] added page for fuzzy matching ([#65](https://github.com/njaldea/mono/pull/65))
|
|
8
|
+
|
|
9
|
+
## 0.2.40
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [doc][new] added scale flag prop for Instance/Template componen ([#63](https://github.com/njaldea/mono/pull/63))
|
|
14
|
+
|
|
15
|
+
- [doc][patch] fixed jsdoc link for public components ([#63](https://github.com/njaldea/mono/pull/63))
|
|
16
|
+
|
|
17
|
+
- [doc][docu] moved Sorting and Renaming section to their own pages ([#63](https://github.com/njaldea/mono/pull/63))
|
|
18
|
+
|
|
19
|
+
- [doc][new] added placeholder to search bar ([#63](https://github.com/njaldea/mono/pull/63))
|
|
20
|
+
|
|
21
|
+
- [doc][docu] added admonitions plugin ([#63](https://github.com/njaldea/mono/pull/63))
|
|
22
|
+
|
|
3
23
|
## 0.2.39
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/components/Layout.svelte
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
display: grid;
|
|
6
6
|
grid-template-columns: 1fr;
|
|
7
7
|
grid-template-rows: minmax(40px, auto) 1fr;
|
|
8
|
-
gap: 1px;
|
|
9
8
|
width: 100%;
|
|
10
9
|
height: 100%;
|
|
11
10
|
box-sizing: border-box;
|
|
@@ -18,6 +17,8 @@
|
|
|
18
17
|
align-items: center;
|
|
19
18
|
padding-left: 10px;
|
|
20
19
|
padding-right: 10px;
|
|
20
|
+
border-bottom-width: 1px;
|
|
21
|
+
border-bottom-style: solid;
|
|
21
22
|
box-sizing: border-box;
|
|
22
23
|
user-select: none;
|
|
23
24
|
}
|
|
@@ -60,23 +61,23 @@
|
|
|
60
61
|
.layout {
|
|
61
62
|
color-scheme: light;
|
|
62
63
|
color: hsl(0, 0%, 0%);
|
|
63
|
-
background-color: hsl(0,
|
|
64
|
+
background-color: hsl(0, 0%, 100%);
|
|
64
65
|
transition: color 350ms, background-color 350ms;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
.layout.dark {
|
|
68
69
|
color-scheme: dark;
|
|
69
70
|
color: hsl(0, 0%, 80%);
|
|
70
|
-
background-color: hsl(
|
|
71
|
+
background-color: hsl(200, 4%, 14%);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
.layout >
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
.layout > .top {
|
|
75
|
+
transition: border-bottom-colo 350ms;
|
|
76
|
+
border-bottom-color: hsl(0, 2%, 70%);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
.layout.dark >
|
|
79
|
-
|
|
79
|
+
.layout.dark > .top {
|
|
80
|
+
border-bottom-color: hsl(0, 2%, 40%);
|
|
80
81
|
}
|
|
81
82
|
</style>
|
|
82
83
|
|
|
@@ -14,7 +14,7 @@ declare const __propDef: {
|
|
|
14
14
|
export type ControlsProps = typeof __propDef.props;
|
|
15
15
|
export type ControlsEvents = typeof __propDef.events;
|
|
16
16
|
export type ControlsSlots = typeof __propDef.slots;
|
|
17
|
-
/** See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/
|
|
17
|
+
/** See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/2-Controls) for more details. */
|
|
18
18
|
export default class Controls extends SvelteComponentTyped<ControlsProps, ControlsEvents, ControlsSlots> {
|
|
19
19
|
}
|
|
20
20
|
export {};
|
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
overflow: hidden;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
.instance.scale {
|
|
11
|
+
transition: transform 350ms;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.instance.scale:hover {
|
|
15
|
+
transform: scale(1.015);
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
.cside {
|
|
11
19
|
display: grid;
|
|
12
20
|
grid-template-columns: 1fr 550px;
|
|
@@ -75,6 +83,7 @@ $:
|
|
|
75
83
|
expanded = $controls.length > 0 && !$controlsState.hide;
|
|
76
84
|
export let defaults = void 0;
|
|
77
85
|
export let noreset = false;
|
|
86
|
+
export let scale = false;
|
|
78
87
|
let key = false;
|
|
79
88
|
beforeUpdate(() => key = !key);
|
|
80
89
|
const resolveArgs = resolve;
|
|
@@ -87,6 +96,7 @@ $:
|
|
|
87
96
|
</script>
|
|
88
97
|
<div
|
|
89
98
|
class="instance"
|
|
99
|
+
class:scale
|
|
90
100
|
class:cside={expanded && "right" === $controlsState.position}
|
|
91
101
|
use:cquery={{
|
|
92
102
|
class: "cside",
|
|
@@ -17,5 +17,5 @@ $:
|
|
|
17
17
|
</script>
|
|
18
18
|
<!--
|
|
19
19
|
@component
|
|
20
|
-
See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/2-Template/1-Params) for more details.
|
|
20
|
+
See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/1-Content/2-Template/1-Params) for more details.
|
|
21
21
|
-->
|
|
@@ -13,7 +13,7 @@ declare const __propDef: {
|
|
|
13
13
|
export type ParamsProps = typeof __propDef.props;
|
|
14
14
|
export type ParamsEvents = typeof __propDef.events;
|
|
15
15
|
export type ParamsSlots = typeof __propDef.slots;
|
|
16
|
-
/** See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/2-Template/1-Params) for more details. */
|
|
16
|
+
/** See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/1-Content/2-Template/1-Params) for more details. */
|
|
17
17
|
export default class Params extends SvelteComponentTyped<ParamsProps, ParamsEvents, ParamsSlots> {
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -9,6 +9,7 @@ const orientation = getOrientation();
|
|
|
9
9
|
export let defaults = void 0;
|
|
10
10
|
export let noreset = false;
|
|
11
11
|
export let columns = false;
|
|
12
|
+
export let scale = false;
|
|
12
13
|
$:
|
|
13
14
|
$defaultsStore = defaults ?? {};
|
|
14
15
|
$:
|
|
@@ -20,10 +21,16 @@ const cast = (t) => t;
|
|
|
20
21
|
</script>
|
|
21
22
|
<!--
|
|
22
23
|
@component
|
|
23
|
-
See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/2-Template) for more details.
|
|
24
|
+
See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/1-Content/2-Template) for more details.
|
|
24
25
|
-->
|
|
25
26
|
{#each $params as param (param.id)}
|
|
26
|
-
<Instance
|
|
27
|
+
<Instance
|
|
28
|
+
defaults={resolveArgs($defaultsStore, param.values)}
|
|
29
|
+
{noreset}
|
|
30
|
+
{scale}
|
|
31
|
+
let:key
|
|
32
|
+
let:props
|
|
33
|
+
>
|
|
27
34
|
<slot id={param.id} tag={param.tag} props={cast(props)} {key} />
|
|
28
35
|
</Instance>
|
|
29
36
|
{/each}
|
|
@@ -4,6 +4,7 @@ declare class __sveltets_Render<Args> {
|
|
|
4
4
|
defaults?: Args | undefined;
|
|
5
5
|
noreset?: boolean | undefined;
|
|
6
6
|
columns?: boolean | undefined;
|
|
7
|
+
scale?: boolean | undefined;
|
|
7
8
|
};
|
|
8
9
|
events(): {} & {
|
|
9
10
|
[evt: string]: CustomEvent<any>;
|
|
@@ -20,7 +21,7 @@ declare class __sveltets_Render<Args> {
|
|
|
20
21
|
export type TemplateProps<Args> = ReturnType<__sveltets_Render<Args>['props']>;
|
|
21
22
|
export type TemplateEvents<Args> = ReturnType<__sveltets_Render<Args>['events']>;
|
|
22
23
|
export type TemplateSlots<Args> = ReturnType<__sveltets_Render<Args>['slots']>;
|
|
23
|
-
/** See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/2-Template) for more details. */
|
|
24
|
+
/** See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/1-Content/2-Template) for more details. */
|
|
24
25
|
export default class Template<Args> extends SvelteComponentTyped<TemplateProps<Args>, TemplateEvents<Args>, TemplateSlots<Args>> {
|
|
25
26
|
}
|
|
26
27
|
export {};
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
grid-template-columns: 15px 1fr;
|
|
17
17
|
align-items: center;
|
|
18
18
|
cursor: pointer;
|
|
19
|
+
gap: 5px;
|
|
20
|
+
box-sizing: border-box;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
.header:hover {
|
|
22
|
-
background-color:
|
|
24
|
+
background-color: hsla(203, 98%, 50%, 0.07);
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
.header.selected {
|
|
26
|
-
background-color:
|
|
28
|
+
background-color: hsla(203, 98%, 50%, 0.822);
|
|
27
29
|
color: black;
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -31,6 +33,7 @@
|
|
|
31
33
|
justify-content: center;
|
|
32
34
|
height: 15px;
|
|
33
35
|
width: 15px;
|
|
36
|
+
transition: transform 350ms;
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
.icon.expanded {
|
|
@@ -107,13 +107,16 @@ const doScoreFuzzy = (query, queryLower, queryLength, target, targetLower, targe
|
|
|
107
107
|
targetIndex--;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
return [scores[queryLength * targetLength - 1], positions.reverse()];
|
|
110
|
+
return [scores[queryLength * targetLength - 1] ?? 0, positions.reverse()];
|
|
111
111
|
};
|
|
112
|
-
export const
|
|
112
|
+
export const score = (target, query) => {
|
|
113
113
|
const targetLength = target.length;
|
|
114
114
|
const queryLength = query.length;
|
|
115
115
|
if (targetLength < queryLength) {
|
|
116
|
-
return
|
|
116
|
+
return [0, []];
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return doScoreFuzzy(query, query.toLowerCase(), queryLength, target, target.toLowerCase(), targetLength);
|
|
119
|
+
};
|
|
120
|
+
export const fuzz = (target, query) => {
|
|
121
|
+
return score(target, query)[0] > 0;
|
|
119
122
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nil-/doc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.41",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "njaldea@gmail.com",
|
|
6
6
|
"name": "Neil Aldea"
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"@sveltejs/package": "^1.0.1",
|
|
13
13
|
"@vitest/coverage-c8": "^0.26.3",
|
|
14
14
|
"mdsvex": "^0.10.6",
|
|
15
|
+
"remark-admonitions": "^1.2.1",
|
|
15
16
|
"svelte-check": "^2.10.3",
|
|
16
17
|
"tslib": "^2.4.1",
|
|
17
18
|
"typescript": "^4.9.4",
|