@nil-/xit 0.2.2 → 0.2.4
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 +260 -258
- package/assets/index.js +17 -17
- package/assets/svelte/index.js +1552 -1653
- package/assets/svelte/internal/client.js +1384 -1271
- package/assets/svelte/internal/disclose-version.js +3 -2
- package/assets/svelte/motion.js +1 -1
- package/assets/svelte/store.js +98 -93
- package/package.json +5 -4
- package/test.d.ts +8 -0
- package/test.js +31 -0
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const d = "5";
|
|
2
|
+
var e;
|
|
3
|
+
typeof window < "u" && ((e = window.__svelte ?? (window.__svelte = {})).v ?? (e.v = /* @__PURE__ */ new Set())).add(d);
|
package/assets/svelte/motion.js
CHANGED
|
@@ -4,7 +4,7 @@ var et = (e) => {
|
|
|
4
4
|
var X = (e, t, s) => t.has(e) || et("Cannot " + s);
|
|
5
5
|
var r = (e, t, s) => (X(e, t, "read from private field"), s ? s.call(e) : t.get(e)), a = (e, t, s) => t.has(e) ? et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), h = (e, t, s, n) => (X(e, t, "write to private field"), n ? n.call(e, s) : t.set(e, s), s), st = (e, t, s) => (X(e, t, "access private method"), s);
|
|
6
6
|
import "./internal/client.js";
|
|
7
|
-
import { o as dt,
|
|
7
|
+
import { o as dt, b as S, c as rt, a as g, k as ut, n as lt, g as _ } from "./index.js";
|
|
8
8
|
import { c as mt, w as nt } from "./store.js";
|
|
9
9
|
import { linear as it } from "./easing.js";
|
|
10
10
|
const pt = () => performance.now(), l = {
|
package/assets/svelte/store.js
CHANGED
|
@@ -1,168 +1,173 @@
|
|
|
1
|
-
import { n as l, u as
|
|
1
|
+
import { n as l, u as w, s as B, r as C, a as E, e as j, g as M, b as P, c as k, t as T, d as y, f as h, h as m, i as S, j as $ } from "./index.js";
|
|
2
2
|
import "./internal/client.js";
|
|
3
|
-
function
|
|
3
|
+
function q(e, r, n) {
|
|
4
4
|
if (e == null)
|
|
5
|
-
return r(void 0),
|
|
6
|
-
const
|
|
5
|
+
return r(void 0), n && n(void 0), l;
|
|
6
|
+
const t = w(
|
|
7
7
|
() => e.subscribe(
|
|
8
8
|
r,
|
|
9
9
|
// @ts-expect-error
|
|
10
|
-
|
|
10
|
+
n
|
|
11
11
|
)
|
|
12
12
|
);
|
|
13
|
-
return
|
|
13
|
+
return t.unsubscribe ? () => t.unsubscribe() : t;
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
function
|
|
15
|
+
const b = [];
|
|
16
|
+
function x(e, r) {
|
|
17
17
|
return {
|
|
18
|
-
subscribe:
|
|
18
|
+
subscribe: v(e, r).subscribe
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
let
|
|
23
|
-
const
|
|
24
|
-
function
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
for (const
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
for (let
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
function v(e, r = l) {
|
|
22
|
+
let n = null;
|
|
23
|
+
const t = /* @__PURE__ */ new Set();
|
|
24
|
+
function i(u) {
|
|
25
|
+
if (B(e, u) && (e = u, n)) {
|
|
26
|
+
const a = !b.length;
|
|
27
|
+
for (const s of t)
|
|
28
|
+
s[1](), b.push(s, e);
|
|
29
|
+
if (a) {
|
|
30
|
+
for (let s = 0; s < b.length; s += 2)
|
|
31
|
+
b[s][0](b[s + 1]);
|
|
32
|
+
b.length = 0;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
function c(
|
|
37
|
-
|
|
36
|
+
function c(u) {
|
|
37
|
+
i(u(
|
|
38
38
|
/** @type {T} */
|
|
39
39
|
e
|
|
40
40
|
));
|
|
41
41
|
}
|
|
42
|
-
function o(
|
|
43
|
-
const
|
|
44
|
-
return
|
|
42
|
+
function o(u, a = l) {
|
|
43
|
+
const s = [u, a];
|
|
44
|
+
return t.add(s), t.size === 1 && (n = r(i, c) || l), u(
|
|
45
45
|
/** @type {T} */
|
|
46
46
|
e
|
|
47
47
|
), () => {
|
|
48
|
-
|
|
48
|
+
t.delete(s), t.size === 0 && n && (n(), n = null);
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
return { set:
|
|
51
|
+
return { set: i, update: c, subscribe: o };
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
53
|
+
function D(e, r, n) {
|
|
54
|
+
const t = !Array.isArray(e), i = t ? [e] : e;
|
|
55
|
+
if (!i.every(Boolean))
|
|
56
56
|
throw new Error("derived() expects stores as input, got a falsy value");
|
|
57
57
|
const c = r.length < 2;
|
|
58
|
-
return
|
|
59
|
-
let
|
|
60
|
-
const
|
|
61
|
-
let d = 0,
|
|
62
|
-
const
|
|
58
|
+
return x(n, (o, u) => {
|
|
59
|
+
let a = !1;
|
|
60
|
+
const s = [];
|
|
61
|
+
let d = 0, _ = l;
|
|
62
|
+
const g = () => {
|
|
63
63
|
if (d)
|
|
64
64
|
return;
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
c ? o(
|
|
68
|
-
},
|
|
69
|
-
(
|
|
70
|
-
|
|
71
|
-
(
|
|
72
|
-
|
|
65
|
+
_();
|
|
66
|
+
const f = r(t ? s[0] : s, o, u);
|
|
67
|
+
c ? o(f) : _ = typeof f == "function" ? f : l;
|
|
68
|
+
}, A = i.map(
|
|
69
|
+
(f, p) => q(
|
|
70
|
+
f,
|
|
71
|
+
(O) => {
|
|
72
|
+
s[p] = O, d &= ~(1 << p), a && g();
|
|
73
73
|
},
|
|
74
74
|
() => {
|
|
75
|
-
d |= 1 <<
|
|
75
|
+
d |= 1 << p;
|
|
76
76
|
}
|
|
77
77
|
)
|
|
78
78
|
);
|
|
79
|
-
return
|
|
80
|
-
|
|
79
|
+
return a = !0, g(), function() {
|
|
80
|
+
C(A), _(), a = !1;
|
|
81
81
|
};
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function F(e) {
|
|
85
85
|
return {
|
|
86
86
|
// @ts-expect-error TODO i suspect the bind is unnecessary
|
|
87
87
|
subscribe: e.subscribe.bind(e)
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function z(e) {
|
|
91
91
|
let r;
|
|
92
|
-
return
|
|
92
|
+
return q(e, (n) => r = n)(), r;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
94
|
+
function G(e) {
|
|
95
|
+
E(e, e.v + 1);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
let r = 0,
|
|
97
|
+
function H(e) {
|
|
98
|
+
let r = 0, n = P(0), t;
|
|
99
99
|
return () => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
r -= 1, r === 0 && (
|
|
100
|
+
j() && (M(n), k(() => (r === 0 && (t = w(() => e(() => G(n)))), r += 1, () => {
|
|
101
|
+
T().then(() => {
|
|
102
|
+
r -= 1, r === 0 && (t == null || t(), t = void 0);
|
|
103
103
|
});
|
|
104
104
|
})));
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
function I(e, r) {
|
|
108
|
+
var n = S, t = h, i = e();
|
|
109
|
+
const c = v(i, (o) => {
|
|
110
|
+
var u = i !== e(), a, s = h, d = S;
|
|
111
|
+
y(t), m(n);
|
|
112
|
+
try {
|
|
113
|
+
a = $(() => {
|
|
114
|
+
k(() => {
|
|
115
|
+
const _ = e();
|
|
116
|
+
u && o(_);
|
|
117
|
+
});
|
|
115
118
|
});
|
|
116
|
-
}
|
|
117
|
-
|
|
119
|
+
} finally {
|
|
120
|
+
y(s), m(d);
|
|
121
|
+
}
|
|
122
|
+
return u = !0, a;
|
|
118
123
|
});
|
|
119
124
|
return r ? {
|
|
120
125
|
set: r,
|
|
121
|
-
update: (
|
|
122
|
-
subscribe:
|
|
126
|
+
update: (o) => r(o(e())),
|
|
127
|
+
subscribe: c.subscribe
|
|
123
128
|
} : {
|
|
124
|
-
subscribe:
|
|
129
|
+
subscribe: c.subscribe
|
|
125
130
|
};
|
|
126
131
|
}
|
|
127
|
-
function
|
|
132
|
+
function J(e) {
|
|
128
133
|
let r;
|
|
129
|
-
const
|
|
134
|
+
const n = H((i) => {
|
|
130
135
|
let c = !1;
|
|
131
|
-
const o = e.subscribe((
|
|
132
|
-
r =
|
|
136
|
+
const o = e.subscribe((u) => {
|
|
137
|
+
r = u, c && i();
|
|
133
138
|
});
|
|
134
139
|
return c = !0, o;
|
|
135
140
|
});
|
|
136
|
-
function
|
|
137
|
-
return
|
|
141
|
+
function t() {
|
|
142
|
+
return j() ? (n(), r) : z(e);
|
|
138
143
|
}
|
|
139
144
|
return "set" in e ? {
|
|
140
145
|
get current() {
|
|
141
|
-
return
|
|
146
|
+
return t();
|
|
142
147
|
},
|
|
143
|
-
set current(
|
|
144
|
-
e.set(
|
|
148
|
+
set current(i) {
|
|
149
|
+
e.set(i);
|
|
145
150
|
}
|
|
146
151
|
} : {
|
|
147
152
|
get current() {
|
|
148
|
-
return
|
|
153
|
+
return t();
|
|
149
154
|
}
|
|
150
155
|
};
|
|
151
156
|
}
|
|
152
|
-
const
|
|
157
|
+
const N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
153
158
|
__proto__: null,
|
|
154
|
-
derived:
|
|
155
|
-
fromStore:
|
|
156
|
-
get:
|
|
157
|
-
readable:
|
|
158
|
-
readonly:
|
|
159
|
-
toStore:
|
|
160
|
-
writable:
|
|
159
|
+
derived: D,
|
|
160
|
+
fromStore: J,
|
|
161
|
+
get: z,
|
|
162
|
+
readable: x,
|
|
163
|
+
readonly: F,
|
|
164
|
+
toStore: I,
|
|
165
|
+
writable: v
|
|
161
166
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
162
167
|
export {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
+
H as c,
|
|
169
|
+
z as g,
|
|
170
|
+
N as i,
|
|
171
|
+
q as s,
|
|
172
|
+
v as w
|
|
168
173
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nil-/xit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"svelte": "^5.7.1"
|
|
6
6
|
},
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"types": "./index.d.ts",
|
|
12
12
|
"default": "./index.js"
|
|
13
13
|
},
|
|
14
|
+
"./test": {
|
|
15
|
+
"types": "./test.d.ts",
|
|
16
|
+
"default": "./test.js"
|
|
17
|
+
},
|
|
14
18
|
"./components/layouts/Container.svelte": {
|
|
15
19
|
"types": "./components/layouts/Container.svelte.d.ts",
|
|
16
20
|
"svelte": "./components/layouts/Container.svelte"
|
|
@@ -31,8 +35,5 @@
|
|
|
31
35
|
"types": "./components/utilities/draggable.d.ts",
|
|
32
36
|
"default": "./components/utilities/draggable.js"
|
|
33
37
|
}
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"flatbuffers": "^25.1.24"
|
|
37
38
|
}
|
|
38
39
|
}
|
package/test.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CoDec } from "./index";
|
|
2
|
+
export declare const xit_test: () => {
|
|
3
|
+
xit: import("./index").Context;
|
|
4
|
+
frame_info: (tag: string, decoder: CoDec<any>["decode"]) => Promise<{
|
|
5
|
+
inputs: import("./index").Action<HTMLElement>[];
|
|
6
|
+
outputs: import("./index").Action<HTMLElement>[];
|
|
7
|
+
}>;
|
|
8
|
+
};
|
package/test.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { xit } from "./index";
|
|
2
|
+
import { get } from "svelte/store";
|
|
3
|
+
export const xit_test = () => {
|
|
4
|
+
const x = xit();
|
|
5
|
+
return {
|
|
6
|
+
xit: x,
|
|
7
|
+
frame_info: async (tag, decoder) => {
|
|
8
|
+
const { values, unsub } = await x.frame("frame_info", tag);
|
|
9
|
+
const load = async (key) => {
|
|
10
|
+
const v = values.json(key, [], { decode: decoder, encode: () => { return new Uint8Array(); } });
|
|
11
|
+
return Promise.all(get(v)
|
|
12
|
+
.map(v => {
|
|
13
|
+
const [frame_id, mark, g] = v.split(":");
|
|
14
|
+
if (g !== "V") {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (mark === "T") {
|
|
18
|
+
return x.frame_ui(frame_id, tag);
|
|
19
|
+
}
|
|
20
|
+
else if (mark === "U") {
|
|
21
|
+
return x.frame_ui(frame_id);
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
.filter(v => v != null));
|
|
25
|
+
};
|
|
26
|
+
const [inputs, outputs] = await Promise.all([load("inputs"), load("outputs")]);
|
|
27
|
+
unsub();
|
|
28
|
+
return { inputs, outputs };
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|