@manyducks.co/dolla 2.0.0-alpha.20 → 2.0.0-alpha.22
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/{modules/render.d.ts → core/batch.d.ts} +4 -1
- package/dist/{modules → core}/dolla.d.ts +9 -9
- package/dist/{markup.d.ts → core/markup.d.ts} +4 -4
- package/dist/{nodes → core/nodes}/cond.d.ts +2 -2
- package/dist/{nodes → core/nodes}/html.d.ts +1 -1
- package/dist/{nodes → core/nodes}/observer.d.ts +2 -2
- package/dist/{nodes → core/nodes}/outlet.d.ts +1 -1
- package/dist/{nodes → core/nodes}/portal.d.ts +2 -2
- package/dist/{nodes → core/nodes}/repeat.d.ts +1 -1
- package/dist/{nodes → core/nodes}/text.d.ts +1 -1
- package/dist/{view.d.ts → core/view.d.ts} +5 -5
- package/dist/index.d.ts +9 -8
- package/dist/index.js +604 -1013
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +2 -2
- package/dist/jsx-dev-runtime.js +3 -3
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.d.ts +3 -3
- package/dist/jsx-runtime.js +2 -2
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/modules/i18n.d.ts +2 -2
- package/dist/modules/router.d.ts +16 -28
- package/dist/passthrough-CrReqVVB.js +1442 -0
- package/dist/passthrough-CrReqVVB.js.map +1 -0
- package/dist/typeChecking.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils.d.ts +13 -0
- package/dist/views/default-crash-view.d.ts +1 -1
- package/dist/views/passthrough.d.ts +2 -2
- package/package.json +3 -5
- package/dist/passthrough-DrILnMr2.js +0 -1393
- package/dist/passthrough-DrILnMr2.js.map +0 -1
- /package/dist/{state.d.ts → core/state.d.ts} +0 -0
- /package/dist/{routing.d.ts → modules/router.utils.d.ts} +0 -0
- /package/dist/{routing.test.d.ts → modules/router.utils.test.d.ts} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type Markup, type MarkupElement } from "
|
|
2
|
-
import { createRef, createSettableState, createState, createWatcher, derive, isRef, toSettableState, toState, valueOf } from "
|
|
3
|
-
import { type ViewElement, type ViewFunction } from "
|
|
1
|
+
import { type Markup, type MarkupElement } from "./markup.js";
|
|
2
|
+
import { createRef, createSettableState, createState, createWatcher, derive, isRef, toSettableState, toState, valueOf } from "./state.js";
|
|
3
|
+
import { type ViewElement, type ViewFunction } from "./view.js";
|
|
4
4
|
import { type CrashViewProps } from "../views/default-crash-view.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Router } from "
|
|
5
|
+
import { Batch } from "./batch.js";
|
|
6
|
+
import { HTTP } from "../modules/http.js";
|
|
7
|
+
import { I18n } from "../modules/i18n.js";
|
|
8
|
+
import { Router } from "../modules/router.js";
|
|
9
9
|
export type Environment = "development" | "production";
|
|
10
10
|
/**
|
|
11
11
|
* Log type toggles. Each message category can be turned on or off or enabled only in a specific environment.
|
|
@@ -41,12 +41,12 @@ export type LoggerOptions = {
|
|
|
41
41
|
};
|
|
42
42
|
export declare class Dolla {
|
|
43
43
|
#private;
|
|
44
|
+
readonly batch: Batch;
|
|
44
45
|
readonly http: HTTP;
|
|
45
46
|
readonly i18n: I18n;
|
|
46
|
-
readonly render: Render;
|
|
47
47
|
readonly router: Router;
|
|
48
48
|
constructor();
|
|
49
|
-
watch: <I extends import("
|
|
49
|
+
watch: <I extends import("./state.js").MaybeState<any>[]>(states: [...I], fn: (...currentValues: import("./state.js").StateValues<I>) => void) => import("./state.js").StopFunction;
|
|
50
50
|
createState: typeof createState;
|
|
51
51
|
createSettableState: typeof createSettableState;
|
|
52
52
|
toSettableState: typeof toSettableState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Dolla } from "./
|
|
1
|
+
import type { Dolla } from "./dolla.js";
|
|
2
2
|
import { MaybeState, type State } from "./state.js";
|
|
3
|
-
import type { Renderable, Stringable } from "
|
|
3
|
+
import type { Renderable, Stringable } from "../types.js";
|
|
4
4
|
import { type ViewContext, type ViewFunction, type ViewResult } from "./view.js";
|
|
5
5
|
export interface ElementContext {
|
|
6
6
|
/**
|
|
@@ -48,7 +48,7 @@ export interface MarkupElement {
|
|
|
48
48
|
/**
|
|
49
49
|
* Disconnect from the DOM and clean up. If parentIsUnmounting, DOM operations are skipped.
|
|
50
50
|
*/
|
|
51
|
-
unmount(parentIsUnmounting
|
|
51
|
+
unmount(parentIsUnmounting?: boolean): void;
|
|
52
52
|
}
|
|
53
53
|
export declare function isMarkup(value: unknown): value is Markup;
|
|
54
54
|
export declare function isMarkupElement(value: unknown): value is MarkupElement;
|
|
@@ -109,5 +109,5 @@ export declare function constructMarkup(elementContext: ElementContext, markup:
|
|
|
109
109
|
/**
|
|
110
110
|
* Combines one or more MarkupElements into a single MarkupElement.
|
|
111
111
|
*/
|
|
112
|
-
export declare function
|
|
112
|
+
export declare function groupElements(nodes: MarkupElement[]): MarkupElement;
|
|
113
113
|
export declare function isRenderable(value: unknown): value is Renderable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MarkupElement, type ElementContext, type Markup } from "../markup.js";
|
|
2
2
|
import { type State, type StopFunction } from "../state.js";
|
|
3
|
-
import { type Renderable } from "
|
|
3
|
+
import { type Renderable } from "../../types.js";
|
|
4
4
|
export interface ConditionalConfig {
|
|
5
5
|
$predicate: State<any>;
|
|
6
6
|
thenContent?: Renderable;
|
|
@@ -21,6 +21,6 @@ export declare class Conditional implements MarkupElement {
|
|
|
21
21
|
constructor(config: ConditionalConfig);
|
|
22
22
|
get isMounted(): boolean;
|
|
23
23
|
mount(parent: Node, after?: Node | undefined): void;
|
|
24
|
-
unmount(parentIsUnmounting
|
|
24
|
+
unmount(parentIsUnmounting?: boolean): void;
|
|
25
25
|
update(value: any): void;
|
|
26
26
|
}
|
|
@@ -18,7 +18,7 @@ export declare class HTML implements MarkupElement {
|
|
|
18
18
|
get isMounted(): boolean;
|
|
19
19
|
constructor({ tag, props, children, elementContext }: HTMLOptions);
|
|
20
20
|
mount(parent: Node, after?: Node): void;
|
|
21
|
-
unmount(parentIsUnmounting
|
|
21
|
+
unmount(parentIsUnmounting?: boolean): void;
|
|
22
22
|
getUpdateKey(type: string, value: string | number): string;
|
|
23
23
|
attachProp<T>(value: State<T> | T, callback: (value: T) => void, updateKey: string): void;
|
|
24
24
|
applyProps(element: HTMLElement | SVGElement, props: Record<string, unknown>): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ElementContext, type MarkupElement } from "../markup.js";
|
|
2
2
|
import { type State } from "../state.js";
|
|
3
|
-
import type { Renderable } from "
|
|
3
|
+
import type { Renderable } from "../../types.js";
|
|
4
4
|
interface ObserverOptions {
|
|
5
5
|
elementContext: ElementContext;
|
|
6
6
|
states: State<any>[];
|
|
@@ -23,7 +23,7 @@ export declare class Observer implements MarkupElement {
|
|
|
23
23
|
get isMounted(): boolean;
|
|
24
24
|
constructor({ states, renderFn, elementContext }: ObserverOptions);
|
|
25
25
|
mount(parent: Node, after?: Node): void;
|
|
26
|
-
unmount(parentIsUnmounting
|
|
26
|
+
unmount(parentIsUnmounting?: boolean): void;
|
|
27
27
|
cleanup(parentIsUnmounting: boolean): void;
|
|
28
28
|
update(...children: Renderable[]): void;
|
|
29
29
|
}
|
|
@@ -17,6 +17,6 @@ export declare class Outlet implements MarkupElement {
|
|
|
17
17
|
constructor(config: OutletConfig);
|
|
18
18
|
get isMounted(): boolean;
|
|
19
19
|
mount(parent: Node, after?: Node | undefined): void;
|
|
20
|
-
unmount(parentIsUnmounting
|
|
20
|
+
unmount(parentIsUnmounting?: boolean): void;
|
|
21
21
|
update(newChildren: MarkupElement[]): void;
|
|
22
22
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MarkupElement, type ElementContext } from "../markup.js";
|
|
2
|
-
import { type Renderable } from "
|
|
2
|
+
import { type Renderable } from "../../types.js";
|
|
3
3
|
interface PortalConfig {
|
|
4
4
|
content: Renderable;
|
|
5
5
|
parent: Node;
|
|
@@ -14,6 +14,6 @@ export declare class Portal implements MarkupElement {
|
|
|
14
14
|
get isMounted(): boolean;
|
|
15
15
|
constructor(config: PortalConfig);
|
|
16
16
|
mount(_parent: Node, _after?: Node): void;
|
|
17
|
-
unmount(parentIsUnmounting
|
|
17
|
+
unmount(parentIsUnmounting?: boolean): void;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -27,7 +27,7 @@ export declare class Repeat<T> implements MarkupElement {
|
|
|
27
27
|
get isMounted(): boolean;
|
|
28
28
|
constructor({ elementContext, $items, renderFn, keyFn }: RepeatOptions<T>);
|
|
29
29
|
mount(parent: Node, after?: Node): void;
|
|
30
|
-
unmount(parentIsUnmounting
|
|
30
|
+
unmount(parentIsUnmounting?: boolean): void;
|
|
31
31
|
_cleanup(parentIsUnmounting: boolean): void;
|
|
32
32
|
_update(value: T[]): void;
|
|
33
33
|
}
|
|
@@ -13,7 +13,7 @@ export declare class Text implements MarkupElement {
|
|
|
13
13
|
get isMounted(): boolean;
|
|
14
14
|
constructor({ value }: TextOptions);
|
|
15
15
|
mount(parent: Node, after?: Node | null): Promise<void>;
|
|
16
|
-
unmount(parentIsUnmounting
|
|
16
|
+
unmount(parentIsUnmounting?: boolean): Promise<void>;
|
|
17
17
|
update(value?: Stringable): void;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
3
|
-
import { type MaybeState,
|
|
1
|
+
import type { Logger } from "./dolla.js";
|
|
2
|
+
import { type ElementContext, type Markup, type MarkupElement } from "./markup.js";
|
|
3
|
+
import { type MaybeState, State, type StateValues, type StopFunction } from "./state.js";
|
|
4
4
|
/**
|
|
5
5
|
* Any valid value that a View can return.
|
|
6
6
|
*/
|
|
@@ -70,7 +70,7 @@ export declare class View<P> implements ViewElement {
|
|
|
70
70
|
_props: P;
|
|
71
71
|
_element?: MarkupElement;
|
|
72
72
|
_$children: State<MarkupElement[]>;
|
|
73
|
-
_setChildren: Setter<MarkupElement[], MarkupElement[]>;
|
|
73
|
+
_setChildren: import("./state.js").Setter<MarkupElement[], MarkupElement[]>;
|
|
74
74
|
_watcher: import("./state.js").StateWatcher;
|
|
75
75
|
_beforeMountCallbacks: (() => any)[];
|
|
76
76
|
_onMountCallbacks: (() => any)[];
|
|
@@ -80,7 +80,7 @@ export declare class View<P> implements ViewElement {
|
|
|
80
80
|
get node(): Node;
|
|
81
81
|
isMounted: boolean;
|
|
82
82
|
mount(parent: Node, after?: Node): void;
|
|
83
|
-
unmount(parentIsUnmounting
|
|
83
|
+
unmount(parentIsUnmounting?: boolean): void;
|
|
84
84
|
setChildView(fn: ViewFunction<{}>): View<{}>;
|
|
85
85
|
initialize(): void;
|
|
86
86
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
export { createRef, createSettableState, createSetter, createState, derive, isRef, toSettableState, toState, valueOf, } from "./state.js";
|
|
2
|
-
export type { MaybeState, Ref, SettableState, State, StopFunction } from "./state.js";
|
|
3
|
-
export {
|
|
4
|
-
export
|
|
5
|
-
|
|
1
|
+
export { createRef, createSettableState, createSetter, createState, derive, isRef, toSettableState, toState, valueOf, } from "./core/state.js";
|
|
2
|
+
export type { MaybeState, Ref, SettableState, State, StopFunction } from "./core/state.js";
|
|
3
|
+
export { strictEqual, shallowEqual, deepEqual } from "./utils.js";
|
|
4
|
+
export { cond, createMarkup, html, portal, repeat } from "./core/markup.js";
|
|
5
|
+
export type { Markup, MarkupElement } from "./core/markup.js";
|
|
6
|
+
import { Dolla } from "./core/dolla.js";
|
|
6
7
|
declare const dolla: Dolla;
|
|
7
8
|
export default dolla;
|
|
8
|
-
export declare const t: (selector: string, options?: import("./modules/i18n.js").TOptions) => import("./state.js").State<string>;
|
|
9
|
+
export declare const t: (selector: string, options?: import("./modules/i18n.js").TOptions) => import("./core/state.js").State<string>;
|
|
9
10
|
export declare function setDevDebug(value: boolean): void;
|
|
10
11
|
export declare function getDevDebug(): boolean;
|
|
11
|
-
export type { Dolla, Environment, Logger, LoggerErrorContext, LoggerOptions, Loggles } from "./
|
|
12
|
+
export type { Dolla, Environment, Logger, LoggerErrorContext, LoggerOptions, Loggles } from "./core/dolla.js";
|
|
12
13
|
export type { HTTPRequest, HTTPResponse } from "./modules/http.js";
|
|
13
14
|
export type { InputType, Renderable } from "./types.js";
|
|
14
|
-
export type { ViewContext, ViewFunction, ViewElement as ViewNode } from "./view.js";
|
|
15
|
+
export type { ViewContext, ViewFunction, ViewElement as ViewNode } from "./core/view.js";
|
|
15
16
|
export type { CrashViewProps } from "./views/default-crash-view.js";
|
|
16
17
|
import type { IntrinsicElements as Elements } from "./types";
|
|
17
18
|
declare global {
|