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.
@@ -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
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revojs",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "type": "module",
5
5
  "repository": "coverbase/revojs",
6
6
  "license": "MIT",