@manyducks.co/dolla 2.0.0-alpha.22 → 2.0.0-alpha.23
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/dolla.d.ts +19 -3
- package/dist/core/markup.d.ts +5 -5
- package/dist/core/nodes/cond.d.ts +4 -2
- package/dist/core/nodes/html.d.ts +2 -0
- package/dist/core/nodes/observer.d.ts +4 -1
- package/dist/core/nodes/outlet.d.ts +10 -14
- package/dist/core/nodes/portal.d.ts +3 -1
- package/dist/core/nodes/repeat.d.ts +5 -3
- package/dist/core/nodes/text.d.ts +2 -0
- package/dist/core/{view.d.ts → nodes/view.d.ts} +8 -6
- package/dist/core/state.d.ts +3 -4
- package/dist/core/symbols.d.ts +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +598 -555
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +3 -3
- package/dist/jsx-runtime.js +2 -2
- package/dist/modules/http.d.ts +2 -0
- package/dist/modules/i18n.d.ts +1 -1
- package/dist/modules/router.d.ts +15 -24
- package/dist/passthrough-C9975ULD.js +1453 -0
- package/dist/passthrough-C9975ULD.js.map +1 -0
- package/dist/typeChecking.d.ts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/views/passthrough.d.ts +1 -1
- package/docs/http.md +16 -0
- package/docs/router.md +19 -0
- package/index.d.ts +2 -2
- package/notes/TODO.md +6 -0
- package/notes/scratch.md +2 -2
- package/package.json +1 -2
- package/vite.config.js +0 -10
- package/dist/passthrough-CrReqVVB.js +0 -1442
- package/dist/passthrough-CrReqVVB.js.map +0 -1
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as m } from "./passthrough-
|
|
3
|
-
function d(n, r, t, e,
|
|
1
|
+
import { w as s } from "./passthrough-C9975ULD.js";
|
|
2
|
+
import { P as m } from "./passthrough-C9975ULD.js";
|
|
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);
|
|
6
6
|
}
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as l } from "./passthrough-
|
|
1
|
+
import { w as t } from "./passthrough-C9975ULD.js";
|
|
2
|
+
import { P as l } from "./passthrough-C9975ULD.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/modules/http.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { Dolla } from "../core/dolla.js";
|
|
1
2
|
/**
|
|
2
3
|
* A simple HTTP client with middleware support. Middleware applies to all requests made through this store,
|
|
3
4
|
* so it's the perfect way to handle things like auth headers and permission checks for API calls.
|
|
4
5
|
*/
|
|
5
6
|
export declare class HTTP {
|
|
6
7
|
#private;
|
|
8
|
+
constructor(dolla: Dolla);
|
|
7
9
|
/**
|
|
8
10
|
* Adds a new middleware that will apply to subsequent requests.
|
|
9
11
|
* Returns a function to remove this middleware.
|
package/dist/modules/i18n.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type MaybeState, type State } from "../core/state.js";
|
|
2
1
|
import type { Dolla } from "../core/dolla.js";
|
|
2
|
+
import { type MaybeState, type State } from "../core/state.js";
|
|
3
3
|
/**
|
|
4
4
|
* A JSON object of translated strings. Values can be string templates or nested objects.
|
|
5
5
|
*/
|
package/dist/modules/router.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Stringable } from "../types.js";
|
|
2
|
-
import { type ViewElement, type ViewFunction } from "../core/view.js";
|
|
3
1
|
import type { Dolla } from "../core/dolla.js";
|
|
2
|
+
import type { ViewFunction } from "../core/nodes/view.js";
|
|
3
|
+
import type { Stringable } from "../types.js";
|
|
4
4
|
export interface RouteMatchContext {
|
|
5
5
|
/**
|
|
6
6
|
* Redirects the user to a different route instead of matching the current one.
|
|
@@ -29,14 +29,15 @@ export interface Route {
|
|
|
29
29
|
*/
|
|
30
30
|
beforeMatch?: (ctx: RouteMatchContext) => void | Promise<void>;
|
|
31
31
|
}
|
|
32
|
+
export interface RouteMeta {
|
|
33
|
+
redirect?: string | ((ctx: RouteRedirectContext) => string) | ((ctx: RouteRedirectContext) => Promise<string>);
|
|
34
|
+
pattern?: string;
|
|
35
|
+
layers?: RouteLayer[];
|
|
36
|
+
beforeMatch?: (ctx: RouteMatchContext) => void | Promise<void>;
|
|
37
|
+
}
|
|
32
38
|
export interface RouteConfig {
|
|
33
39
|
pattern: string;
|
|
34
|
-
meta:
|
|
35
|
-
redirect?: string | ((ctx: RouteRedirectContext) => string) | ((ctx: RouteRedirectContext) => Promise<string>);
|
|
36
|
-
pattern?: string;
|
|
37
|
-
layers?: RouteLayer[];
|
|
38
|
-
beforeMatch?: (ctx: RouteMatchContext) => void | Promise<void>;
|
|
39
|
-
};
|
|
40
|
+
meta: RouteMeta;
|
|
40
41
|
}
|
|
41
42
|
export interface RouteLayer {
|
|
42
43
|
id: number;
|
|
@@ -63,11 +64,6 @@ export interface RouteRedirectContext {
|
|
|
63
64
|
*/
|
|
64
65
|
query: Record<string, string | number | boolean | undefined>;
|
|
65
66
|
}
|
|
66
|
-
interface ParsedParams {
|
|
67
|
-
[key: string]: string | number | boolean | (string | number | boolean | null)[] | null;
|
|
68
|
-
}
|
|
69
|
-
interface ParsedQuery extends ParsedParams {
|
|
70
|
-
}
|
|
71
67
|
export interface NavigateOptions {
|
|
72
68
|
/**
|
|
73
69
|
* Replace the current item in the history stack instead of adding a new one.
|
|
@@ -79,23 +75,19 @@ export interface NavigateOptions {
|
|
|
79
75
|
*/
|
|
80
76
|
preserveQuery?: boolean;
|
|
81
77
|
}
|
|
82
|
-
export interface
|
|
78
|
+
export interface RouterOptions {
|
|
83
79
|
routes: Route[];
|
|
84
80
|
/**
|
|
85
81
|
* When true, the router will construct routes like "https://www.example.com/#/sub/route" which work without any backend intervention.
|
|
86
82
|
*/
|
|
87
83
|
hash?: boolean;
|
|
88
84
|
}
|
|
89
|
-
export interface RouterElements {
|
|
90
|
-
readonly rootElement?: HTMLElement;
|
|
91
|
-
readonly rootView?: ViewElement;
|
|
92
|
-
}
|
|
93
85
|
export declare class Router {
|
|
94
86
|
#private;
|
|
95
87
|
/**
|
|
96
88
|
* The currently matched route pattern, if any.
|
|
97
89
|
*/
|
|
98
|
-
$pattern: import("../core/state.js").State<string |
|
|
90
|
+
$pattern: import("../core/state.js").State<string | undefined>;
|
|
99
91
|
/**
|
|
100
92
|
* The current URL path.
|
|
101
93
|
*/
|
|
@@ -103,13 +95,13 @@ export declare class Router {
|
|
|
103
95
|
/**
|
|
104
96
|
* The current named path params.
|
|
105
97
|
*/
|
|
106
|
-
$params: import("../core/state.js").State<
|
|
98
|
+
$params: import("../core/state.js").State<Record<string, string | number>>;
|
|
107
99
|
/**
|
|
108
100
|
* The current query params. Changes to this object will be reflected in the URL.
|
|
109
101
|
*/
|
|
110
|
-
$query: import("../core/state.js").State<
|
|
111
|
-
constructor(dolla: Dolla
|
|
112
|
-
setup(options:
|
|
102
|
+
$query: import("../core/state.js").State<Record<string, string | number | boolean>>;
|
|
103
|
+
constructor(dolla: Dolla);
|
|
104
|
+
setup(options: RouterOptions): Promise<void>;
|
|
113
105
|
/**
|
|
114
106
|
* Navigate backward. Pass a number of steps to hit the back button that many times.
|
|
115
107
|
*/
|
|
@@ -137,4 +129,3 @@ export declare class Router {
|
|
|
137
129
|
* @param _window - (optional) Override for global window object
|
|
138
130
|
*/
|
|
139
131
|
export declare function catchLinks(root: HTMLElement, callback: (anchor: HTMLAnchorElement) => void, _window?: Window & typeof globalThis): () => void;
|
|
140
|
-
export {};
|