mol_jsx_lib 0.0.166 → 0.0.167

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.test.js CHANGED
@@ -2164,6 +2164,74 @@ 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_easing(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_easing = $mol_wire_easing;
2230
+ })($ || ($ = {}));
2231
+ //mol/wire/easing/easing.ts
2232
+ ;
2233
+ "use strict";
2234
+ var $;
2167
2235
  (function ($) {
2168
2236
  function $mol_wire_patch(obj) {
2169
2237
  for (const field of Reflect.ownKeys(obj)) {
@@ -4076,6 +4144,25 @@ var $;
4076
4144
  ;
4077
4145
  "use strict";
4078
4146
  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 $;
4079
4166
  (function ($_1) {
4080
4167
  $mol_test({
4081
4168
  'Watch one value'($) {