@nil-/xit 0.1.28 → 0.2.0
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/assets/bundler.js +264 -265
- package/assets/index.js +2726 -2845
- package/assets/svelte/animate.js +17 -15
- package/assets/svelte/index.js +1268 -1260
- package/assets/svelte/internal/client.js +939 -948
- package/assets/svelte/motion.js +184 -185
- package/assets/svelte/transition.js +29 -29
- package/components/layouts/Container.svelte +1 -2
- package/components/layouts/Scrollable.svelte +1 -1
- package/components/layouts/Split.svelte +6 -9
- package/components/utilities/DividerOverlay.svelte +7 -4
- package/components/utilities/draggable.js +1 -1
- package/package.json +24 -2
|
@@ -14,37 +14,37 @@ function w(t) {
|
|
|
14
14
|
"px"
|
|
15
15
|
];
|
|
16
16
|
}
|
|
17
|
-
function W(t, { delay: e = 0, duration: a = 400, easing:
|
|
18
|
-
const c = getComputedStyle(t),
|
|
17
|
+
function W(t, { delay: e = 0, duration: a = 400, easing: r = C, amount: p = 5, opacity: n = 0 } = {}) {
|
|
18
|
+
const c = getComputedStyle(t), s = +c.opacity, d = c.filter === "none" ? "" : c.filter, i = s * (1 - n), [o, y] = w(p);
|
|
19
19
|
return {
|
|
20
20
|
delay: e,
|
|
21
21
|
duration: a,
|
|
22
|
-
easing:
|
|
23
|
-
css: (f, u) => `opacity: ${
|
|
22
|
+
easing: r,
|
|
23
|
+
css: (f, u) => `opacity: ${s - i * u}; filter: ${d} blur(${u * o}${y});`
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function q(t, { delay: e = 0, duration: a = 400, easing:
|
|
26
|
+
function q(t, { delay: e = 0, duration: a = 400, easing: r = M } = {}) {
|
|
27
27
|
const p = +getComputedStyle(t).opacity;
|
|
28
28
|
return {
|
|
29
29
|
delay: e,
|
|
30
30
|
duration: a,
|
|
31
|
-
easing:
|
|
31
|
+
easing: r,
|
|
32
32
|
css: (n) => `opacity: ${n * p}`
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function B(t, { delay: e = 0, duration: a = 400, easing:
|
|
36
|
-
const
|
|
35
|
+
function B(t, { delay: e = 0, duration: a = 400, easing: r = m, x: p = 0, y: n = 0, opacity: c = 0 } = {}) {
|
|
36
|
+
const s = getComputedStyle(t), d = +s.opacity, i = s.transform === "none" ? "" : s.transform, o = d * (1 - c), [y, f] = w(p), [u, _] = w(n);
|
|
37
37
|
return {
|
|
38
38
|
delay: e,
|
|
39
39
|
duration: a,
|
|
40
|
-
easing:
|
|
40
|
+
easing: r,
|
|
41
41
|
css: ($, h) => `
|
|
42
42
|
transform: ${i} translate(${(1 - $) * y}${f}, ${(1 - $) * u}${_});
|
|
43
43
|
opacity: ${d - o * h}`
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
function L(t, { delay: e = 0, duration: a = 400, easing:
|
|
47
|
-
const n = getComputedStyle(t), c = +n.opacity,
|
|
46
|
+
function L(t, { delay: e = 0, duration: a = 400, easing: r = m, axis: p = "y" } = {}) {
|
|
47
|
+
const n = getComputedStyle(t), c = +n.opacity, s = p === "y" ? "height" : "width", d = parseFloat(n[s]), i = p === "y" ? ["top", "bottom"] : ["left", "right"], o = i.map(
|
|
48
48
|
(l) => (
|
|
49
49
|
/** @type {'Left' | 'Right' | 'Top' | 'Bottom'} */
|
|
50
50
|
`${l[0].toUpperCase()}${l.slice(1)}`
|
|
@@ -57,30 +57,30 @@ function L(t, { delay: e = 0, duration: a = 400, easing: s = m, axis: p = "y" }
|
|
|
57
57
|
return {
|
|
58
58
|
delay: e,
|
|
59
59
|
duration: a,
|
|
60
|
-
easing:
|
|
61
|
-
css: (l) => `overflow: hidden;opacity: ${Math.min(l * 20, 1) * c};${
|
|
60
|
+
easing: r,
|
|
61
|
+
css: (l) => `overflow: hidden;opacity: ${Math.min(l * 20, 1) * c};${s}: ${l * d}px;padding-${i[0]}: ${l * y}px;padding-${i[1]}: ${l * f}px;margin-${i[0]}: ${l * u}px;margin-${i[1]}: ${l * _}px;border-${i[0]}-width: ${l * $}px;border-${i[1]}-width: ${l * h}px;min-${s}: 0`
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
function R(t, { delay: e = 0, duration: a = 400, easing:
|
|
65
|
-
const c = getComputedStyle(t),
|
|
64
|
+
function R(t, { delay: e = 0, duration: a = 400, easing: r = m, start: p = 0, opacity: n = 0 } = {}) {
|
|
65
|
+
const c = getComputedStyle(t), s = +c.opacity, d = c.transform === "none" ? "" : c.transform, i = 1 - p, o = s * (1 - n);
|
|
66
66
|
return {
|
|
67
67
|
delay: e,
|
|
68
68
|
duration: a,
|
|
69
|
-
easing:
|
|
69
|
+
easing: r,
|
|
70
70
|
css: (y, f) => `
|
|
71
71
|
transform: ${d} scale(${1 - i * f});
|
|
72
|
-
opacity: ${
|
|
72
|
+
opacity: ${s - o * f}
|
|
73
73
|
`
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function z(t, { delay: e = 0, speed: a, duration:
|
|
76
|
+
function z(t, { delay: e = 0, speed: a, duration: r, easing: p = C } = {}) {
|
|
77
77
|
let n = t.getTotalLength();
|
|
78
78
|
const c = getComputedStyle(t);
|
|
79
|
-
return c.strokeLinecap !== "butt" && (n += parseInt(c.strokeWidth)),
|
|
79
|
+
return c.strokeLinecap !== "butt" && (n += parseInt(c.strokeWidth)), r === void 0 ? a === void 0 ? r = 800 : r = n / a : typeof r == "function" && (r = r(n)), {
|
|
80
80
|
delay: e,
|
|
81
|
-
duration:
|
|
81
|
+
duration: r,
|
|
82
82
|
easing: p,
|
|
83
|
-
css: (
|
|
83
|
+
css: (s, d) => `
|
|
84
84
|
stroke-dasharray: ${n};
|
|
85
85
|
stroke-dashoffset: ${d * n};
|
|
86
86
|
`
|
|
@@ -94,8 +94,8 @@ function v(t, e) {
|
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
function I({ fallback: t, ...e }) {
|
|
97
|
-
const a = /* @__PURE__ */ new Map(),
|
|
98
|
-
function p(c,
|
|
97
|
+
const a = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
98
|
+
function p(c, s, d) {
|
|
99
99
|
const {
|
|
100
100
|
delay: i = 0,
|
|
101
101
|
duration: o = (
|
|
@@ -103,7 +103,7 @@ function I({ fallback: t, ...e }) {
|
|
|
103
103
|
(g) => Math.sqrt(g) * 30
|
|
104
104
|
),
|
|
105
105
|
easing: y = m
|
|
106
|
-
} = v(v({}, e), d), f = c.getBoundingClientRect(), u =
|
|
106
|
+
} = v(v({}, e), d), f = c.getBoundingClientRect(), u = s.getBoundingClientRect(), _ = f.left - u.left, $ = f.top - u.top, h = f.width / u.width, l = f.height / u.height, k = Math.sqrt(_ * _ + $ * $), x = getComputedStyle(s), F = x.transform === "none" ? "" : x.transform, S = +x.opacity;
|
|
107
107
|
return {
|
|
108
108
|
delay: i,
|
|
109
109
|
duration: typeof o == "function" ? o(k) : o,
|
|
@@ -115,11 +115,11 @@ function I({ fallback: t, ...e }) {
|
|
|
115
115
|
`
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
function n(c,
|
|
118
|
+
function n(c, s, d) {
|
|
119
119
|
return (i, o) => (c.set(o.key, i), () => {
|
|
120
|
-
if (
|
|
121
|
-
const y =
|
|
122
|
-
return
|
|
120
|
+
if (s.has(o.key)) {
|
|
121
|
+
const y = s.get(o.key);
|
|
122
|
+
return s.delete(o.key), p(
|
|
123
123
|
/** @type {Element} */
|
|
124
124
|
y,
|
|
125
125
|
i,
|
|
@@ -129,7 +129,7 @@ function I({ fallback: t, ...e }) {
|
|
|
129
129
|
return c.delete(o.key), t && t(i, o, d);
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
return [n(
|
|
132
|
+
return [n(r, a, !1), n(a, r, !0)];
|
|
133
133
|
}
|
|
134
134
|
export {
|
|
135
135
|
W as blur,
|
|
@@ -56,12 +56,9 @@ const draggable = create({
|
|
|
56
56
|
bind:clientHeight={height}
|
|
57
57
|
>
|
|
58
58
|
<Container>{@render side_a()}</Container>
|
|
59
|
-
<div
|
|
60
|
-
class="splitter"
|
|
61
|
-
use:draggable={{ reversed: alt, vertical }}
|
|
62
|
-
>
|
|
59
|
+
<div class="splitter" use:draggable={{ reversed: alt, vertical }}>
|
|
63
60
|
{#if divider != null}
|
|
64
|
-
{@render divider({active, alt, vertical})}
|
|
61
|
+
{@render divider({ active, alt, vertical })}
|
|
65
62
|
{:else}
|
|
66
63
|
<DividerOverlay {alt} {vertical} {active}></DividerOverlay>
|
|
67
64
|
{/if}
|
|
@@ -89,17 +86,17 @@ const draggable = create({
|
|
|
89
86
|
|
|
90
87
|
.split.vertical {
|
|
91
88
|
grid-template-columns: auto 1px var(--nil-xit-split-value);
|
|
92
|
-
grid-template-rows: none
|
|
89
|
+
grid-template-rows: none;
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
.split.alt {
|
|
96
93
|
grid-template-columns: none;
|
|
97
94
|
grid-template-rows: var(--nil-xit-split-value) 1px auto;
|
|
98
95
|
}
|
|
99
|
-
|
|
96
|
+
|
|
100
97
|
.split.vertical.alt {
|
|
101
98
|
grid-template-columns: var(--nil-xit-split-value) 1px auto;
|
|
102
|
-
grid-template-rows: none
|
|
99
|
+
grid-template-rows: none;
|
|
103
100
|
}
|
|
104
101
|
|
|
105
102
|
.splitter {
|
|
@@ -111,4 +108,4 @@ const draggable = create({
|
|
|
111
108
|
.vertical > .splitter {
|
|
112
109
|
cursor: ew-resize;
|
|
113
110
|
}
|
|
114
|
-
</style>
|
|
111
|
+
</style>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">let { vertical, alt, active } = $props();
|
|
2
|
-
const title = $derived(
|
|
2
|
+
const title = $derived(
|
|
3
|
+
`Collapse ${vertical ? alt ? "left" : "right" : alt ? "top" : "bottom"}`
|
|
4
|
+
);
|
|
3
5
|
</script>
|
|
4
6
|
|
|
5
7
|
<div
|
|
@@ -8,7 +10,8 @@ const title = $derived(`Collapse ${vertical ? alt ? "left" : "right" : alt ? "to
|
|
|
8
10
|
class:secondary={alt}
|
|
9
11
|
class:active
|
|
10
12
|
class:vertical
|
|
11
|
-
class:horizontal={!vertical}
|
|
13
|
+
class:horizontal={!vertical}
|
|
14
|
+
>
|
|
12
15
|
<div {title}></div>
|
|
13
16
|
</div>
|
|
14
17
|
|
|
@@ -18,7 +21,7 @@ const title = $derived(`Collapse ${vertical ? alt ? "left" : "right" : alt ? "to
|
|
|
18
21
|
width: 100%;
|
|
19
22
|
height: 100%;
|
|
20
23
|
transform: translateY(-1px);
|
|
21
|
-
|
|
24
|
+
|
|
22
25
|
transition:
|
|
23
26
|
border-color 350ms,
|
|
24
27
|
background-color 350ms;
|
|
@@ -75,4 +78,4 @@ const title = $derived(`Collapse ${vertical ? alt ? "left" : "right" : alt ? "to
|
|
|
75
78
|
.parent.secondary.vertical.active {
|
|
76
79
|
border-left: hsl(0, 0%, 100%) solid 1px;
|
|
77
80
|
}
|
|
78
|
-
</style>
|
|
81
|
+
</style>
|
|
@@ -55,7 +55,7 @@ export const create = ({ move, move_start, move_end, reset, dbltap, tap }) => {
|
|
|
55
55
|
window.addEventListener("pointercancel", disengage);
|
|
56
56
|
window.addEventListener("pointermove", pointer_move);
|
|
57
57
|
return {
|
|
58
|
-
update: (new_params) => param = new_params,
|
|
58
|
+
update: (new_params) => (param = new_params),
|
|
59
59
|
destroy: () => {
|
|
60
60
|
div.removeEventListener("pointerdown", engage);
|
|
61
61
|
window.removeEventListener("pointerup", disengage);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nil-/xit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"svelte": "^5.7.1"
|
|
6
6
|
},
|
|
@@ -9,8 +9,30 @@
|
|
|
9
9
|
"./package.json": "./package.json",
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./index.d.ts",
|
|
12
|
-
"svelte": "./index.js",
|
|
13
12
|
"default": "./index.js"
|
|
13
|
+
},
|
|
14
|
+
"./components/layouts/Container.svelte": {
|
|
15
|
+
"types": "./components/layouts/Container.svelte.d.ts",
|
|
16
|
+
"svelte": "./components/layouts/Container.svelte"
|
|
17
|
+
},
|
|
18
|
+
"./components/layouts/Scrollable.svelte": {
|
|
19
|
+
"types": "./components/layouts/Scrollable.svelte.d.ts",
|
|
20
|
+
"svelte": "./components/layouts/Scrollable.svelte"
|
|
21
|
+
},
|
|
22
|
+
"./components/layouts/Split.svelte": {
|
|
23
|
+
"types": "./components/layouts/Split.svelte.d.ts",
|
|
24
|
+
"svelte": "./components/layouts/Split.svelte"
|
|
25
|
+
},
|
|
26
|
+
"./components/utilities/DividerOverlay.svelte": {
|
|
27
|
+
"types": "./components/utilities/DividerOverlay.svelte.d.ts",
|
|
28
|
+
"svelte": "./components/utilities/DividerOverlay.svelte"
|
|
29
|
+
},
|
|
30
|
+
"./components/utilities/draggable.js": {
|
|
31
|
+
"types": "./components/utilities/draggable.d.ts",
|
|
32
|
+
"default": "./components/utilities/draggable.js"
|
|
14
33
|
}
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"flatbuffers": "^25.1.24"
|
|
15
37
|
}
|
|
16
38
|
}
|