marko 5.22.4 → 5.22.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core-tags/core/await/index.marko +6 -6
- package/dist/runtime/components/entry/index-browser.js +4 -0
- package/dist/runtime/components/entry/index.js +4 -0
- package/index.d.ts +17 -20
- package/package.json +3 -3
- package/src/core-tags/core/await/index.marko +6 -6
- package/src/runtime/components/entry/index-browser.js +4 -0
- package/src/runtime/components/entry/index.js +4 -0
@@ -1,13 +1,13 @@
|
|
1
1
|
/**
|
2
2
|
* @template T
|
3
3
|
* @typedef {{
|
4
|
-
* value?: T;
|
5
|
-
* then?: Marko.Body<[Awaited<T>], void
|
6
|
-
* catch?: Marko.Body<[unknown], void
|
7
|
-
* placeholder?: Marko.Body<[], void
|
8
|
-
* client-reorder?: boolean;
|
4
|
+
* value?: readonly [T];
|
5
|
+
* then?: { renderBody: Marko.Body<[Awaited<T>], void> };
|
6
|
+
* catch?: { renderBody: Marko.Body<[unknown], void> };
|
7
|
+
* placeholder?: { renderBody: Marko.Body<[], void> };
|
8
|
+
* "client-reorder"?: boolean;
|
9
9
|
* name?: string;
|
10
10
|
* timeout?: number;
|
11
|
-
* show-after?: string;
|
11
|
+
* "show-after"?: string;
|
12
12
|
* }} Input
|
13
13
|
*/
|
@@ -270,4 +270,8 @@ exports.writeInitComponentsCode = writeInitComponentsCode;
|
|
270
270
|
*/
|
271
271
|
exports.getRenderedComponents = function (out) {
|
272
272
|
return warp10.stringifyPrepare(getInitComponentsDataFromOut(out));
|
273
|
+
};
|
274
|
+
|
275
|
+
globalThis.Marko = {
|
276
|
+
Component: function () {}
|
273
277
|
};
|
package/index.d.ts
CHANGED
@@ -78,15 +78,11 @@ declare namespace Marko {
|
|
78
78
|
> {}
|
79
79
|
|
80
80
|
/** Valid data types which can be passed in as a <${dynamic}/> tag name. */
|
81
|
-
export type
|
82
|
-
| {
|
83
|
-
renderBody?: Body<any, any> | Template | string | void | false;
|
84
|
-
}
|
81
|
+
export type Renderable =
|
82
|
+
| { renderBody: Body<any, any> | Template | string }
|
85
83
|
| Body<any, any>
|
86
84
|
| Template
|
87
|
-
| string
|
88
|
-
| void
|
89
|
-
| false;
|
85
|
+
| string;
|
90
86
|
|
91
87
|
/** Extract the return tag type from a renderBody. */
|
92
88
|
export type BodyReturnType<B> = B extends Body<any, infer Return>
|
@@ -94,12 +90,16 @@ declare namespace Marko {
|
|
94
90
|
: never;
|
95
91
|
|
96
92
|
/** Extract the tag parameter types received by a renderBody. */
|
97
|
-
export type
|
93
|
+
export type BodyParameters<B> = B extends Body<infer Params, any>
|
98
94
|
? Params
|
99
95
|
: never;
|
100
96
|
|
101
|
-
export
|
102
|
-
Input extends Record<PropertyKey, any> = Record<PropertyKey, any
|
97
|
+
export class Component<
|
98
|
+
Input extends Record<PropertyKey, any> = Record<PropertyKey, any>,
|
99
|
+
State extends undefined | null | Record<PropertyKey, any> =
|
100
|
+
| undefined
|
101
|
+
| null
|
102
|
+
| Record<PropertyKey, any>
|
103
103
|
> implements Emitter
|
104
104
|
{
|
105
105
|
/** A unique id for this instance. */
|
@@ -111,7 +111,7 @@ declare namespace Marko {
|
|
111
111
|
/** @deprecated */
|
112
112
|
public readonly els: Element[];
|
113
113
|
/** Mutable state that when changed causes a rerender. */
|
114
|
-
|
114
|
+
state: State;
|
115
115
|
|
116
116
|
/** Returns the amount of event handlers listening to a specific event. */
|
117
117
|
listenerCount(eventName: PropertyKey): number;
|
@@ -197,20 +197,17 @@ declare namespace Marko {
|
|
197
197
|
/** Replaces the children of an existing DOM element with the dom for the current instance. */
|
198
198
|
replaceChildrenOf(target: ParentNode): this;
|
199
199
|
/** Called when the component is firsted created. */
|
200
|
-
|
200
|
+
onCreate?(input: this["input"], out: Marko.Out): void;
|
201
201
|
/** Called every time the component receives input from it's parent. */
|
202
|
-
|
203
|
-
input: this["input"],
|
204
|
-
out: Marko.Out
|
205
|
-
): void | this["input"];
|
202
|
+
onInput?(input: this["input"], out: Marko.Out): void | this["input"];
|
206
203
|
/** Called after a component has successfully rendered, but before it's update has been applied to the dom. */
|
207
|
-
|
204
|
+
onRender?(out: Marko.Out): void;
|
208
205
|
/** Called after the first time the component renders and is attached to the dom. */
|
209
|
-
|
206
|
+
onMount?(): void;
|
210
207
|
/** Called when a components render has been applied to the DOM (excluding when it is initially mounted). */
|
211
|
-
|
208
|
+
onUpdate?(): void;
|
212
209
|
/** Called when a component is destroyed and removed from the dom. */
|
213
|
-
|
210
|
+
onDestroy?(): void;
|
214
211
|
}
|
215
212
|
|
216
213
|
/** The top level api for a Marko Template. */
|
package/package.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "marko",
|
3
|
-
"version": "5.22.
|
3
|
+
"version": "5.22.6",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
|
6
6
|
"dependencies": {
|
7
|
-
"@marko/compiler": "^5.23.
|
8
|
-
"@marko/translator-default": "^5.22.
|
7
|
+
"@marko/compiler": "^5.23.5",
|
8
|
+
"@marko/translator-default": "^5.22.5",
|
9
9
|
"app-module-path": "^2.2.0",
|
10
10
|
"argly": "^1.2.0",
|
11
11
|
"browser-refresh-client": "1.1.4",
|
@@ -1,13 +1,13 @@
|
|
1
1
|
/**
|
2
2
|
* @template T
|
3
3
|
* @typedef {{
|
4
|
-
* value?: T;
|
5
|
-
* then?: Marko.Body<[Awaited<T>], void
|
6
|
-
* catch?: Marko.Body<[unknown], void
|
7
|
-
* placeholder?: Marko.Body<[], void
|
8
|
-
* client-reorder?: boolean;
|
4
|
+
* value?: readonly [T];
|
5
|
+
* then?: { renderBody: Marko.Body<[Awaited<T>], void> };
|
6
|
+
* catch?: { renderBody: Marko.Body<[unknown], void> };
|
7
|
+
* placeholder?: { renderBody: Marko.Body<[], void> };
|
8
|
+
* "client-reorder"?: boolean;
|
9
9
|
* name?: string;
|
10
10
|
* timeout?: number;
|
11
|
-
* show-after?: string;
|
11
|
+
* "show-after"?: string;
|
12
12
|
* }} Input
|
13
13
|
*/
|