@manyducks.co/dolla 2.0.0-alpha.29 → 2.0.0-alpha.30
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/core/context.d.ts +6 -0
- package/dist/core/nodes/view.d.ts +2 -1
- package/dist/core/store.d.ts +2 -1
- package/dist/index.js +415 -398
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/{passthrough-eH8w4zJi.js → passthrough-d2lcM0cd.js} +248 -196
- package/dist/passthrough-d2lcM0cd.js.map +1 -0
- package/package.json +1 -1
- package/dist/passthrough-eH8w4zJi.js.map +0 -1
package/dist/core/context.d.ts
CHANGED
|
@@ -34,6 +34,12 @@ export interface ElementContext {
|
|
|
34
34
|
*/
|
|
35
35
|
viewName?: string;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Mapping of listener function passed to `.on` -> wrapped versions that discard eventName.
|
|
39
|
+
* Wrapping listeners is necessary because the context API's `.on` method does not pass the event name to "*" listeners while the emitter does.
|
|
40
|
+
* ContextEvent objects already have the event name stored as `event.type`.
|
|
41
|
+
*/
|
|
42
|
+
export type WildcardListenerMap = Map<(event: ContextEvent<any>) => void, (eventName: string | symbol, event: ContextEvent<any>) => void>;
|
|
37
43
|
export interface ComponentContext {
|
|
38
44
|
/**
|
|
39
45
|
* Sets a context variable and returns its value.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Emitter } from "@manyducks.co/emitter";
|
|
2
|
-
import { type ElementContext, type StorableContext } from "../context.js";
|
|
2
|
+
import { type WildcardListenerMap, type ElementContext, type StorableContext } from "../context.js";
|
|
3
3
|
import type { Logger } from "../dolla.js";
|
|
4
4
|
import { type Markup, type MarkupElement } from "../markup.js";
|
|
5
5
|
import { type MaybeState, type State, type StateValues, type StopFunction } from "../state.js";
|
|
@@ -80,6 +80,7 @@ export declare class View<P> implements ViewElement {
|
|
|
80
80
|
_setChildren: import("../state.js").Setter<MarkupElement[], MarkupElement[]>;
|
|
81
81
|
_watcher: import("../state.js").StateWatcher;
|
|
82
82
|
_emitter: Emitter<ViewEvents>;
|
|
83
|
+
_wildcardListeners: WildcardListenerMap;
|
|
83
84
|
constructor(elementContext: ElementContext, view: ViewFunction<P>, props: P, children?: Markup[]);
|
|
84
85
|
get node(): Node;
|
|
85
86
|
isMounted: boolean;
|
package/dist/core/store.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Emitter } from "@manyducks.co/emitter";
|
|
2
|
-
import { type ComponentContext, type ElementContext } from "./context.js";
|
|
2
|
+
import { type WildcardListenerMap, type ComponentContext, type ElementContext } from "./context.js";
|
|
3
3
|
import type { Logger } from "./dolla.js";
|
|
4
4
|
import { type MaybeState, type StateValues, type StopFunction } from "./state.js";
|
|
5
5
|
export type StoreFunction<Options, Value> = (this: StoreContext, options: Options, context: StoreContext) => Value;
|
|
@@ -38,6 +38,7 @@ export declare class Store<Options, Value> {
|
|
|
38
38
|
isMounted: boolean;
|
|
39
39
|
_elementContext: ElementContext;
|
|
40
40
|
_emitter: Emitter<StoreEvents>;
|
|
41
|
+
_wildcardListeners: WildcardListenerMap;
|
|
41
42
|
_logger: Logger;
|
|
42
43
|
_watcher: import("./state.js").StateWatcher;
|
|
43
44
|
get name(): string;
|