revojs 0.0.15 → 0.0.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/dist/html/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/jsx/index.d.ts +1 -1
- package/dist/jsx/index.js +2 -1
- package/package.json +1 -1
package/dist/html/index.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export interface CustomElementConstructor<TEvents extends Events, TAttributes ex
|
|
|
68
68
|
new (): CustomElement<TEvents, TAttributes>;
|
|
69
69
|
}
|
|
70
70
|
export declare const isTemplate: (value: object) => value is Template;
|
|
71
|
-
export declare const createElement: <TEvents extends Events, TAttributes extends Attributes>(input: string | ComponentConstructor<TEvents, TAttributes>, attributes?: AttributeInput<TAttributes>, ...children: Array<Slot>) => Slot;
|
|
71
|
+
export declare const createElement: <TEvents extends Events, TAttributes extends Attributes>(input: string | Template | ComponentConstructor<TEvents, TAttributes>, attributes?: AttributeInput<TAttributes>, ...children: Array<Slot>) => Slot;
|
|
72
72
|
export declare const toString: (slot: Slot) => string;
|
|
73
73
|
export declare const toFragment: (nodes: Array<Node>) => DocumentFragment;
|
|
74
74
|
export declare const renderToString: (slot: Slot, context: Map<string, unknown>) => Promise<string>;
|
package/dist/index.js
CHANGED
|
@@ -216,7 +216,8 @@ const isTemplate = (value) => {
|
|
|
216
216
|
return "tag" in value && "attributes" in value && "children" in value;
|
|
217
217
|
};
|
|
218
218
|
const createElement = (input, attributes, ...children) => {
|
|
219
|
-
return
|
|
219
|
+
if (typeof input === "object") return input;
|
|
220
|
+
else return {
|
|
220
221
|
tag: typeof input === "function" ? input.$name : input,
|
|
221
222
|
attributes: attributes ?? {},
|
|
222
223
|
children
|
package/dist/jsx/index.d.ts
CHANGED
|
@@ -364,4 +364,4 @@ export declare namespace JSX {
|
|
|
364
364
|
}
|
|
365
365
|
export declare const svgElements: Set<string>;
|
|
366
366
|
export declare const namespace: (tag: string) => "http://www.w3.org/1999/xhtml" | "http://www.w3.org/2000/svg";
|
|
367
|
-
export declare const h: <TEvents extends import("..").Events, TAttributes extends import("..").Attributes>(input: string | import("..").ComponentConstructor<TEvents, TAttributes>, attributes?: import("..").AttributeInput<TAttributes>, ...children: Array<Slot>) => Slot;
|
|
367
|
+
export declare const h: <TEvents extends import("..").Events, TAttributes extends import("..").Attributes>(input: string | import("..").Template | import("..").ComponentConstructor<TEvents, TAttributes>, attributes?: import("..").AttributeInput<TAttributes>, ...children: Array<Slot>) => Slot;
|
package/dist/jsx/index.js
CHANGED
|
@@ -7,7 +7,8 @@ function defineHook(description) {
|
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/html/index.ts
|
|
9
9
|
const createElement = (input, attributes, ...children) => {
|
|
10
|
-
return
|
|
10
|
+
if (typeof input === "object") return input;
|
|
11
|
+
else return {
|
|
11
12
|
tag: typeof input === "function" ? input.$name : input,
|
|
12
13
|
attributes: attributes ?? {},
|
|
13
14
|
children
|