@lordfokas/yrframe 0.4.3 → 0.4.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/dist/Facade.d.ts +2 -8
- package/dist/Facade.js +9 -11
- package/package.json +1 -1
package/dist/Facade.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ComponentEvents } from "./ComponentEvents.js";
|
|
|
2
2
|
import { Attributes, Source } from "./utils.js";
|
|
3
3
|
declare const evt: unique symbol;
|
|
4
4
|
interface EventHost {
|
|
5
|
-
[evt]:
|
|
5
|
+
[evt]: ComponentEvents;
|
|
6
6
|
}
|
|
7
7
|
type FacadeElement = HTMLElement & EventHost & {
|
|
8
8
|
connectedCallback: Source<void>;
|
|
@@ -15,14 +15,8 @@ type FacadeElement = HTMLElement & EventHost & {
|
|
|
15
15
|
export declare class Facade<A extends Attributes> {
|
|
16
16
|
protected readonly node: FacadeElement;
|
|
17
17
|
protected readonly isCustom: boolean;
|
|
18
|
-
protected events():
|
|
18
|
+
protected events(): ComponentEvents;
|
|
19
19
|
constructor(tag: string, props: Partial<A>, defaults?: Partial<A>);
|
|
20
20
|
content(): FacadeElement;
|
|
21
21
|
}
|
|
22
|
-
declare class FacadeEvents extends ComponentEvents {
|
|
23
|
-
private connected;
|
|
24
|
-
constructor(component: HTMLElement);
|
|
25
|
-
connect(): void;
|
|
26
|
-
disconnect(): void;
|
|
27
|
-
}
|
|
28
22
|
export {};
|
package/dist/Facade.js
CHANGED
|
@@ -11,7 +11,7 @@ export class Facade {
|
|
|
11
11
|
isCustom;
|
|
12
12
|
events() {
|
|
13
13
|
if (!this.node[evt]) { // Lazily instantiate event manager
|
|
14
|
-
this.node[evt] = new
|
|
14
|
+
this.node[evt] = new ComponentEvents(this.node);
|
|
15
15
|
}
|
|
16
16
|
return this.node[evt];
|
|
17
17
|
}
|
|
@@ -59,18 +59,16 @@ class FacadeEvents extends ComponentEvents {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
(function FacadeMutationObserver() {
|
|
62
|
-
new MutationObserver((records
|
|
62
|
+
new MutationObserver((records) => {
|
|
63
63
|
for (const record of records) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
added[evt]?.connect();
|
|
68
|
-
}
|
|
64
|
+
for (const added of record.addedNodes) {
|
|
65
|
+
if (added instanceof HTMLElement) {
|
|
66
|
+
added[evt]?.connect();
|
|
69
67
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
}
|
|
69
|
+
for (const removed of record.removedNodes) {
|
|
70
|
+
if (removed instanceof HTMLElement) {
|
|
71
|
+
removed[evt]?.disconnect();
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
74
|
}
|