@manyducks.co/dolla 2.0.0-alpha.14 → 2.0.0-alpha.16
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/README.md +20 -15
- package/dist/index.d.ts +4 -4
- package/dist/index.js +368 -345
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/markup.d.ts +1 -9
- package/dist/modules/dolla.d.ts +15 -3
- package/dist/nodes/html.d.ts +3 -2
- package/dist/passthrough-DUh0_zQF.js +1398 -0
- package/dist/passthrough-DUh0_zQF.js.map +1 -0
- package/dist/state.d.ts +49 -12
- package/dist/types.d.ts +2 -2
- package/dist/view.d.ts +2 -2
- package/package.json +2 -1
- package/dist/passthrough-MfPKbG0F.js +0 -1303
- package/dist/passthrough-MfPKbG0F.js.map +0 -1
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s } from "./passthrough-
|
|
2
|
-
import { P as m } from "./passthrough-
|
|
1
|
+
import { s } from "./passthrough-DUh0_zQF.js";
|
|
2
|
+
import { P as m } from "./passthrough-DUh0_zQF.js";
|
|
3
3
|
function d(n, r, t, e, a, l) {
|
|
4
4
|
const i = { ...o(["children", "key"], r) }, c = Array.isArray(r.children) ? r.children : [r.children];
|
|
5
5
|
return s(n, i, ...c);
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as t } from "./passthrough-
|
|
2
|
-
import { P as l } from "./passthrough-
|
|
1
|
+
import { s as t } from "./passthrough-DUh0_zQF.js";
|
|
2
|
+
import { P as l } from "./passthrough-DUh0_zQF.js";
|
|
3
3
|
function d(n, e, r) {
|
|
4
4
|
return t(n, e ? { ...u(["children", "key"], e) } : void 0, e.children);
|
|
5
5
|
}
|
package/dist/markup.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Dolla } from "./modules/dolla.js";
|
|
2
2
|
import { MaybeState, type State } from "./state.js";
|
|
3
3
|
import type { Renderable, Stringable } from "./types.js";
|
|
4
|
-
import { type
|
|
4
|
+
import { type ViewContext, type ViewFunction, type ViewResult } from "./view.js";
|
|
5
5
|
export interface ElementContext {
|
|
6
6
|
/**
|
|
7
7
|
* The root Dolla instance this element belongs to.
|
|
@@ -99,14 +99,6 @@ export declare function repeat<T>(items: MaybeState<T[]>, keyFn: (value: T, inde
|
|
|
99
99
|
* Render `content` into a `parent` node anywhere in the page, rather than at its position in the view.
|
|
100
100
|
*/
|
|
101
101
|
export declare function portal(parent: Node, content: Renderable): Markup;
|
|
102
|
-
/**
|
|
103
|
-
* A special kind of State exclusively for storing references to DOM nodes.
|
|
104
|
-
*/
|
|
105
|
-
export declare function createRef<T extends Node>(): Ref<T>;
|
|
106
|
-
export declare function isRef<T extends Node>(value: any): value is Ref<T>;
|
|
107
|
-
export interface Ref<T extends Node> extends State<T | undefined> {
|
|
108
|
-
node: T | undefined;
|
|
109
|
-
}
|
|
110
102
|
/**
|
|
111
103
|
* Construct Markup metadata into a set of MarkupElements.
|
|
112
104
|
*/
|
package/dist/modules/dolla.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createSettableState, createState, derive, toSettableState, toState, valueOf,
|
|
3
|
-
import { type
|
|
1
|
+
import { type Markup, type MarkupElement } from "../markup.js";
|
|
2
|
+
import { createRef, createSettableState, createState, createWatcher, derive, isRef, toSettableState, toState, valueOf, type State } from "../state.js";
|
|
3
|
+
import { type ViewElement, type ViewFunction } from "../view.js";
|
|
4
4
|
import { type CrashViewProps } from "../views/default-crash-view.js";
|
|
5
5
|
import { HTTP } from "./http.js";
|
|
6
6
|
import { I18n } from "./i18n.js";
|
|
@@ -74,6 +74,18 @@ export declare class Dolla {
|
|
|
74
74
|
* When a crash is reported the app will be unmounted and replaced with this crash page.
|
|
75
75
|
*/
|
|
76
76
|
setCrashView(view: ViewFunction<CrashViewProps>): void;
|
|
77
|
+
/**
|
|
78
|
+
* Sets a context variable and returns its value. Context variables are accessible on the app and in child views.
|
|
79
|
+
*/
|
|
80
|
+
set<T>(key: string | symbol, value: T): T;
|
|
81
|
+
/**
|
|
82
|
+
* Gets the value of a context variable. Returns null if the variable is not set.
|
|
83
|
+
*/
|
|
84
|
+
get<T>(key: string | symbol): T | null;
|
|
85
|
+
/**
|
|
86
|
+
* Returns an object of all context variables stored at the app level.
|
|
87
|
+
*/
|
|
88
|
+
getAll(): Record<string | symbol, unknown>;
|
|
77
89
|
mount(selector: string, view?: ViewFunction<any>): Promise<void>;
|
|
78
90
|
mount(element: HTMLElement, view?: ViewFunction<any>): Promise<void>;
|
|
79
91
|
unmount(): Promise<void>;
|
package/dist/nodes/html.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ElementContext, type Markup, type MarkupElement
|
|
2
|
-
import { type StopFunction } from "../state.js";
|
|
1
|
+
import { type ElementContext, type Markup, type MarkupElement } from "../markup.js";
|
|
2
|
+
import { type Ref, type State, type StopFunction } from "../state.js";
|
|
3
3
|
type HTMLOptions = {
|
|
4
4
|
elementContext: ElementContext;
|
|
5
5
|
tag: string;
|
|
@@ -20,6 +20,7 @@ export declare class HTML implements MarkupElement {
|
|
|
20
20
|
mount(parent: Node, after?: Node): void;
|
|
21
21
|
unmount(): void;
|
|
22
22
|
getUpdateKey(type: string, value: string | number): string;
|
|
23
|
+
attachProp<T>(value: State<T> | T, callback: (value: T) => void, updateKey: string): void;
|
|
23
24
|
applyProps(element: HTMLElement | SVGElement, props: Record<string, unknown>): void;
|
|
24
25
|
applyStyles(element: HTMLElement | SVGElement, styles: unknown, stopCallbacks: StopFunction[]): () => void;
|
|
25
26
|
applyClasses(element: HTMLElement | SVGElement, classes: unknown, stopCallbacks: StopFunction[]): () => void;
|