mol_jsx_lib 0.0.163 → 0.0.166
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/node.d.ts +0 -21
- package/node.deps.json +1 -1
- package/node.esm.js +0 -68
- package/node.esm.js.map +1 -1
- package/node.js +0 -68
- package/node.js.map +1 -1
- package/node.test.js +0 -87
- package/node.test.js.map +1 -1
- package/package.json +1 -5
- package/web.d.ts +10 -31
- package/web.deps.json +1 -1
- package/web.esm.js +21 -89
- package/web.esm.js.map +1 -1
- package/web.js +21 -89
- package/web.js.map +1 -1
- package/web.test.js +0 -19
- package/web.test.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -2164,74 +2164,6 @@ var $;
|
|
|
2164
2164
|
;
|
|
2165
2165
|
"use strict";
|
|
2166
2166
|
var $;
|
|
2167
|
-
(function ($_1) {
|
|
2168
|
-
let $$;
|
|
2169
|
-
(function ($$) {
|
|
2170
|
-
let $;
|
|
2171
|
-
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
2172
|
-
$_1.$mol_object_field = Symbol('$mol_object_field');
|
|
2173
|
-
class $mol_object extends $mol_object2 {
|
|
2174
|
-
static make(config) {
|
|
2175
|
-
return super.create(obj => {
|
|
2176
|
-
for (let key in config)
|
|
2177
|
-
obj[key] = config[key];
|
|
2178
|
-
});
|
|
2179
|
-
}
|
|
2180
|
-
}
|
|
2181
|
-
$_1.$mol_object = $mol_object;
|
|
2182
|
-
})($ || ($ = {}));
|
|
2183
|
-
//mol/object/object.ts
|
|
2184
|
-
;
|
|
2185
|
-
"use strict";
|
|
2186
|
-
var $;
|
|
2187
|
-
(function ($) {
|
|
2188
|
-
class $mol_state_time extends $mol_object {
|
|
2189
|
-
static task(precision, reset) {
|
|
2190
|
-
if (precision) {
|
|
2191
|
-
return new $mol_after_timeout(precision, () => this.task(precision, null));
|
|
2192
|
-
}
|
|
2193
|
-
else {
|
|
2194
|
-
return new $mol_after_frame(() => this.task(precision, null));
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
static now(precision) {
|
|
2198
|
-
this.task(precision);
|
|
2199
|
-
return Date.now();
|
|
2200
|
-
}
|
|
2201
|
-
}
|
|
2202
|
-
__decorate([
|
|
2203
|
-
$mol_mem_key
|
|
2204
|
-
], $mol_state_time, "task", null);
|
|
2205
|
-
__decorate([
|
|
2206
|
-
$mol_mem_key
|
|
2207
|
-
], $mol_state_time, "now", null);
|
|
2208
|
-
$.$mol_state_time = $mol_state_time;
|
|
2209
|
-
})($ || ($ = {}));
|
|
2210
|
-
//mol/state/time/time.ts
|
|
2211
|
-
;
|
|
2212
|
-
"use strict";
|
|
2213
|
-
var $;
|
|
2214
|
-
(function ($) {
|
|
2215
|
-
function $mol_wire_trans(next) {
|
|
2216
|
-
const atom = $mol_wire_auto();
|
|
2217
|
-
if (!(atom instanceof $mol_wire_atom))
|
|
2218
|
-
$mol_fail(new Error('Allowed only inside atom'));
|
|
2219
|
-
const prev = atom.result() ?? next;
|
|
2220
|
-
if (typeof prev !== 'number')
|
|
2221
|
-
return next;
|
|
2222
|
-
const current = (prev * 2 + next) / 3;
|
|
2223
|
-
const diff = Math.abs(current - next);
|
|
2224
|
-
if (diff < 1)
|
|
2225
|
-
return next;
|
|
2226
|
-
$mol_state_time.now(0);
|
|
2227
|
-
return current;
|
|
2228
|
-
}
|
|
2229
|
-
$.$mol_wire_trans = $mol_wire_trans;
|
|
2230
|
-
})($ || ($ = {}));
|
|
2231
|
-
//mol/wire/trans/trans.ts
|
|
2232
|
-
;
|
|
2233
|
-
"use strict";
|
|
2234
|
-
var $;
|
|
2235
2167
|
(function ($) {
|
|
2236
2168
|
function $mol_wire_patch(obj) {
|
|
2237
2169
|
for (const field of Reflect.ownKeys(obj)) {
|
|
@@ -4144,25 +4076,6 @@ var $;
|
|
|
4144
4076
|
;
|
|
4145
4077
|
"use strict";
|
|
4146
4078
|
var $;
|
|
4147
|
-
(function ($) {
|
|
4148
|
-
$mol_test({
|
|
4149
|
-
'init with overload'() {
|
|
4150
|
-
class X extends $mol_object {
|
|
4151
|
-
foo() {
|
|
4152
|
-
return 1;
|
|
4153
|
-
}
|
|
4154
|
-
}
|
|
4155
|
-
var x = X.make({
|
|
4156
|
-
foo: () => 2,
|
|
4157
|
-
});
|
|
4158
|
-
$mol_assert_equal(x.foo(), 2);
|
|
4159
|
-
},
|
|
4160
|
-
});
|
|
4161
|
-
})($ || ($ = {}));
|
|
4162
|
-
//mol/object/object.test.ts
|
|
4163
|
-
;
|
|
4164
|
-
"use strict";
|
|
4165
|
-
var $;
|
|
4166
4079
|
(function ($_1) {
|
|
4167
4080
|
$mol_test({
|
|
4168
4081
|
'Watch one value'($) {
|