revojs 0.0.53 → 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/html/index.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface ComponentConstructor<TEvents extends Events, TAttributes extend
|
|
|
61
61
|
$events: TEvents;
|
|
62
62
|
$attributes: TAttributes;
|
|
63
63
|
$styles: Array<string>;
|
|
64
|
-
new (input?: Input<TEvents, TAttributes>,
|
|
64
|
+
new (input?: Input<TEvents, TAttributes>, parentScope?: Scope): Component<TEvents, TAttributes>;
|
|
65
65
|
}
|
|
66
66
|
export interface CustomElement<TEvents extends Events, TAttributes extends Attributes> extends HTMLElement {
|
|
67
67
|
readonly component: Component<TEvents, TAttributes>;
|
package/dist/index.js
CHANGED
|
@@ -110,9 +110,9 @@ var StopEvent = class extends Event {
|
|
|
110
110
|
var Scope = class extends EventTarget {
|
|
111
111
|
parentScope;
|
|
112
112
|
context;
|
|
113
|
-
constructor(
|
|
113
|
+
constructor(parentScope) {
|
|
114
114
|
super();
|
|
115
|
-
this.parentScope =
|
|
115
|
+
this.parentScope = parentScope;
|
|
116
116
|
this.context = new Map();
|
|
117
117
|
}
|
|
118
118
|
getContext(input) {
|
|
@@ -366,8 +366,8 @@ const defineComponent = (options) => {
|
|
|
366
366
|
events;
|
|
367
367
|
attributes;
|
|
368
368
|
shadowRoot;
|
|
369
|
-
constructor(input,
|
|
370
|
-
this.scope = new Scope(
|
|
369
|
+
constructor(input, parentScope) {
|
|
370
|
+
this.scope = new Scope(parentScope);
|
|
371
371
|
this.events = Object.keys(options.events ?? {}).reduce((output, name) => {
|
|
372
372
|
Reflect.set(output, name, input?.[name], output);
|
|
373
373
|
return output;
|
|
@@ -393,6 +393,7 @@ const toCustomElement = (Component) => {
|
|
|
393
393
|
const findParent = (node) => {
|
|
394
394
|
if (node) {
|
|
395
395
|
if ("component" in node) return node;
|
|
396
|
+
if (node instanceof ShadowRoot) return findParent(node.host);
|
|
396
397
|
return findParent(node.parentNode);
|
|
397
398
|
}
|
|
398
399
|
};
|
package/dist/presets/bun.js
CHANGED
|
@@ -7,9 +7,9 @@ var StopEvent = class extends Event {
|
|
|
7
7
|
var Scope = class extends EventTarget {
|
|
8
8
|
parentScope;
|
|
9
9
|
context;
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(parentScope) {
|
|
11
11
|
super();
|
|
12
|
-
this.parentScope =
|
|
12
|
+
this.parentScope = parentScope;
|
|
13
13
|
this.context = new Map();
|
|
14
14
|
}
|
|
15
15
|
getContext(input) {
|
package/dist/signals/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class StopEvent extends Event {
|
|
|
12
12
|
export declare class Scope extends EventTarget {
|
|
13
13
|
parentScope?: Scope;
|
|
14
14
|
readonly context: Map<string, unknown>;
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(parentScope?: Scope);
|
|
16
16
|
getContext<T>(input: Descriptor<T>): T;
|
|
17
17
|
setContext<T>(input: Descriptor<T>, value: T): void;
|
|
18
18
|
onStop(input: (event: StopEvent) => void): void;
|