@manyducks.co/dolla 2.0.0-alpha.55 → 2.0.0-alpha.56
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 +38 -25
- package/dist/core/env.d.ts +2 -8
- package/dist/core/index.d.ts +3 -5
- package/dist/core/logger.d.ts +2 -2
- package/dist/core/markup.d.ts +43 -42
- package/dist/core/mount.d.ts +1 -1
- package/dist/core/nodes/dom.d.ts +6 -6
- package/dist/core/nodes/dynamic.d.ts +13 -15
- package/dist/core/nodes/html.d.ts +9 -21
- package/dist/core/nodes/portal.d.ts +8 -12
- package/dist/core/nodes/repeat.d.ts +13 -18
- package/dist/core/nodes/view.d.ts +10 -23
- package/dist/core/ref.d.ts +2 -6
- package/dist/core/symbols.d.ts +1 -1
- package/dist/core/views/default-crash-view.d.ts +1 -1
- package/dist/core/views/fragment.d.ts +1 -2
- package/dist/fragment-BahD_BJA.js +7 -0
- package/dist/fragment-BahD_BJA.js.map +1 -0
- package/dist/http.js +1 -1
- package/dist/i18n.js +2 -2
- package/dist/index.js +41 -41
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/{logger-CXdzxt1e.js → logger-sSxIw5od.js} +100 -100
- package/dist/logger-sSxIw5od.js.map +1 -0
- package/dist/markup-DS7yYBga.js +844 -0
- package/dist/markup-DS7yYBga.js.map +1 -0
- package/dist/router/index.d.ts +1 -1
- package/dist/router/router.d.ts +6 -6
- package/dist/{router-B-rtBG7i.js → router-D43DV_bv.js} +184 -183
- package/dist/router-D43DV_bv.js.map +1 -0
- package/dist/router.js +1 -1
- package/dist/router.js.map +1 -1
- package/dist/{typeChecking-lgllKIVq.js → typeChecking-BJ-ymQ2F.js} +5 -10
- package/dist/{typeChecking-lgllKIVq.js.map → typeChecking-BJ-ymQ2F.js.map} +1 -1
- package/dist/types.d.ts +12 -13
- package/package.json +1 -1
- package/dist/core/nodes/fragment.d.ts +0 -19
- package/dist/core/nodes/outlet.d.ts +0 -19
- package/dist/fragment-VXM-P2tT.js +0 -7
- package/dist/fragment-VXM-P2tT.js.map +0 -1
- package/dist/logger-CXdzxt1e.js.map +0 -1
- package/dist/markup-yTuFdC0t.js +0 -923
- package/dist/markup-yTuFdC0t.js.map +0 -1
- package/dist/router-B-rtBG7i.js.map +0 -1
package/dist/core/context.d.ts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Store } from "../types";
|
|
2
|
+
import { type Logger, type LoggerOptions } from "./logger";
|
|
2
3
|
import { type EffectFn, type MaybeSignal, type UnsubscribeFn } from "./signals";
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export type Store<Options, Value> = (this: Context, options: Options, context: Context) => Value;
|
|
7
4
|
type StoreMap = Map<Store<any, any>, any>;
|
|
8
|
-
export declare
|
|
5
|
+
export declare enum LifecycleEvent {
|
|
6
|
+
WILL_MOUNT = 0,
|
|
7
|
+
DID_MOUNT = 1,
|
|
8
|
+
WILL_UNMOUNT = 2,
|
|
9
|
+
DID_UNMOUNT = 3
|
|
10
|
+
}
|
|
9
11
|
type LifecycleListener = () => void;
|
|
10
|
-
type ContextLifecycleListeners = {
|
|
11
|
-
willMount?: LifecycleListener[];
|
|
12
|
-
didMount?: LifecycleListener[];
|
|
13
|
-
willUnmount?: LifecycleListener[];
|
|
14
|
-
didUnmount?: LifecycleListener[];
|
|
15
|
-
};
|
|
16
12
|
declare enum LifecycleState {
|
|
17
13
|
Unmounted = 0,
|
|
18
14
|
WillMount = 1,
|
|
@@ -30,18 +26,16 @@ declare class ContextLifecycle {
|
|
|
30
26
|
#private;
|
|
31
27
|
state: LifecycleState;
|
|
32
28
|
dependents: number;
|
|
33
|
-
on<E extends
|
|
34
|
-
off<E extends
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
willUnmount(dependent?: boolean): void;
|
|
38
|
-
didUnmount(dependent?: boolean): void;
|
|
29
|
+
on<E extends LifecycleEvent>(event: E, listener: LifecycleListener): void;
|
|
30
|
+
off<E extends LifecycleEvent>(event: E, listener: LifecycleListener): void;
|
|
31
|
+
notify<E extends LifecycleEvent>(event: E): void;
|
|
32
|
+
emit<E extends LifecycleEvent>(event: E, dependent?: boolean): void;
|
|
39
33
|
dispose(): void;
|
|
40
34
|
}
|
|
41
35
|
export interface ContextOptions {
|
|
42
36
|
logger?: LoggerOptions;
|
|
43
37
|
}
|
|
44
|
-
export interface
|
|
38
|
+
export interface LinkedContextOptions extends ContextOptions {
|
|
45
39
|
bindLifecycleToParent?: boolean;
|
|
46
40
|
}
|
|
47
41
|
export interface Context extends Logger {
|
|
@@ -49,15 +43,16 @@ export interface Context extends Logger {
|
|
|
49
43
|
export declare class Context implements Logger {
|
|
50
44
|
#private;
|
|
51
45
|
_name: string;
|
|
52
|
-
_parent?: Context;
|
|
53
46
|
_lifecycle: ContextLifecycle;
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
_parent?: Context;
|
|
48
|
+
_stores?: StoreMap;
|
|
49
|
+
_state?: Map<any, any>;
|
|
56
50
|
get isMounted(): boolean;
|
|
57
51
|
/**
|
|
58
52
|
* Returns a new Context with this one as its parent.
|
|
59
53
|
*/
|
|
60
|
-
static
|
|
54
|
+
static linked(parent: Context, name: MaybeSignal<string>, options?: LinkedContextOptions): Context;
|
|
55
|
+
static emit(event: LifecycleEvent, context: Context): void;
|
|
61
56
|
constructor(name: MaybeSignal<string>, options?: ContextOptions);
|
|
62
57
|
/**
|
|
63
58
|
* Returns the current name of this context.
|
|
@@ -69,9 +64,21 @@ export declare class Context implements Logger {
|
|
|
69
64
|
setName(name: MaybeSignal<string>): void;
|
|
70
65
|
addStore<T>(store: Store<any, T>, options?: any): this;
|
|
71
66
|
getStore<T>(store: Store<any, T>): T;
|
|
67
|
+
/**
|
|
68
|
+
* Schedule a callback function to run just before this context is mounted.
|
|
69
|
+
*/
|
|
72
70
|
beforeMount(listener: LifecycleListener): () => void;
|
|
71
|
+
/**
|
|
72
|
+
* Schedule a callback function to run after this context is mounted.
|
|
73
|
+
*/
|
|
73
74
|
onMount(listener: LifecycleListener): () => void;
|
|
75
|
+
/**
|
|
76
|
+
* Schedule a callback function to run just before this context is unmounted.
|
|
77
|
+
*/
|
|
74
78
|
beforeUnmount(listener: LifecycleListener): () => void;
|
|
79
|
+
/**
|
|
80
|
+
* Schedule a callback function to run after this context is unmounted.
|
|
81
|
+
*/
|
|
75
82
|
onUnmount(listener: LifecycleListener): () => void;
|
|
76
83
|
effect(callback: EffectFn): UnsubscribeFn;
|
|
77
84
|
/**
|
|
@@ -83,11 +90,17 @@ export declare class Context implements Logger {
|
|
|
83
90
|
*/
|
|
84
91
|
getState<T>(key: any): T;
|
|
85
92
|
/**
|
|
86
|
-
*
|
|
93
|
+
* Returns a Map containing all state values available to this context.
|
|
87
94
|
*/
|
|
88
95
|
getState(): Map<any, any>;
|
|
96
|
+
/**
|
|
97
|
+
* Stores `value` at `key` in this context's state.
|
|
98
|
+
*/
|
|
89
99
|
setState<T>(key: any, value: T): void;
|
|
90
|
-
|
|
100
|
+
/**
|
|
101
|
+
* For each tuple in `entries`, stores `value` at `key` in this context's state.
|
|
102
|
+
*/
|
|
103
|
+
setState(entries: [key: any, value: any][]): void;
|
|
91
104
|
}
|
|
92
105
|
export declare function createContext(name: MaybeSignal<string>, options?: ContextOptions): Context;
|
|
93
106
|
export declare class StoreError extends Error {
|
package/dist/core/env.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Gets the current environment value.
|
|
4
|
-
*/
|
|
5
|
-
export declare function getEnv(): Env;
|
|
6
|
-
/**
|
|
7
|
-
* Sets the environment value. Affects which log messages will print and how much debugging info is included in the DOM.
|
|
8
|
-
*/
|
|
1
|
+
import type { Env } from "../types";
|
|
2
|
+
export declare function getEnv(): string;
|
|
9
3
|
export declare function setEnv(value: Env): void;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
export { $, effect, get, peek } from "./signals.js";
|
|
2
2
|
export type { MaybeSignal, Signal, Source } from "./signals.js";
|
|
3
3
|
export { createContext } from "./context.js";
|
|
4
|
-
export type { Context
|
|
4
|
+
export type { Context } from "./context.js";
|
|
5
5
|
export { m, portal, render, repeat, unless, when } from "./markup.js";
|
|
6
|
-
export type {
|
|
6
|
+
export type { MarkupNode } from "./markup.js";
|
|
7
7
|
export { type Mixin } from "./nodes/html.js";
|
|
8
8
|
export { ref, type Ref } from "./ref.js";
|
|
9
9
|
export { mount, type UnmountFn } from "./mount.js";
|
|
10
10
|
export { deepEqual, shallowEqual, strictEqual } from "../utils.js";
|
|
11
11
|
export { getEnv, setEnv } from "./env.js";
|
|
12
|
-
export type { Env } from "./env.js";
|
|
13
12
|
export { createLogger, setLogFilter, setLogLevels } from "./logger.js";
|
|
14
13
|
export type { Logger, LoggerErrorContext, LoggerOptions, LogLevels } from "./logger.js";
|
|
15
|
-
export type { InputType, Renderable } from "../types.js";
|
|
16
|
-
export type { View } from "./nodes/view.js";
|
|
14
|
+
export type { View, Store, InputType, Renderable, Env } from "../types.js";
|
|
17
15
|
export type { CrashViewProps } from "./views/default-crash-view.js";
|
|
18
16
|
import type { IntrinsicElements as Elements } from "../types.js";
|
|
19
17
|
declare global {
|
package/dist/core/logger.d.ts
CHANGED
package/dist/core/markup.d.ts
CHANGED
|
@@ -1,63 +1,68 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Renderable, View } from "../types.js";
|
|
2
2
|
import { Context } from "./context.js";
|
|
3
|
-
import {
|
|
3
|
+
import { KeyFn, RenderFn } from "./nodes/repeat.js";
|
|
4
4
|
import { type MaybeSignal, type Signal } from "./signals.js";
|
|
5
5
|
/**
|
|
6
6
|
* Markup is a set of element metadata that hasn't been constructed into a MarkupElement yet.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare class Markup<P extends Record<any, any> = Record<any, any>> {
|
|
9
9
|
/**
|
|
10
10
|
* In the case of a view, type will be the View function itself. It can also hold an identifier for special nodes like "$cond", "$repeat", etc.
|
|
11
11
|
* DOM nodes can be created by name, such as HTML elements like "div", "ul" or "span", SVG elements like ""
|
|
12
12
|
*/
|
|
13
|
-
type: string | View<
|
|
13
|
+
type: string | View<P>;
|
|
14
14
|
/**
|
|
15
|
-
* Data that will be passed to a new
|
|
15
|
+
* Data that will be passed to a new MarkupNode instance when it is constructed.
|
|
16
16
|
*/
|
|
17
|
-
props
|
|
17
|
+
props: P | undefined;
|
|
18
18
|
/**
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
|
-
children
|
|
21
|
+
children: Renderable[];
|
|
22
|
+
constructor(type: string | View<P>, props?: P, ...children: Renderable[]);
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
|
-
* A
|
|
25
|
+
* A mountable node that has been constructed from Markup metadata.
|
|
25
26
|
*/
|
|
26
|
-
export interface
|
|
27
|
-
|
|
27
|
+
export interface MarkupNode {
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
readonly root?: Node;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
28
35
|
readonly isMounted: boolean;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
mount(parent: Node, after?: Node): void;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
unmount(parentIsUnmounting?: boolean): void;
|
|
29
44
|
}
|
|
30
|
-
export declare function
|
|
31
|
-
export declare function isMarkupElement(value: any): value is MarkupElement;
|
|
32
|
-
export declare function toMarkup(renderables: Renderable | Renderable[]): Markup[];
|
|
45
|
+
export declare function isMarkupNode(value: any): value is MarkupNode;
|
|
33
46
|
export declare enum MarkupType {
|
|
34
47
|
Text = "$text",
|
|
35
48
|
Repeat = "$repeat",
|
|
36
49
|
Dynamic = "$dynamic",
|
|
37
|
-
|
|
38
|
-
Fragment = "$fragment",
|
|
39
|
-
Node = "$node",
|
|
50
|
+
DOM = "$dom",
|
|
40
51
|
Portal = "$portal"
|
|
41
52
|
}
|
|
42
|
-
export interface
|
|
53
|
+
export interface MarkupProps {
|
|
43
54
|
[MarkupType.Text]: {
|
|
44
55
|
value: any;
|
|
45
56
|
};
|
|
46
57
|
[MarkupType.Repeat]: {
|
|
47
58
|
items: Signal<any[]>;
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
key: KeyFn<any>;
|
|
60
|
+
render: RenderFn<any>;
|
|
50
61
|
};
|
|
51
62
|
[MarkupType.Dynamic]: {
|
|
52
|
-
source: Signal<
|
|
63
|
+
source: Signal<any>;
|
|
53
64
|
};
|
|
54
|
-
[MarkupType.
|
|
55
|
-
view: Signal<ViewInstance<{}> | undefined>;
|
|
56
|
-
};
|
|
57
|
-
[MarkupType.Fragment]: {
|
|
58
|
-
children: MaybeSignal<MarkupElement[]>;
|
|
59
|
-
};
|
|
60
|
-
[MarkupType.Node]: {
|
|
65
|
+
[MarkupType.DOM]: {
|
|
61
66
|
value: Node;
|
|
62
67
|
};
|
|
63
68
|
[MarkupType.Portal]: {
|
|
@@ -66,32 +71,28 @@ export interface MarkupAttributes {
|
|
|
66
71
|
};
|
|
67
72
|
[tag: string]: Record<string, any>;
|
|
68
73
|
}
|
|
69
|
-
export declare function m<T extends keyof
|
|
70
|
-
export declare function m<
|
|
74
|
+
export declare function m<T extends keyof MarkupProps>(type: T, props: MarkupProps[T], ...children: Renderable[]): Markup;
|
|
75
|
+
export declare function m<P extends {}>(type: View<P>, props?: P, ...children: Renderable[]): Markup;
|
|
76
|
+
export declare function m<P>(type: View<P>, props: P, ...children: any[]): Markup;
|
|
71
77
|
/**
|
|
72
|
-
*
|
|
78
|
+
* If `condition` is truthy, displays `thenContent`, otherwise `elseContent`.
|
|
73
79
|
*/
|
|
74
80
|
export declare function when(condition: MaybeSignal<any>, thenContent?: Renderable, elseContent?: Renderable): Markup;
|
|
75
81
|
/**
|
|
76
|
-
* Inverted `when`.
|
|
82
|
+
* Inverted `when`. If `condition` is falsy, displays `thenContent`, otherwise `elseContent`.
|
|
77
83
|
*/
|
|
78
84
|
export declare function unless(condition: MaybeSignal<any>, thenContent?: Renderable, elseContent?: Renderable): Markup;
|
|
79
85
|
/**
|
|
80
|
-
* Calls `
|
|
81
|
-
* The result of `
|
|
86
|
+
* Calls `render` for each item in `items`. Dynamically adds and removes views as items change.
|
|
87
|
+
* The result of `key` is used to compare items and decide if item was added, removed or updated.
|
|
82
88
|
*/
|
|
83
|
-
export declare function repeat<T>(items: MaybeSignal<T[]>,
|
|
89
|
+
export declare function repeat<T>(items: MaybeSignal<T[]>, key: KeyFn<T>, render: RenderFn<T>): Markup;
|
|
84
90
|
/**
|
|
85
91
|
* Renders `content` into a `parent` node anywhere in the page, rather than its usual position in the view.
|
|
86
92
|
*/
|
|
87
93
|
export declare function portal(parent: Node, content: Renderable): Markup;
|
|
88
|
-
export declare function render(content: Renderable, context?: Context):
|
|
89
|
-
/**
|
|
90
|
-
* Construct Markup metadata into a set of MarkupElements.
|
|
91
|
-
*/
|
|
92
|
-
export declare function toMarkupElements(context: Context, markup: Markup | Markup[]): MarkupElement[];
|
|
94
|
+
export declare function render(content: Renderable, context?: Context): MarkupNode;
|
|
93
95
|
/**
|
|
94
|
-
*
|
|
96
|
+
* Convert basically anything into a set of MarkupElements.
|
|
95
97
|
*/
|
|
96
|
-
export declare function
|
|
97
|
-
export declare function isRenderable(value: unknown): value is Renderable;
|
|
98
|
+
export declare function toMarkupNodes(context: Context, ...content: any[]): MarkupNode[];
|
package/dist/core/mount.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Router } from "../router/router";
|
|
2
|
+
import type { View } from "../types";
|
|
2
3
|
import { Context } from "./context";
|
|
3
4
|
import { type LoggerErrorContext } from "./logger";
|
|
4
|
-
import { type View } from "./nodes/view";
|
|
5
5
|
export type UnmountFn = () => Promise<void>;
|
|
6
6
|
export interface MountOptions {
|
|
7
7
|
crashView?: View<LoggerErrorContext>;
|
package/dist/core/nodes/dom.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { MarkupNode } from "../markup";
|
|
2
|
+
import { IS_MARKUP_NODE } from "../symbols";
|
|
3
3
|
/**
|
|
4
|
-
* Wraps any plain DOM node in a
|
|
4
|
+
* Wraps any plain DOM node in a MarkupNode interface.
|
|
5
5
|
*/
|
|
6
|
-
export declare class DOMNode implements
|
|
7
|
-
[
|
|
8
|
-
|
|
6
|
+
export declare class DOMNode implements MarkupNode {
|
|
7
|
+
[IS_MARKUP_NODE]: boolean;
|
|
8
|
+
root: Node;
|
|
9
9
|
get isMounted(): boolean;
|
|
10
10
|
constructor(node: Node);
|
|
11
11
|
mount(parent: Node, after?: Node): void;
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import type { Renderable } from "../../types.js";
|
|
2
1
|
import type { Context } from "../context.js";
|
|
3
|
-
import { type
|
|
2
|
+
import { type MarkupNode } from "../markup.js";
|
|
4
3
|
import { Signal } from "../signals.js";
|
|
5
|
-
import {
|
|
6
|
-
interface DynamicOptions {
|
|
7
|
-
source: Signal<Renderable>;
|
|
8
|
-
context: Context;
|
|
9
|
-
}
|
|
4
|
+
import { IS_MARKUP_NODE } from "../symbols.js";
|
|
10
5
|
/**
|
|
11
6
|
* Displays dynamic children without a parent element.
|
|
12
7
|
* Renders a Reactive value via a render function.
|
|
13
8
|
*
|
|
14
9
|
* This is probably the most used element type aside from HTML.
|
|
15
10
|
*/
|
|
16
|
-
export declare class Dynamic implements
|
|
17
|
-
[
|
|
18
|
-
|
|
11
|
+
export declare class Dynamic implements MarkupNode {
|
|
12
|
+
[IS_MARKUP_NODE]: boolean;
|
|
13
|
+
root: Text;
|
|
19
14
|
private children;
|
|
20
15
|
private context;
|
|
21
|
-
private
|
|
16
|
+
private $slot;
|
|
22
17
|
private unsubscribe?;
|
|
23
18
|
get isMounted(): boolean;
|
|
24
|
-
constructor(
|
|
19
|
+
constructor(context: Context, $slot: Signal<any>);
|
|
25
20
|
mount(parent: Node, after?: Node): void;
|
|
26
21
|
unmount(parentIsUnmounting?: boolean): void;
|
|
27
|
-
cleanup
|
|
28
|
-
update
|
|
22
|
+
private cleanup;
|
|
23
|
+
private update;
|
|
24
|
+
/**
|
|
25
|
+
* Move marker node to end of children.
|
|
26
|
+
*/
|
|
27
|
+
private moveMarker;
|
|
29
28
|
}
|
|
30
|
-
export {};
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
import { Context } from "../context.js";
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
2
|
+
import { type MarkupNode } from "../markup.js";
|
|
3
|
+
import { IS_MARKUP_NODE } from "../symbols.js";
|
|
4
4
|
export type Mixin<E extends Element = Element> = (element: E, context: Context) => void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
children?: any[];
|
|
10
|
-
};
|
|
11
|
-
export declare class HTML implements MarkupElement {
|
|
12
|
-
[IS_MARKUP_ELEMENT]: boolean;
|
|
13
|
-
domNode: SVGElement | HTMLElement;
|
|
14
|
-
context: Context;
|
|
5
|
+
export declare class HTML implements MarkupNode {
|
|
6
|
+
[IS_MARKUP_NODE]: boolean;
|
|
7
|
+
root: HTMLElement | SVGElement;
|
|
8
|
+
private context;
|
|
15
9
|
private props;
|
|
16
|
-
private
|
|
17
|
-
private
|
|
10
|
+
private children?;
|
|
11
|
+
private childNodes;
|
|
18
12
|
private unsubscribers;
|
|
19
|
-
private logger;
|
|
20
13
|
private ref?;
|
|
21
14
|
private canClickAway;
|
|
22
15
|
get isMounted(): boolean;
|
|
23
|
-
constructor(
|
|
16
|
+
constructor(context: Context, tag: string, props: Record<string, any>, children?: any[]);
|
|
24
17
|
mount(parent: Node, after?: Node): void;
|
|
25
18
|
unmount(parentIsUnmounting?: boolean): void;
|
|
26
19
|
private attachProp;
|
|
@@ -28,8 +21,3 @@ export declare class HTML implements MarkupElement {
|
|
|
28
21
|
private applyStyles;
|
|
29
22
|
private applyClasses;
|
|
30
23
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Converts a camelCase string to kebab-case.
|
|
33
|
-
*/
|
|
34
|
-
export declare function camelToKebab(value: string): string;
|
|
35
|
-
export {};
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import type { Renderable } from "../../types.js";
|
|
2
2
|
import { Context } from "../context.js";
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
5
|
-
interface PortalConfig {
|
|
6
|
-
content: Renderable;
|
|
7
|
-
parent: Node;
|
|
8
|
-
context: Context;
|
|
9
|
-
}
|
|
3
|
+
import { type MarkupNode } from "../markup.js";
|
|
4
|
+
import { IS_MARKUP_NODE } from "../symbols.js";
|
|
10
5
|
/**
|
|
11
6
|
* Renders content into a specified parent node.
|
|
12
7
|
*/
|
|
13
|
-
export declare class Portal implements
|
|
14
|
-
[
|
|
15
|
-
private
|
|
8
|
+
export declare class Portal implements MarkupNode {
|
|
9
|
+
[IS_MARKUP_NODE]: boolean;
|
|
10
|
+
private context;
|
|
11
|
+
private content;
|
|
12
|
+
private parent;
|
|
16
13
|
private element?;
|
|
17
14
|
get isMounted(): boolean;
|
|
18
|
-
constructor(
|
|
15
|
+
constructor(context: Context, content: Renderable, parent: Node);
|
|
19
16
|
mount(_parent: Node, _after?: Node): void;
|
|
20
17
|
unmount(parentIsUnmounting?: boolean): void;
|
|
21
18
|
}
|
|
22
|
-
export {};
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Renderable } from "../../types.js";
|
|
2
|
+
import type { Context } from "../context.js";
|
|
3
|
+
import type { MarkupNode } from "../markup.js";
|
|
3
4
|
import { type Signal } from "../signals.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export declare class Repeat<T> implements MarkupElement {
|
|
13
|
-
[IS_MARKUP_ELEMENT]: boolean;
|
|
14
|
-
domNode: Text;
|
|
5
|
+
import { IS_MARKUP_NODE } from "../symbols.js";
|
|
6
|
+
export type KeyFn<T> = (item: T, index: number) => string | number | symbol;
|
|
7
|
+
export type RenderFn<T> = (item: Signal<T>, index: Signal<number>, ctx: Context) => Renderable;
|
|
8
|
+
export declare class Repeat<T> implements MarkupNode {
|
|
9
|
+
[IS_MARKUP_NODE]: boolean;
|
|
10
|
+
root: Text;
|
|
11
|
+
private context;
|
|
15
12
|
private items;
|
|
13
|
+
private key;
|
|
14
|
+
private render;
|
|
16
15
|
private unsubscribe;
|
|
17
16
|
private connectedItems;
|
|
18
|
-
private context;
|
|
19
|
-
private renderFn;
|
|
20
|
-
private keyFn;
|
|
21
17
|
get isMounted(): boolean;
|
|
22
|
-
constructor(
|
|
18
|
+
constructor(context: Context, items: Signal<T[]>, key: KeyFn<T>, render: RenderFn<T>);
|
|
23
19
|
mount(parent: Node, after?: Node): void;
|
|
24
20
|
unmount(parentIsUnmounting?: boolean): void;
|
|
25
21
|
private _cleanup;
|
|
26
22
|
private _update;
|
|
27
23
|
}
|
|
28
|
-
export {};
|
|
@@ -1,33 +1,20 @@
|
|
|
1
|
+
import type { View } from "../../types.js";
|
|
1
2
|
import { Context } from "../context.js";
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
4
|
-
import { IS_MARKUP_ELEMENT } from "../symbols.js";
|
|
5
|
-
export declare const ROUTE: unique symbol;
|
|
3
|
+
import { type MarkupNode } from "../markup.js";
|
|
4
|
+
import { IS_MARKUP_NODE } from "../symbols.js";
|
|
6
5
|
export declare const VIEW: unique symbol;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
export type ViewResult = Node | Signal<any> | Markup | Markup[] | null;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
export type View<P> = (this: Context, props: P, context: Context) => ViewResult;
|
|
15
|
-
/**
|
|
16
|
-
* A view that has been constructed into DOM nodes.
|
|
17
|
-
*/
|
|
18
|
-
export declare class ViewInstance<P> implements MarkupElement {
|
|
19
|
-
[IS_MARKUP_ELEMENT]: boolean;
|
|
6
|
+
export declare class ViewInstance<P> implements MarkupNode {
|
|
7
|
+
[IS_MARKUP_NODE]: boolean;
|
|
20
8
|
uniqueId: string;
|
|
21
9
|
context: Context;
|
|
22
10
|
props: P & {
|
|
23
|
-
children:
|
|
11
|
+
children: any[] | undefined;
|
|
24
12
|
};
|
|
25
13
|
fn: View<P>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
get
|
|
30
|
-
isMounted: boolean;
|
|
14
|
+
node?: MarkupNode;
|
|
15
|
+
constructor(context: Context, fn: View<P>, props: P, children?: any[]);
|
|
16
|
+
get root(): Node;
|
|
17
|
+
get isMounted(): boolean;
|
|
31
18
|
mount(parent: Node, after?: Node): void;
|
|
32
19
|
unmount(parentIsUnmounting?: boolean): void;
|
|
33
20
|
private _initialize;
|
package/dist/core/ref.d.ts
CHANGED
|
@@ -13,10 +13,6 @@ export interface Ref<T> {
|
|
|
13
13
|
(value: T): T;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Creates a
|
|
16
|
+
* Creates a Ref.
|
|
17
17
|
*/
|
|
18
|
-
export declare function ref<T>(): Ref<T>;
|
|
19
|
-
/**
|
|
20
|
-
* Creates a ref with an initial value.
|
|
21
|
-
*/
|
|
22
|
-
export declare function ref<T>(value: T): Ref<T>;
|
|
18
|
+
export declare function ref<T>(value?: T): Ref<T>;
|
package/dist/core/symbols.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const IS_MARKUP: unique symbol;
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const IS_MARKUP_NODE: unique symbol;
|
|
@@ -19,4 +19,4 @@ export type CrashViewProps = {
|
|
|
19
19
|
*/
|
|
20
20
|
tagName?: string;
|
|
21
21
|
};
|
|
22
|
-
export declare function DefaultCrashView(props: CrashViewProps): import("../markup.js").Markup
|
|
22
|
+
export declare function DefaultCrashView(props: CrashViewProps): import("../markup.js").Markup<Record<any, any>>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Renderable } from "../../types.js";
|
|
2
|
-
import { Context } from "../context.js";
|
|
3
2
|
/**
|
|
4
3
|
* A utility view that displays its children.
|
|
5
4
|
*/
|
|
6
5
|
export declare function Fragment(props: {
|
|
7
6
|
children?: Renderable;
|
|
8
|
-
}
|
|
7
|
+
}): Renderable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fragment-BahD_BJA.js","sources":["../src/core/views/fragment.ts"],"sourcesContent":["import type { Renderable } from \"../../types.js\";\n\n/**\n * A utility view that displays its children.\n */\nexport function Fragment(props: { children?: Renderable }) {\n return props.children;\n}\n"],"names":["Fragment","props"],"mappings":"AAKO,SAASA,EAASC,GAAkC;AACzD,SAAOA,EAAM;AACf;"}
|
package/dist/http.js
CHANGED
|
@@ -6,7 +6,7 @@ var g = (r, e, t) => e in r ? b(r, e, { enumerable: !0, configurable: !0, writab
|
|
|
6
6
|
var a = (r, e, t) => g(r, typeof e != "symbol" ? e + "" : e, t), m = (r, e, t) => e.has(r) || f("Cannot " + t);
|
|
7
7
|
var d = (r, e, t) => (m(r, e, "read from private field"), t ? t.call(r) : e.get(r)), c = (r, e, t) => e.has(r) ? f("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t);
|
|
8
8
|
var o = (r, e, t) => (m(r, e, "access private method"), t);
|
|
9
|
-
import { i as w } from "./typeChecking-
|
|
9
|
+
import { i as w } from "./typeChecking-BJ-ymQ2F.js";
|
|
10
10
|
var l, p, i, h;
|
|
11
11
|
class O {
|
|
12
12
|
constructor() {
|
package/dist/i18n.js
CHANGED
|
@@ -5,8 +5,8 @@ var D = (o) => {
|
|
|
5
5
|
var J = (o, t, e) => t in o ? B(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
6
6
|
var O = (o, t, e) => J(o, typeof t != "symbol" ? t + "" : t, e), _ = (o, t, e) => t.has(o) || D("Cannot " + e);
|
|
7
7
|
var i = (o, t, e) => (_(o, t, "read from private field"), e ? e.call(o) : t.get(o)), m = (o, t, e) => t.has(o) ? D("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(o) : t.set(o, e), N = (o, t, e, n) => (_(o, t, "write to private field"), n ? n.call(o, e) : t.set(o, e), e), g = (o, t, e) => (_(o, t, "access private method"), e);
|
|
8
|
-
import { $, f as K, d as Q, g as x } from "./logger-
|
|
9
|
-
import { b as C, i as j, c as U, t as P } from "./typeChecking-
|
|
8
|
+
import { $, f as K, d as Q, g as x } from "./logger-sSxIw5od.js";
|
|
9
|
+
import { b as C, i as j, c as U, t as P } from "./typeChecking-BJ-ymQ2F.js";
|
|
10
10
|
var I, F, p, S, G;
|
|
11
11
|
class W {
|
|
12
12
|
constructor(t) {
|