lithent 1.9.0 → 1.9.1
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/README.md +14 -14
- package/ftags/dist/lithentFTags.mjs +1 -1
- package/ftags/dist/lithentFTags.mjs.map +1 -1
- package/ftags/dist/lithentFTags.umd.js +1 -1
- package/ftags/dist/lithentFTags.umd.js.map +1 -1
- package/ftags/src/index.ts +1 -1
- package/package.json +1 -1
- package/src/tests/ftag.tsx +3 -3
package/README.md
CHANGED
|
@@ -66,14 +66,14 @@ pnpm add lithent
|
|
|
66
66
|
|
|
67
67
|
#### Or Use CDN
|
|
68
68
|
|
|
69
|
-
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
70
|
-
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
71
|
-
* UMD-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
72
|
-
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
73
|
-
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
74
|
-
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
75
|
-
* ESM-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
76
|
-
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
69
|
+
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.9.1/dist/lithent.umd.js
|
|
70
|
+
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.9.1/helper/dist/lithentHelper.umd.js
|
|
71
|
+
* UMD-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.9.1/ftags/dist/lithentFTags.umd.js
|
|
72
|
+
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.9.1/tag/dist/lithentTag.umd.js
|
|
73
|
+
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.9.1/dist/lithent.mjs
|
|
74
|
+
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.9.1/helper/dist/lithentHelper.mjs
|
|
75
|
+
* ESM-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.9.1/ftags/dist/lithentFTag.mjs
|
|
76
|
+
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.9.1/tag/dist/lithentTag.mjs
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
It's easier to use lithent with JSX or HTM.
|
|
@@ -100,7 +100,7 @@ const fTagComponent = fMount<{ firstProp: number }>((_r, props, children) => {
|
|
|
100
100
|
return () =>
|
|
101
101
|
fFragment(
|
|
102
102
|
'first inner',
|
|
103
|
-
div({ style:
|
|
103
|
+
div({ style: { border: '1px solid red' } }, 'second inner'),
|
|
104
104
|
props.firstProp,
|
|
105
105
|
...children
|
|
106
106
|
);
|
|
@@ -109,7 +109,7 @@ const fTagComponent = fMount<{ firstProp: number }>((_r, props, children) => {
|
|
|
109
109
|
render(
|
|
110
110
|
fTagComponent(
|
|
111
111
|
{ firstProp: 3 },
|
|
112
|
-
div({ style:
|
|
112
|
+
div({ style: { border: '1px solid green' } }, `Fchildren1`),
|
|
113
113
|
'Fchildren2',
|
|
114
114
|
br()
|
|
115
115
|
),
|
|
@@ -161,10 +161,10 @@ const destroy = render(lTag`<${Component} />`, document.getElementById('root'),
|
|
|
161
161
|
#### With UMD
|
|
162
162
|
|
|
163
163
|
```html
|
|
164
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
165
|
-
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
166
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
167
|
-
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.9.
|
|
164
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.9.1/dist/lithent.umd.js"></script>
|
|
165
|
+
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.9.1/helper/dist/lithentHelper.umd.js"></script-->
|
|
166
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.9.1/tag/dist/lithentTag.umd.js"></script>
|
|
167
|
+
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.9.1/ftags/dist/lithentFTags.umd.js"></script-->
|
|
168
168
|
|
|
169
169
|
<div id="root"></div>
|
|
170
170
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lithentFTags.mjs","sources":["../src/index.ts"],"sourcesContent":["import { h, Fragment } from 'lithent';\nimport type {\n Props,\n WDom,\n FragmentFunction,\n MiddleStateWDom,\n Component,\n TagFunction,\n} from 'lithent';\n\ntype FFunction = (props?: Props, ...childrens: MiddleStateWDom[]) => WDom;\ntype FTags = {\n [tagName: string]: FFunction;\n};\n\nexport const fTags: FTags = new Proxy(\n {},\n {\n get(_: {}, tagName: string) {\n return (props?: Props, ...childrens: MiddleStateWDom[]) =>\n h(tagName, props || {}, ...childrens);\n },\n }\n);\n\nexport const FFragment = (props: Props, ...children: MiddleStateWDom[]) => {\n return h(Fragment as FragmentFunction, props, ...children);\n};\n\nexport const fFragment = (...children: MiddleStateWDom[]) => {\n return h(Fragment as FragmentFunction, {}, ...children);\n};\n\nexport const fMount = <T>(component: Component<T>) => {\n const tagFunction = (_props: T, _children: WDom[]) => component;\n\n return (props?: T, ...children: MiddleStateWDom[]) =>\n h(tagFunction as TagFunction, props || {}, children);\n};\n"],"names":["fTags","_","tagName","props","childrens","h","FFragment","children","Fragment","fFragment","fMount","component","tagFunction","_props","_children"],"mappings":";AAeO,MAAMA,IAAe,IAAI;AAAA,EAC9B,CAAC;AAAA,EACD;AAAA,IACE,IAAIC,GAAOC,GAAiB;AACnB,aAAA,CAACC,MAAkBC,MACxBC,EAAEH,GAASC,KAAS,CAAA,GAAI,GAAGC,CAAS;AAAA,IACxC;AAAA,EACF;AACF,GAEaE,IAAY,CAACH,MAAiBI,MAClCF,EAAEG,GAA8BL,GAAO,GAAGI,CAAQ,GAG9CE,IAAY,IAAIF,MACpBF,EAAEG,GAA8B,IAAI,GAAGD,CAAQ,GAG3CG,IAAS,CAAIC,MAA4B;AAC9C,QAAAC,IAAc,CAACC,GAAWC,MAAsBH;AAE/C,SAAA,CAACR,MAAcI,MACpBF,EAAEO,GAA4BT,KAAS,
|
|
1
|
+
{"version":3,"file":"lithentFTags.mjs","sources":["../src/index.ts"],"sourcesContent":["import { h, Fragment } from 'lithent';\nimport type {\n Props,\n WDom,\n FragmentFunction,\n MiddleStateWDom,\n Component,\n TagFunction,\n} from 'lithent';\n\ntype FFunction = (props?: Props, ...childrens: MiddleStateWDom[]) => WDom;\ntype FTags = {\n [tagName: string]: FFunction;\n};\n\nexport const fTags: FTags = new Proxy(\n {},\n {\n get(_: {}, tagName: string) {\n return (props?: Props, ...childrens: MiddleStateWDom[]) =>\n h(tagName, props || {}, ...childrens);\n },\n }\n);\n\nexport const FFragment = (props: Props, ...children: MiddleStateWDom[]) => {\n return h(Fragment as FragmentFunction, props, ...children);\n};\n\nexport const fFragment = (...children: MiddleStateWDom[]) => {\n return h(Fragment as FragmentFunction, {}, ...children);\n};\n\nexport const fMount = <T>(component: Component<T>) => {\n const tagFunction = (_props: T, _children: WDom[]) => component;\n\n return (props?: T, ...children: MiddleStateWDom[]) =>\n h(tagFunction as TagFunction, props || {}, ...children);\n};\n"],"names":["fTags","_","tagName","props","childrens","h","FFragment","children","Fragment","fFragment","fMount","component","tagFunction","_props","_children"],"mappings":";AAeO,MAAMA,IAAe,IAAI;AAAA,EAC9B,CAAC;AAAA,EACD;AAAA,IACE,IAAIC,GAAOC,GAAiB;AACnB,aAAA,CAACC,MAAkBC,MACxBC,EAAEH,GAASC,KAAS,CAAA,GAAI,GAAGC,CAAS;AAAA,IACxC;AAAA,EACF;AACF,GAEaE,IAAY,CAACH,MAAiBI,MAClCF,EAAEG,GAA8BL,GAAO,GAAGI,CAAQ,GAG9CE,IAAY,IAAIF,MACpBF,EAAEG,GAA8B,IAAI,GAAGD,CAAQ,GAG3CG,IAAS,CAAIC,MAA4B;AAC9C,QAAAC,IAAc,CAACC,GAAWC,MAAsBH;AAE/C,SAAA,CAACR,MAAcI,MACpBF,EAAEO,GAA4BT,KAAS,CAAA,GAAI,GAAGI,CAAQ;AAC1D;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("lithent")):typeof define=="function"&&define.amd?define(["exports","lithent"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.lithentFTags={},e.lithent))})(this,function(e,n){"use strict";const u=new Proxy({},{get(t,r){return(o,...f)=>n.h(r,o||{},...f)}}),i=(t,...r)=>n.h(n.Fragment,t,...r),s=(...t)=>n.h(n.Fragment,{},...t),d=t=>{const r=(o,f)=>t;return(o,...f)=>n.h(r,o||{}
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("lithent")):typeof define=="function"&&define.amd?define(["exports","lithent"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.lithentFTags={},e.lithent))})(this,function(e,n){"use strict";const u=new Proxy({},{get(t,r){return(o,...f)=>n.h(r,o||{},...f)}}),i=(t,...r)=>n.h(n.Fragment,t,...r),s=(...t)=>n.h(n.Fragment,{},...t),d=t=>{const r=(o,f)=>t;return(o,...f)=>n.h(r,o||{},...f)};e.FFragment=i,e.fFragment=s,e.fMount=d,e.fTags=u,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=lithentFTags.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lithentFTags.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { h, Fragment } from 'lithent';\nimport type {\n Props,\n WDom,\n FragmentFunction,\n MiddleStateWDom,\n Component,\n TagFunction,\n} from 'lithent';\n\ntype FFunction = (props?: Props, ...childrens: MiddleStateWDom[]) => WDom;\ntype FTags = {\n [tagName: string]: FFunction;\n};\n\nexport const fTags: FTags = new Proxy(\n {},\n {\n get(_: {}, tagName: string) {\n return (props?: Props, ...childrens: MiddleStateWDom[]) =>\n h(tagName, props || {}, ...childrens);\n },\n }\n);\n\nexport const FFragment = (props: Props, ...children: MiddleStateWDom[]) => {\n return h(Fragment as FragmentFunction, props, ...children);\n};\n\nexport const fFragment = (...children: MiddleStateWDom[]) => {\n return h(Fragment as FragmentFunction, {}, ...children);\n};\n\nexport const fMount = <T>(component: Component<T>) => {\n const tagFunction = (_props: T, _children: WDom[]) => component;\n\n return (props?: T, ...children: MiddleStateWDom[]) =>\n h(tagFunction as TagFunction, props || {}, children);\n};\n"],"names":["fTags","_","tagName","props","childrens","h","FFragment","children","Fragment","fFragment","fMount","component","tagFunction","_props","_children"],"mappings":"6QAea,MAAAA,EAAe,IAAI,MAC9B,CAAC,EACD,CACE,IAAIC,EAAOC,EAAiB,CACnB,MAAA,CAACC,KAAkBC,IACxBC,EAAA,EAAEH,EAASC,GAAS,CAAA,EAAI,GAAGC,CAAS,CACxC,CACF,CACF,EAEaE,EAAY,CAACH,KAAiBI,IAClCF,EAAE,EAAAG,EAAA,SAA8BL,EAAO,GAAGI,CAAQ,EAG9CE,EAAY,IAAIF,IACpBF,EAAE,EAAAG,EAAA,SAA8B,GAAI,GAAGD,CAAQ,EAG3CG,EAAaC,GAA4B,CAC9C,MAAAC,EAAc,CAACC,EAAWC,IAAsBH,EAE/C,MAAA,CAACR,KAAcI,IACpBF,
|
|
1
|
+
{"version":3,"file":"lithentFTags.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { h, Fragment } from 'lithent';\nimport type {\n Props,\n WDom,\n FragmentFunction,\n MiddleStateWDom,\n Component,\n TagFunction,\n} from 'lithent';\n\ntype FFunction = (props?: Props, ...childrens: MiddleStateWDom[]) => WDom;\ntype FTags = {\n [tagName: string]: FFunction;\n};\n\nexport const fTags: FTags = new Proxy(\n {},\n {\n get(_: {}, tagName: string) {\n return (props?: Props, ...childrens: MiddleStateWDom[]) =>\n h(tagName, props || {}, ...childrens);\n },\n }\n);\n\nexport const FFragment = (props: Props, ...children: MiddleStateWDom[]) => {\n return h(Fragment as FragmentFunction, props, ...children);\n};\n\nexport const fFragment = (...children: MiddleStateWDom[]) => {\n return h(Fragment as FragmentFunction, {}, ...children);\n};\n\nexport const fMount = <T>(component: Component<T>) => {\n const tagFunction = (_props: T, _children: WDom[]) => component;\n\n return (props?: T, ...children: MiddleStateWDom[]) =>\n h(tagFunction as TagFunction, props || {}, ...children);\n};\n"],"names":["fTags","_","tagName","props","childrens","h","FFragment","children","Fragment","fFragment","fMount","component","tagFunction","_props","_children"],"mappings":"6QAea,MAAAA,EAAe,IAAI,MAC9B,CAAC,EACD,CACE,IAAIC,EAAOC,EAAiB,CACnB,MAAA,CAACC,KAAkBC,IACxBC,EAAA,EAAEH,EAASC,GAAS,CAAA,EAAI,GAAGC,CAAS,CACxC,CACF,CACF,EAEaE,EAAY,CAACH,KAAiBI,IAClCF,EAAE,EAAAG,EAAA,SAA8BL,EAAO,GAAGI,CAAQ,EAG9CE,EAAY,IAAIF,IACpBF,EAAE,EAAAG,EAAA,SAA8B,GAAI,GAAGD,CAAQ,EAG3CG,EAAaC,GAA4B,CAC9C,MAAAC,EAAc,CAACC,EAAWC,IAAsBH,EAE/C,MAAA,CAACR,KAAcI,IACpBF,EAAA,EAAEO,EAA4BT,GAAS,CAAA,EAAI,GAAGI,CAAQ,CAC1D"}
|
package/ftags/src/index.ts
CHANGED
|
@@ -35,5 +35,5 @@ export const fMount = <T>(component: Component<T>) => {
|
|
|
35
35
|
const tagFunction = (_props: T, _children: WDom[]) => component;
|
|
36
36
|
|
|
37
37
|
return (props?: T, ...children: MiddleStateWDom[]) =>
|
|
38
|
-
h(tagFunction as TagFunction, props || {}, children);
|
|
38
|
+
h(tagFunction as TagFunction, props || {}, ...children);
|
|
39
39
|
};
|
package/package.json
CHANGED
package/src/tests/ftag.tsx
CHANGED
|
@@ -28,7 +28,7 @@ const fMount = <T,>(component: Component<T>) => {
|
|
|
28
28
|
const tagFunction = (_props: T, _children: WDom[]) => component;
|
|
29
29
|
|
|
30
30
|
return (props?: T, ...children: MiddleStateWDom[]) =>
|
|
31
|
-
h(tagFunction as TagFunction, props || {}, children);
|
|
31
|
+
h(tagFunction as TagFunction, props || {}, ...children);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const fFragment = (...children: MiddleStateWDom[]) => {
|
|
@@ -41,7 +41,7 @@ const fTagComponent = fMount<{ a: number }>((_r, props, children) => {
|
|
|
41
41
|
return () =>
|
|
42
42
|
fFragment(
|
|
43
43
|
'first inner',
|
|
44
|
-
div({ style:
|
|
44
|
+
div({ style: { border: '1px solid red' } }, 'second inner'),
|
|
45
45
|
props.a,
|
|
46
46
|
...children
|
|
47
47
|
);
|
|
@@ -50,7 +50,7 @@ const fTagComponent = fMount<{ a: number }>((_r, props, children) => {
|
|
|
50
50
|
render(
|
|
51
51
|
fTagComponent(
|
|
52
52
|
{ a: 3 },
|
|
53
|
-
div({ style:
|
|
53
|
+
div({ style: { border: '1px solid green' } }, `Fchildren1`),
|
|
54
54
|
'Fchildren2',
|
|
55
55
|
br(),
|
|
56
56
|
section(
|