@orago/dodo 0.0.13 → 0.0.15
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.cjs","names":["Dodo","DodoUtil","oo"],"sources":["../../src/util/jsx-runtime.ts"],"sourcesContent":["// polyfill for jsx\r\nimport type { ElementName } from \"@orago/kiwi\";\r\nimport { ChildList, Dodo, DodoUpdate, DodoUtil, oo } from \"../dodo.js\";\r\n\r\ndeclare global {\r\n\tnamespace JSX {\r\n\t\texport type Element = ReturnType<typeof oo>;\r\n\t\texport type IntrinsicElements = {\r\n\t\t\t[K in keyof HTMLElementTagNameMap]:
|
|
1
|
+
{"version":3,"file":"jsx-runtime.cjs","names":["Dodo","DodoUtil","oo"],"sources":["../../src/util/jsx-runtime.ts"],"sourcesContent":["// polyfill for jsx\r\nimport type { ElementName } from \"@orago/kiwi\";\r\nimport { ChildList, Dodo, DodoUpdate, DodoUtil, oo } from \"../dodo.js\";\r\n\r\nexport type DodoJsxProps = DodoUpdate & {\r\n\t[K in keyof HTMLElementEventMap as `on:${K}`]?: (\r\n\t\tthis: Dodo,\r\n\t\tev: HTMLElementEventMap[K],\r\n\t) => any;\r\n};\r\n\r\ndeclare global {\r\n\tnamespace JSX {\r\n\t\texport type Element = ReturnType<typeof oo>;\r\n\t\texport type IntrinsicElements = {\r\n\t\t\t[K in keyof HTMLElementTagNameMap]: DodoJsxProps;\r\n\t\t};\r\n\t}\r\n}\r\n\r\ntype JsxProps = DodoJsxProps | null | undefined;\r\n\r\nexport function dodoJsxApply(dodo: Dodo, update?: JsxProps) {\r\n\tif (update == undefined) return;\r\n\tdodo.update(update);\r\n\r\n\tconst on_pre: string = \"on:\";\r\n\tfor (const key in update) {\r\n\t\tconst p = update[key as keyof typeof update];\r\n\t\tif (key.startsWith(on_pre) && typeof p === \"function\") {\r\n\t\t\tconst event = key.slice(on_pre.length).toLowerCase();\r\n\t\t\tdodo.events.on(event, p as EventListener);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport class DodoJSX extends Dodo {\r\n\tstatic use = (update?: JsxProps) => (dodo: Dodo) =>\r\n\t\tdodoJsxApply(dodo, update);\r\n\r\n\tconstructor(type: keyof HTMLElementTagNameMap, props: DodoJsxProps) {\r\n\t\tsuper(type);\r\n\t\tthis.use([DodoJSX.use(props)]);\r\n\t}\r\n}\r\n\r\nexport function JsxFragment(...children: ChildList): DocumentFragment {\r\n\tconst frag = document.createDocumentFragment();\r\n\tconst items = DodoUtil.flattenElements(children);\r\n\tfor (const item of items) frag.appendChild(item);\r\n\treturn frag;\r\n}\r\n\r\nexport function jsx(type: any, props: DodoJsxProps, key: any) {\r\n\tif (typeof type === \"function\") {\r\n\t\tif (props?.children != undefined) {\r\n\t\t\tprops.children = DodoUtil.flattenElements(props.children ?? []);\r\n\t\t}\r\n\t\treturn new type(props);\r\n\t}\r\n\r\n\treturn oo(type).use([DodoJSX.use(props)]);\r\n}\r\n\r\nexport const jsxs = jsx;\r\nexport const Fragment = JsxFragment;\r\n\r\nexport const jsxDEV = (\r\n\ttype: any,\r\n\tprops: DodoJsxProps,\r\n\tkey: any,\r\n\tisStatic: any,\r\n\tsource: any,\r\n\tself: any,\r\n) => {\r\n\treturn jsx(type, props, key);\r\n};\r\n"],"mappings":"kGAsBA,SAAgB,EAAa,EAAY,EAAmB,CACvD,MAAU,KACd,GAAK,OAAO,CAAM,EAGlB,IAAK,IAAM,KAAO,EAAQ,CACzB,IAAM,EAAI,EAAO,GACjB,GAAI,EAAI,WAAW,KAAM,GAAK,OAAO,GAAM,WAAY,CACtD,IAAM,EAAQ,EAAI,MAAM,CAAa,CAAC,CAAC,YAAY,EACnD,EAAK,OAAO,GAAG,EAAO,CAAkB,CACzC,CACD,CATkB,CAUnB,CAEA,IAAa,EAAb,MAAa,UAAgBA,EAAAA,IAAK,QACnB,KAAA,IAAA,GAAuB,GACpC,EAAa,EAAM,CAAM,EAE1B,YAAY,EAAmC,EAAqB,CACnE,MAAM,CAAI,EACV,KAAK,IAAI,CAAC,EAAQ,IAAI,CAAK,CAAC,CAAC,CAC9B,CACD,EAEA,SAAgB,EAAY,GAAG,EAAuC,CACrE,IAAM,EAAO,SAAS,uBAAuB,EACvC,EAAQC,EAAAA,SAAS,gBAAgB,CAAQ,EAC/C,IAAK,IAAM,KAAQ,EAAO,EAAK,YAAY,CAAI,EAC/C,OAAO,CACR,CAEA,SAAgB,EAAI,EAAW,EAAqB,EAAU,CAQ7D,OAPI,OAAO,GAAS,YACf,GAAO,UAAY,OACtB,EAAM,SAAWA,EAAAA,SAAS,gBAAgB,EAAM,UAAY,CAAC,CAAC,GAExD,IAAI,EAAK,CAAK,GAGfC,EAAAA,GAAG,CAAI,CAAC,CAAC,IAAI,CAAC,EAAQ,IAAI,CAAK,CAAC,CAAC,CACzC,CAEA,MAAa,EAAO,EACP,EAAW,EAEX,GACZ,EACA,EACA,EACA,EACA,EACA,IAEO,EAAI,EAAM,EAAO,CAAG"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ChildList, Dodo, DodoUpdate, oo } from "../dodo.js";
|
|
2
|
-
import { ElementName } from "@orago/kiwi";
|
|
3
2
|
//#region src/util/jsx-runtime.d.ts
|
|
3
|
+
type DodoJsxProps = DodoUpdate & { [K in keyof HTMLElementEventMap as `on:${K}`]?: (this: Dodo, ev: HTMLElementEventMap[K]) => any; };
|
|
4
4
|
declare global {
|
|
5
5
|
namespace JSX {
|
|
6
6
|
type Element = ReturnType<typeof oo>;
|
|
7
|
-
type IntrinsicElements = { [K in keyof HTMLElementTagNameMap]:
|
|
7
|
+
type IntrinsicElements = { [K in keyof HTMLElementTagNameMap]: DodoJsxProps; };
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
type DodoJsxProps = DodoUpdate & { [K in keyof HTMLElementEventMap as `on:${K}`]?: (this: Dodo, ev: HTMLElementEventMap[K]) => any; };
|
|
11
10
|
type JsxProps = DodoJsxProps | null | undefined;
|
|
12
11
|
declare function dodoJsxApply(dodo: Dodo, update?: JsxProps): void;
|
|
13
12
|
declare class DodoJSX extends Dodo {
|
|
@@ -15,10 +14,10 @@ declare class DodoJSX extends Dodo {
|
|
|
15
14
|
constructor(type: keyof HTMLElementTagNameMap, props: DodoJsxProps);
|
|
16
15
|
}
|
|
17
16
|
declare function JsxFragment(...children: ChildList): DocumentFragment;
|
|
18
|
-
declare function jsx(type: any, props:
|
|
17
|
+
declare function jsx(type: any, props: DodoJsxProps, key: any): any;
|
|
19
18
|
declare const jsxs: typeof jsx;
|
|
20
19
|
declare const Fragment: typeof JsxFragment;
|
|
21
|
-
declare const jsxDEV: (type: any, props:
|
|
20
|
+
declare const jsxDEV: (type: any, props: DodoJsxProps, key: any, isStatic: any, source: any, self: any) => any;
|
|
22
21
|
//#endregion
|
|
23
22
|
export { DodoJSX, DodoJsxProps, Fragment, JsxFragment, dodoJsxApply, jsx, jsxDEV, jsxs };
|
|
24
23
|
//# sourceMappingURL=jsx-runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.mjs","names":[],"sources":["../../src/util/jsx-runtime.ts"],"sourcesContent":["// polyfill for jsx\r\nimport type { ElementName } from \"@orago/kiwi\";\r\nimport { ChildList, Dodo, DodoUpdate, DodoUtil, oo } from \"../dodo.js\";\r\n\r\ndeclare global {\r\n\tnamespace JSX {\r\n\t\texport type Element = ReturnType<typeof oo>;\r\n\t\texport type IntrinsicElements = {\r\n\t\t\t[K in keyof HTMLElementTagNameMap]:
|
|
1
|
+
{"version":3,"file":"jsx-runtime.mjs","names":[],"sources":["../../src/util/jsx-runtime.ts"],"sourcesContent":["// polyfill for jsx\r\nimport type { ElementName } from \"@orago/kiwi\";\r\nimport { ChildList, Dodo, DodoUpdate, DodoUtil, oo } from \"../dodo.js\";\r\n\r\nexport type DodoJsxProps = DodoUpdate & {\r\n\t[K in keyof HTMLElementEventMap as `on:${K}`]?: (\r\n\t\tthis: Dodo,\r\n\t\tev: HTMLElementEventMap[K],\r\n\t) => any;\r\n};\r\n\r\ndeclare global {\r\n\tnamespace JSX {\r\n\t\texport type Element = ReturnType<typeof oo>;\r\n\t\texport type IntrinsicElements = {\r\n\t\t\t[K in keyof HTMLElementTagNameMap]: DodoJsxProps;\r\n\t\t};\r\n\t}\r\n}\r\n\r\ntype JsxProps = DodoJsxProps | null | undefined;\r\n\r\nexport function dodoJsxApply(dodo: Dodo, update?: JsxProps) {\r\n\tif (update == undefined) return;\r\n\tdodo.update(update);\r\n\r\n\tconst on_pre: string = \"on:\";\r\n\tfor (const key in update) {\r\n\t\tconst p = update[key as keyof typeof update];\r\n\t\tif (key.startsWith(on_pre) && typeof p === \"function\") {\r\n\t\t\tconst event = key.slice(on_pre.length).toLowerCase();\r\n\t\t\tdodo.events.on(event, p as EventListener);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport class DodoJSX extends Dodo {\r\n\tstatic use = (update?: JsxProps) => (dodo: Dodo) =>\r\n\t\tdodoJsxApply(dodo, update);\r\n\r\n\tconstructor(type: keyof HTMLElementTagNameMap, props: DodoJsxProps) {\r\n\t\tsuper(type);\r\n\t\tthis.use([DodoJSX.use(props)]);\r\n\t}\r\n}\r\n\r\nexport function JsxFragment(...children: ChildList): DocumentFragment {\r\n\tconst frag = document.createDocumentFragment();\r\n\tconst items = DodoUtil.flattenElements(children);\r\n\tfor (const item of items) frag.appendChild(item);\r\n\treturn frag;\r\n}\r\n\r\nexport function jsx(type: any, props: DodoJsxProps, key: any) {\r\n\tif (typeof type === \"function\") {\r\n\t\tif (props?.children != undefined) {\r\n\t\t\tprops.children = DodoUtil.flattenElements(props.children ?? []);\r\n\t\t}\r\n\t\treturn new type(props);\r\n\t}\r\n\r\n\treturn oo(type).use([DodoJSX.use(props)]);\r\n}\r\n\r\nexport const jsxs = jsx;\r\nexport const Fragment = JsxFragment;\r\n\r\nexport const jsxDEV = (\r\n\ttype: any,\r\n\tprops: DodoJsxProps,\r\n\tkey: any,\r\n\tisStatic: any,\r\n\tsource: any,\r\n\tself: any,\r\n) => {\r\n\treturn jsx(type, props, key);\r\n};\r\n"],"mappings":"yDAsBA,SAAgB,EAAa,EAAY,EAAmB,CACvD,MAAU,KACd,GAAK,OAAO,CAAM,EAGlB,IAAK,IAAM,KAAO,EAAQ,CACzB,IAAM,EAAI,EAAO,GACjB,GAAI,EAAI,WAAW,KAAM,GAAK,OAAO,GAAM,WAAY,CACtD,IAAM,EAAQ,EAAI,MAAM,CAAa,CAAC,CAAC,YAAY,EACnD,EAAK,OAAO,GAAG,EAAO,CAAkB,CACzC,CACD,CATkB,CAUnB,CAEA,IAAa,EAAb,MAAa,UAAgB,CAAK,QACnB,KAAA,IAAA,GAAuB,GACpC,EAAa,EAAM,CAAM,EAE1B,YAAY,EAAmC,EAAqB,CACnE,MAAM,CAAI,EACV,KAAK,IAAI,CAAC,EAAQ,IAAI,CAAK,CAAC,CAAC,CAC9B,CACD,EAEA,SAAgB,EAAY,GAAG,EAAuC,CACrE,IAAM,EAAO,SAAS,uBAAuB,EACvC,EAAQ,EAAS,gBAAgB,CAAQ,EAC/C,IAAK,IAAM,KAAQ,EAAO,EAAK,YAAY,CAAI,EAC/C,OAAO,CACR,CAEA,SAAgB,EAAI,EAAW,EAAqB,EAAU,CAQ7D,OAPI,OAAO,GAAS,YACf,GAAO,UAAY,OACtB,EAAM,SAAW,EAAS,gBAAgB,EAAM,UAAY,CAAC,CAAC,GAExD,IAAI,EAAK,CAAK,GAGf,EAAG,CAAI,CAAC,CAAC,IAAI,CAAC,EAAQ,IAAI,CAAK,CAAC,CAAC,CACzC,CAEA,MAAa,EAAO,EACP,EAAW,EAEX,GACZ,EACA,EACA,EACA,EACA,EACA,IAEO,EAAI,EAAM,EAAO,CAAG"}
|
package/package.json
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@orago/dodo",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Dear Orago's Dom Objects",
|
|
5
|
-
"main": "./dist/index.mjs",
|
|
6
|
-
"types": "./dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsdown"
|
|
9
|
-
},
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./dist/index.mjs",
|
|
14
|
-
"require": "./dist/index.cjs"
|
|
15
|
-
},
|
|
16
|
-
"./plugins": {
|
|
17
|
-
"types": "./dist/plugins/index.d.ts",
|
|
18
|
-
"import": "./dist/plugins/index.mjs",
|
|
19
|
-
"require": "./dist/plugins/index.cjs"
|
|
20
|
-
},
|
|
21
|
-
"./server": {
|
|
22
|
-
"types": "./dist/server/index.d.ts",
|
|
23
|
-
"import": "./dist/server/index.mjs",
|
|
24
|
-
"require": "./dist/server/index.cjs"
|
|
25
|
-
},
|
|
26
|
-
"./jsx-runtime": {
|
|
27
|
-
"types": "./dist/jsx-runtime.d.ts",
|
|
28
|
-
"import": "./dist/jsx-runtime.mjs",
|
|
29
|
-
"require": "./dist/jsx-runtime.cjs"
|
|
30
|
-
},
|
|
31
|
-
"./jsx-dev-runtime": {
|
|
32
|
-
"types": "./dist/jsx-runtime.d.ts",
|
|
33
|
-
"import": "./dist/jsx-runtime.mjs",
|
|
34
|
-
"require": "./dist/jsx-runtime.cjs"
|
|
35
|
-
},
|
|
36
|
-
"./*": {
|
|
37
|
-
"types": "./dist/*.d.ts",
|
|
38
|
-
"import": "./dist/*.mjs",
|
|
39
|
-
"require": "./dist/*.cjs"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"typesVersions": {
|
|
43
|
-
"*": {
|
|
44
|
-
"*": [
|
|
45
|
-
"./src/*"
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"author": "Orago",
|
|
50
|
-
"license": "ISC",
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"@orago/kiwi": "^0.0.
|
|
53
|
-
"@orago/lib": "^0.0.47"
|
|
54
|
-
},
|
|
55
|
-
"devDependencies": {
|
|
56
|
-
"@types/node": "^26.1.2",
|
|
57
|
-
"tsdown": "^0.22.14",
|
|
58
|
-
"typescript": "^5.3.3",
|
|
59
|
-
"vite": "^7.1.7"
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@orago/dodo",
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
"description": "Dear Orago's Dom Objects",
|
|
5
|
+
"main": "./dist/index.mjs",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsdown"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./plugins": {
|
|
17
|
+
"types": "./dist/plugins/index.d.ts",
|
|
18
|
+
"import": "./dist/plugins/index.mjs",
|
|
19
|
+
"require": "./dist/plugins/index.cjs"
|
|
20
|
+
},
|
|
21
|
+
"./server": {
|
|
22
|
+
"types": "./dist/server/index.d.ts",
|
|
23
|
+
"import": "./dist/server/index.mjs",
|
|
24
|
+
"require": "./dist/server/index.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./jsx-runtime": {
|
|
27
|
+
"types": "./dist/util/jsx-runtime.d.ts",
|
|
28
|
+
"import": "./dist/util/jsx-runtime.mjs",
|
|
29
|
+
"require": "./dist/util/jsx-runtime.cjs"
|
|
30
|
+
},
|
|
31
|
+
"./jsx-dev-runtime": {
|
|
32
|
+
"types": "./dist/util/jsx-runtime.d.ts",
|
|
33
|
+
"import": "./dist/util/jsx-runtime.mjs",
|
|
34
|
+
"require": "./dist/util/jsx-runtime.cjs"
|
|
35
|
+
},
|
|
36
|
+
"./*": {
|
|
37
|
+
"types": "./dist/*.d.ts",
|
|
38
|
+
"import": "./dist/*.mjs",
|
|
39
|
+
"require": "./dist/*.cjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"typesVersions": {
|
|
43
|
+
"*": {
|
|
44
|
+
"*": [
|
|
45
|
+
"./src/*"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"author": "Orago",
|
|
50
|
+
"license": "ISC",
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@orago/kiwi": "^0.0.10",
|
|
53
|
+
"@orago/lib": "^0.0.47"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/node": "^26.1.2",
|
|
57
|
+
"tsdown": "^0.22.14",
|
|
58
|
+
"typescript": "^5.3.3",
|
|
59
|
+
"vite": "^7.1.7"
|
|
60
|
+
}
|
|
61
61
|
}
|
package/pnpm-workspace.yaml
CHANGED
package/src/util/jsx-runtime.ts
CHANGED
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
import type { ElementName } from "@orago/kiwi";
|
|
3
3
|
import { ChildList, Dodo, DodoUpdate, DodoUtil, oo } from "../dodo.js";
|
|
4
4
|
|
|
5
|
+
export type DodoJsxProps = DodoUpdate & {
|
|
6
|
+
[K in keyof HTMLElementEventMap as `on:${K}`]?: (
|
|
7
|
+
this: Dodo,
|
|
8
|
+
ev: HTMLElementEventMap[K],
|
|
9
|
+
) => any;
|
|
10
|
+
};
|
|
11
|
+
|
|
5
12
|
declare global {
|
|
6
13
|
namespace JSX {
|
|
7
14
|
export type Element = ReturnType<typeof oo>;
|
|
8
15
|
export type IntrinsicElements = {
|
|
9
|
-
[K in keyof HTMLElementTagNameMap]:
|
|
16
|
+
[K in keyof HTMLElementTagNameMap]: DodoJsxProps;
|
|
10
17
|
};
|
|
11
18
|
}
|
|
12
19
|
}
|
|
13
|
-
export type DodoJsxProps = DodoUpdate & {
|
|
14
|
-
[K in keyof HTMLElementEventMap as `on:${K}`]?: (
|
|
15
|
-
this: Dodo,
|
|
16
|
-
ev: HTMLElementEventMap[K],
|
|
17
|
-
) => any;
|
|
18
|
-
};
|
|
19
20
|
|
|
20
21
|
type JsxProps = DodoJsxProps | null | undefined;
|
|
21
22
|
|
|
@@ -50,7 +51,7 @@ export function JsxFragment(...children: ChildList): DocumentFragment {
|
|
|
50
51
|
return frag;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
export function jsx(type: any, props:
|
|
54
|
+
export function jsx(type: any, props: DodoJsxProps, key: any) {
|
|
54
55
|
if (typeof type === "function") {
|
|
55
56
|
if (props?.children != undefined) {
|
|
56
57
|
props.children = DodoUtil.flattenElements(props.children ?? []);
|
|
@@ -66,7 +67,7 @@ export const Fragment = JsxFragment;
|
|
|
66
67
|
|
|
67
68
|
export const jsxDEV = (
|
|
68
69
|
type: any,
|
|
69
|
-
props:
|
|
70
|
+
props: DodoJsxProps,
|
|
70
71
|
key: any,
|
|
71
72
|
isStatic: any,
|
|
72
73
|
source: any,
|