revojs 0.0.54 → 0.0.55
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/index.js +6 -9
- package/dist/signals/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -386,10 +386,10 @@ const defineComponent = (options) => {
|
|
|
386
386
|
const toCustomElement = (Component) => {
|
|
387
387
|
return class extends HTMLElement {
|
|
388
388
|
static formAssociated = true;
|
|
389
|
-
component;
|
|
390
|
-
internals;
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
component = new Component();
|
|
390
|
+
internals = this.attachInternals();
|
|
391
|
+
async connectedCallback() {
|
|
392
|
+
let rootNode = this;
|
|
393
393
|
const findParent = (node) => {
|
|
394
394
|
if (node) {
|
|
395
395
|
if ("component" in node) return node;
|
|
@@ -397,11 +397,8 @@ const toCustomElement = (Component) => {
|
|
|
397
397
|
return findParent(node.parentNode);
|
|
398
398
|
}
|
|
399
399
|
};
|
|
400
|
-
|
|
401
|
-
this.
|
|
402
|
-
}
|
|
403
|
-
async connectedCallback() {
|
|
404
|
-
let rootNode = this;
|
|
400
|
+
const parentNode = findParent(this.parentNode);
|
|
401
|
+
if (parentNode) this.component.scope.parentScope = parentNode.component.scope;
|
|
405
402
|
if (this.component.shadowRoot) rootNode = this.shadowRoot ?? this.attachShadow(this.component.shadowRoot);
|
|
406
403
|
for (const [name, event] of Object.entries(Component.$events)) Reflect.set(this.component.events, name, (value) => {
|
|
407
404
|
if (value instanceof Event) return;
|
package/dist/signals/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class StopEvent extends Event {
|
|
|
10
10
|
constructor();
|
|
11
11
|
}
|
|
12
12
|
export declare class Scope extends EventTarget {
|
|
13
|
-
|
|
13
|
+
parentScope?: Scope;
|
|
14
14
|
readonly context: Map<string, unknown>;
|
|
15
15
|
constructor(parentScope?: Scope);
|
|
16
16
|
getContext<T>(input: Descriptor<T>): T;
|