bobe 0.0.57 → 0.0.58
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/dist/bobe.cjs.js +45 -1
- package/dist/bobe.cjs.js.map +1 -1
- package/dist/bobe.compiler.cjs.js +45 -1
- package/dist/bobe.compiler.cjs.js.map +1 -1
- package/dist/bobe.compiler.esm.js +45 -1
- package/dist/bobe.compiler.esm.js.map +1 -1
- package/dist/bobe.esm.js +45 -1
- package/dist/bobe.esm.js.map +1 -1
- package/dist/index.umd.js +45 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/bobe.esm.js
CHANGED
|
@@ -2385,7 +2385,51 @@ class Interpreter {
|
|
|
2385
2385
|
hookI = _this$tokenizer$_hook4[2];
|
|
2386
2386
|
const rawVal = data[Keys.Raw][value];
|
|
2387
2387
|
const isFn = typeof rawVal === 'function';
|
|
2388
|
-
if (key === '
|
|
2388
|
+
if (key === 'props') {
|
|
2389
|
+
let prevKeys = new Set();
|
|
2390
|
+
const savedDefaults = new Map();
|
|
2391
|
+
new this.Effect(() => {
|
|
2392
|
+
const props = isFn ? rawVal : Reflect.has(data[Keys.Raw], value) ? data[value] : this.getFn(data, value)();
|
|
2393
|
+
const isComponent = _node.__logicType & TokenizerSwitcherBit;
|
|
2394
|
+
const rawTarget = isComponent ? _node.data[Keys.Raw] : null;
|
|
2395
|
+
const cleanupKeys = keysToClean => {
|
|
2396
|
+
for (const k of keysToClean) {
|
|
2397
|
+
if (k.startsWith('on')) continue;
|
|
2398
|
+
if (isComponent) {
|
|
2399
|
+
_node.data[k] = savedDefaults.has(k) ? savedDefaults.get(k) : undefined;
|
|
2400
|
+
} else {
|
|
2401
|
+
this.setProp(_node, k, undefined, hookI);
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
};
|
|
2405
|
+
if (!props || typeof props !== 'object') {
|
|
2406
|
+
cleanupKeys(prevKeys);
|
|
2407
|
+
prevKeys.clear();
|
|
2408
|
+
return;
|
|
2409
|
+
}
|
|
2410
|
+
props[Keys.Iterator];
|
|
2411
|
+
const raw = props[Keys.Raw] || props;
|
|
2412
|
+
const keys = Object.keys(raw);
|
|
2413
|
+
const newKeys = new Set();
|
|
2414
|
+
for (let i = 0; i < keys.length; i++) {
|
|
2415
|
+
const k = keys[i];
|
|
2416
|
+
newKeys.add(k);
|
|
2417
|
+
prevKeys.delete(k);
|
|
2418
|
+
if (isComponent) {
|
|
2419
|
+
const savedK = savedDefaults.has(k);
|
|
2420
|
+
if (!savedK && Object.prototype.hasOwnProperty.call(rawTarget, k)) {
|
|
2421
|
+
savedDefaults.set(k, rawTarget[k]);
|
|
2422
|
+
}
|
|
2423
|
+
const val = props[k];
|
|
2424
|
+
_node.data[k] = val === undefined && savedK ? savedDefaults.get(k) : val;
|
|
2425
|
+
} else {
|
|
2426
|
+
this.onePropParsed(props, _node, k, k, true, false, hookI);
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
cleanupKeys(prevKeys);
|
|
2430
|
+
prevKeys = newKeys;
|
|
2431
|
+
}, ScheduleType.Render);
|
|
2432
|
+
} else if (key === 'ref') {
|
|
2389
2433
|
const valueIsMapKey = Reflect.has(data[Keys.Raw], value);
|
|
2390
2434
|
let refValue = _node;
|
|
2391
2435
|
if (_node.__logicType & TokenizerSwitcherBit) {
|