@fluffjs/fluff 0.1.16 → 0.1.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluffjs/fluff",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
@@ -36,6 +36,7 @@ export class ForController extends MarkerController {
36
36
  };
37
37
  this.cloneAndInsertTemplate(this.itemTemplate, itemContext, renderContext, this.bindingsSubscriptions);
38
38
  }
39
+ this.refreshParentBindings();
39
40
  };
40
41
  this.subscribeTo(deps, update);
41
42
  update();
@@ -38,6 +38,7 @@ export class IfController extends MarkerController {
38
38
  if (matchedIndex >= 0 && matchedIndex < this.templates.length) {
39
39
  this.cloneAndInsertTemplate(this.templates[matchedIndex], this.loopContext, undefined, this.bindingsSubscriptions);
40
40
  }
41
+ this.refreshParentBindings();
41
42
  }
42
43
  };
43
44
  this.subscribeTo(allDeps, update);
@@ -37,6 +37,7 @@ export declare abstract class MarkerController {
37
37
  protected createChildScope(locals: Record<string, unknown>): Scope;
38
38
  protected clearContentBetweenMarkersWithCleanup(bindingsSubscriptions: Subscription[]): void;
39
39
  protected insertBeforeEndMarker(node: Node): void;
40
+ protected refreshParentBindings(): void;
40
41
  protected processBindingsOnElement(el: HTMLElement, scope: Scope): void;
41
42
  protected processBindingsOnElementWithSubscriptions(el: HTMLElement, scope: Scope, subscriptions: Subscription[]): void;
42
43
  private __getFluffElementHost;
@@ -227,6 +227,18 @@ export class MarkerController {
227
227
  return;
228
228
  parent.insertBefore(node, this.endMarker);
229
229
  }
230
+ refreshParentBindings() {
231
+ const parent = this.startMarker.parentNode;
232
+ if (!(parent instanceof HTMLElement))
233
+ return;
234
+ if (!parent.hasAttribute('data-lid'))
235
+ return;
236
+ const fluffHost = this.__getFluffElementHost();
237
+ if (!fluffHost)
238
+ return;
239
+ const scope = this.getScope();
240
+ fluffHost.__processBindingsOnElementPublic(parent, scope);
241
+ }
230
242
  processBindingsOnElement(el, scope) {
231
243
  const fluffHost = this.__getFluffElementHost();
232
244
  if (!fluffHost)
@@ -35,6 +35,7 @@ export class SwitchController extends MarkerController {
35
35
  shouldFallthrough = caseInfo.fallthrough;
36
36
  }
37
37
  }
38
+ this.refreshParentBindings();
38
39
  };
39
40
  this.subscribeTo(deps, update);
40
41
  update();