lithent 1.10.0 → 1.10.2

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.
Files changed (37) hide show
  1. package/README.md +21 -17
  2. package/package.json +16 -18
  3. package/src/tests/loop.tsx +0 -33
  4. package/src/tests/nested.tsx +0 -44
  5. package/src/tests/selectbox.tsx +0 -42
  6. package/src/tests/svg.tsx +0 -44
  7. /package/src/tests/{callback.tsx → core-callback.tsx} +0 -0
  8. /package/src/tests/{test10.tsx → core-checkbox.tsx} +0 -0
  9. /package/src/tests/{test13-2.tsx → core-complexRootFragment.tsx} +0 -0
  10. /package/src/tests/{destroy.tsx → core-destroy.tsx} +0 -0
  11. /package/src/tests/{test16.tsx → core-destroyForLoop.tsx} +0 -0
  12. /package/src/tests/{fragment.tsx → core-fragment.tsx} +0 -0
  13. /package/src/tests/{hoc.tsx → core-hoc.tsx} +0 -0
  14. /package/src/tests/{test7.tsx → core-innerhtml.tsx} +0 -0
  15. /package/src/tests/{test9.tsx → core-input.tsx} +0 -0
  16. /package/src/tests/{insert.tsx → core-insert.tsx} +0 -0
  17. /package/src/tests/{loop2.tsx → core-loop.tsx} +0 -0
  18. /package/src/tests/{loopWithoutKey.tsx → core-loopWithoutKey.tsx} +0 -0
  19. /package/src/tests/{test6.tsx → core-loopkey.tsx} +0 -0
  20. /package/src/tests/{test12.tsx → core-mixedComponentUpdate.tsx} +0 -0
  21. /package/src/tests/{test5.tsx → core-nested.tsx} +0 -0
  22. /package/src/tests/{test14.tsx → core-nestedUnmount.tsx} +0 -0
  23. /package/src/tests/{test11.tsx → core-radio.tsx} +0 -0
  24. /package/src/tests/{renew.tsx → core-renew.tsx} +0 -0
  25. /package/src/tests/{renewEventTest.tsx → core-renewEventTest.tsx} +0 -0
  26. /package/src/tests/{test13.tsx → core-rootFragmentUpdate.tsx} +0 -0
  27. /package/src/tests/{test8.tsx → core-selectbox.tsx} +0 -0
  28. /package/src/tests/{test17.tsx → core-svg.tsx} +0 -0
  29. /package/src/tests/{textarea.tsx → core-textarea.tsx} +0 -0
  30. /package/src/tests/{test15.tsx → core-thrillProps.tsx} +0 -0
  31. /package/src/tests/{unmount.tsx → core-unmount.tsx} +0 -0
  32. /package/src/tests/{test18.tsx → helper-cacheupdate.tsx} +0 -0
  33. /package/src/tests/{test1.tsx → helper-computed.tsx} +0 -0
  34. /package/src/tests/{test4.tsx → helper-effect.tsx} +0 -0
  35. /package/src/tests/{test3.tsx → helper-store.tsx} +0 -0
  36. /package/src/tests/{test2.tsx → helper-store2.tsx} +0 -0
  37. /package/src/tests/{storeObserver.tsx → helper-storeObserver.tsx} +0 -0
package/README.md CHANGED
@@ -1,11 +1,15 @@
1
- # ➿ lithent
1
+
2
+ ## ➿ lithent
3
+ > An extensible JSX-based virtual DOM library for lightweight use in a variety of environments.
2
4
 
3
5
  ![npm](https://img.shields.io/npm/v/lithent)
4
6
  ![npm bundle size](https://img.shields.io/bundlephobia/minzip/lithent)
5
7
  ![npm](https://img.shields.io/npm/dt/lithent)
6
8
  ![NPM](https://img.shields.io/npm/l/lithent)
7
9
 
8
- > An extensible JSX-based virtual DOM library for lightweight use in a variety of environments.
10
+ ![lithent-text](https://github.com/user-attachments/assets/a8848484-d315-4f81-be3b-61490d2be2b9)
11
+
12
+
9
13
 
10
14
  - [Manual](https://medium.com/p/13d6fe6d3330)
11
15
  - [Korean Manual](https://medium.com/@superlucky84/lithent-전체-기능-설명서-3cfab04c0722)
@@ -72,14 +76,14 @@ pnpm add lithent
72
76
 
73
77
  #### Or Use CDN
74
78
 
75
- * UMD : https://cdn.jsdelivr.net/npm/lithent@1.10.0/dist/lithent.umd.js
76
- * UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.10.0/helper/dist/lithentHelper.umd.js
77
- * UMD-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.10.0/ftags/dist/lithentFTags.umd.js
78
- * UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.10.0/tag/dist/lithentTag.umd.js
79
- * ESM : https://cdn.jsdelivr.net/npm/lithent@1.10.0/dist/lithent.mjs
80
- * ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.10.0/helper/dist/lithentHelper.mjs
81
- * ESM-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.10.0/ftags/dist/lithentFTags.mjs
82
- * ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.10.0/tag/dist/lithentTag.mjs
79
+ * UMD : https://cdn.jsdelivr.net/npm/lithent@1.10.2/dist/lithent.umd.js
80
+ * UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.10.2/helper/dist/lithentHelper.umd.js
81
+ * UMD-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.10.2/ftags/dist/lithentFTags.umd.js
82
+ * UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.10.2/tag/dist/lithentTag.umd.js
83
+ * ESM : https://cdn.jsdelivr.net/npm/lithent@1.10.2/dist/lithent.mjs
84
+ * ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.10.2/helper/dist/lithentHelper.mjs
85
+ * ESM-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.10.2/ftags/dist/lithentFTags.mjs
86
+ * ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.10.2/tag/dist/lithentTag.mjs
83
87
 
84
88
 
85
89
  It's easier to use lithent with JSX or HTM.
@@ -104,9 +108,9 @@ import { fTags, fFragment, fMount } from 'lithent/ftags';
104
108
  const { section, div, p, br, strong } = fTags;
105
109
 
106
110
  /* UMD
107
- <script src="https://cdn.jsdelivr.net/npm/lithent@1.10.0/dist/lithent.umd.js"></script>
108
- <script src="https://cdn.jsdelivr.net/npm/lithent@1.10.0/helper/dist/lithentHelper.umd.js"></script>
109
- <script src="https://cdn.jsdelivr.net/npm/lithent@1.10.0/ftags/dist/lithentFTags.umd.js"></script>
111
+ <script src="https://cdn.jsdelivr.net/npm/lithent@1.10.2/dist/lithent.umd.js"></script>
112
+ <script src="https://cdn.jsdelivr.net/npm/lithent@1.10.2/helper/dist/lithentHelper.umd.js"></script>
113
+ <script src="https://cdn.jsdelivr.net/npm/lithent@1.10.2/ftags/dist/lithentFTags.umd.js"></script>
110
114
 
111
115
  const { render } = lithent;
112
116
  const { fTags, fMount, fFragment } = lithentFTags;
@@ -178,10 +182,10 @@ const destroy = render(lTag`<${Component} />`, document.getElementById('root'),
178
182
  #### With UMD
179
183
 
180
184
  ```html
181
- <script src="https://cdn.jsdelivr.net/npm/lithent@1.10.0/dist/lithent.umd.js"></script>
182
- <!--script src="https://cdn.jsdelivr.net/npm/lithent@1.10.0/helper/dist/lithentHelper.umd.js"></script-->
183
- <script src="https://cdn.jsdelivr.net/npm/lithent@1.10.0/tag/dist/lithentTag.umd.js"></script>
184
- <!--script src="https://cdn.jsdelivr.net/npm/lithent@1.10.0/ftags/dist/lithentFTags.umd.js"></script-->
185
+ <script src="https://cdn.jsdelivr.net/npm/lithent@1.10.2/dist/lithent.umd.js"></script>
186
+ <!--script src="https://cdn.jsdelivr.net/npm/lithent@1.10.2/helper/dist/lithentHelper.umd.js"></script-->
187
+ <script src="https://cdn.jsdelivr.net/npm/lithent@1.10.2/tag/dist/lithentTag.umd.js"></script>
188
+ <!--script src="https://cdn.jsdelivr.net/npm/lithent@1.10.2/ftags/dist/lithentFTags.umd.js"></script-->
185
189
 
186
190
  <div id="root"></div>
187
191
 
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lithent",
4
- "version": "1.10.0",
4
+ "version": "1.10.2",
5
5
  "description": "An extensible virtual DOM library for lightweight use in a variety of environments.",
6
6
  "packageManager": "pnpm@7.6.0",
7
7
  "main": "./dist/lithent.umd.js",
8
8
  "module": "./dist/lithent.mjs",
9
9
  "scripts": {
10
10
  "dev:core": "vite",
11
- "dev:examples": "pnpm --filter lithent-examples dev",
11
+ "dev": "vite",
12
+ "dev:examples": "pnpm watch:core & pnpm watch:helper & pnpm --filter lithent-examples dev",
13
+ "dev:docs": "pnpm watch:core & pnpm watch:helper & pnpm --filter lithent-docs dev",
12
14
  "build:core": "vite build",
13
15
  "build:helper": "pnpm --filter lithent-helper build",
14
16
  "build:tag": "pnpm --filter lithent-tag build",
@@ -19,14 +21,12 @@
19
21
  "watch:helper": "pnpm --filter lithent-helper watch",
20
22
  "build": "pnpm build:core && pnpm build:helper && pnpm build:ftags && pnpm build:tag && pnpm build:examples && pnpm build:docs",
21
23
  "build:p": "pnpm build:core && pnpm -r build",
22
- "dev": "pnpm watch:core & pnpm watch:helper & pnpm dev:examples",
23
24
  "test": "vitest run --reporter verbose",
24
25
  "test:dev": "vitest",
25
26
  "coverage": "vitest run --coverage",
26
27
  "clean": "pnpm clean:dist && pnpm clean:module",
27
28
  "clean:dist": "pnpm -r exec rm -rf dist && rm -rf dist",
28
- "clean:module": "pnpm -r exec rm -rf dist node_modules && rm -rf node_modules",
29
- "dev:docs": "pnpm watch:core & pnpm watch:helper & pnpm --filter lithent-docs dev"
29
+ "clean:module": "pnpm -r exec rm -rf dist node_modules && rm -rf node_modules"
30
30
  },
31
31
  "exports": {
32
32
  ".": {
@@ -78,26 +78,24 @@
78
78
  "lithent"
79
79
  ],
80
80
  "devDependencies": {
81
- "@typescript-eslint/eslint-plugin": "^5.30.7",
82
- "@typescript-eslint/parser": "^5.30.7",
81
+ "@typescript-eslint/eslint-plugin": "^5.60.0",
82
+ "@typescript-eslint/parser": "^5.60.0",
83
+ "@vitest/coverage-v8": "^1.6.0",
83
84
  "eslint": "^7.32.0",
84
- "eslint-config-prettier": "^8.3.0",
85
- "eslint-plugin-prettier": "^4.0.0",
85
+ "eslint-config-prettier": "^8.8.0",
86
+ "eslint-plugin-prettier": "^4.2.1",
86
87
  "happy-dom": "^9.20.3",
87
88
  "jsdom": "^22.1.0",
88
- "prettier": "^2.3.2",
89
- "terser": "^5.17.7",
90
- "typescript": "^4.7.4",
89
+ "prettier": "^2.8.8",
90
+ "terser": "^5.18.1",
91
+ "typescript": "^4.9.5",
91
92
  "vite": "^5.2.0",
92
93
  "vite-plugin-checker": "^0.6.1",
93
- "vite-plugin-dts": "^2.3.0"
94
+ "vite-plugin-dts": "^2.3.0",
95
+ "vite-plugin-eslint": "^1.8.1",
96
+ "vitest": "^1.6.0"
94
97
  },
95
98
  "volta": {
96
99
  "node": "20.3.0"
97
- },
98
- "dependencies": {
99
- "@vitest/coverage-v8": "^1.6.0",
100
- "vite-plugin-eslint": "^1.8.1",
101
- "vitest": "^1.6.0"
102
100
  }
103
101
  }
@@ -1,33 +0,0 @@
1
- import { mount, render, Fragment, h } from '@/index';
2
-
3
- const Loop = mount(function (renew) {
4
- let list: { key: number; value: string }[] = [
5
- { key: 1, value: '일' },
6
- { key: 2, value: '이' },
7
- { key: 3, value: '삼' },
8
- { key: 4, value: '사' },
9
- ];
10
- const handle = () => {
11
- list = [
12
- { key: 3, value: '삼삼' },
13
- { key: 2, value: '이이' },
14
- ];
15
- renew();
16
- };
17
-
18
- return () => (
19
- <Fragment>
20
- <button onClick={handle}>handle</button>
21
- {list.map(item => (
22
- <div key={item.key}>{item.value}</div>
23
- ))}
24
- </Fragment>
25
- );
26
- });
27
-
28
- const Root = <Loop />;
29
-
30
- //@ts-ignore
31
- window.root = Root;
32
-
33
- render(Root, document.getElementById('root'));
@@ -1,44 +0,0 @@
1
- import { h, Fragment, mount, render } from '@/index';
2
-
3
- const Nested = mount(function (renew) {
4
- let choiceNode = 7;
5
-
6
- const handle = () => {
7
- const randomValue = Math.floor(Math.random() * 10) + 1;
8
- choiceNode = randomValue;
9
- renew();
10
- };
11
-
12
- const componentMaker = () => {
13
- return (
14
- <Fragment>
15
- <button onClick={handle}>handle</button>
16
- {choiceNode === 1 && <div>1</div>}
17
- {choiceNode === 2 && <div>2</div>}
18
- <Fragment>
19
- {choiceNode === 3 && <div>3</div>}
20
- {choiceNode === 4 && <div>4</div>}
21
- <Fragment>
22
- {choiceNode === 5 && <div>5</div>}
23
- {choiceNode === 6 && <div>6</div>}
24
- <div>6.5</div>
25
- {choiceNode === 7 && <div>7</div>}
26
- </Fragment>
27
- {choiceNode === 8 && <div>8</div>}
28
- {choiceNode === 9 && <div>9</div>}
29
- </Fragment>
30
- {choiceNode === 10 && <div>10</div>}
31
- <div>11</div>
32
- </Fragment>
33
- );
34
- };
35
-
36
- return componentMaker;
37
- });
38
-
39
- const Root = <Nested />;
40
-
41
- //@ts-ignore
42
- window.root = Root;
43
-
44
- render(Root, document.getElementById('root'));
@@ -1,42 +0,0 @@
1
- // example.jsx
2
- import { h, render, Fragment, mount } from '@/index';
3
-
4
- const Selectbox = mount(renew => {
5
- let value = '3';
6
-
7
- const changeChange = (event: InputEvent) => {
8
- value = (event.target as HTMLInputElement).value;
9
- renew();
10
- };
11
-
12
- return () => (
13
- <Fragment>
14
- <div>{value}</div>
15
- <div>
16
- <select onChange={changeChange}>
17
- <option value="1" selected={value === '1'}>
18
- 1
19
- </option>
20
- <option value="2" selected={value === '2'}>
21
- 2
22
- </option>
23
- <option value="3" selected={value === '3'}>
24
- 3
25
- </option>
26
- <option value="4" selected={value === '4'}>
27
- 4
28
- </option>
29
- <option value="5" selected={value === '5'}>
30
- 5
31
- </option>
32
- </select>
33
- </div>
34
- </Fragment>
35
- );
36
- });
37
- const Root = <Selectbox />;
38
-
39
- //@ts-ignore
40
- window.root = Root;
41
-
42
- render(Root, document.getElementById('root'));
package/src/tests/svg.tsx DELETED
@@ -1,44 +0,0 @@
1
- import { mount, render, Fragment, h } from '@/index';
2
-
3
- const Svg = mount(() => {
4
- return () => (
5
- <Fragment>
6
- <svg
7
- id="toggleSidebarMobileHamburger"
8
- class="w-6 h-6"
9
- fill="currentColor"
10
- viewBox="0 0 20 20"
11
- xmlns="http://www.w3.org/2000/svg"
12
- >
13
- <path
14
- fill-rule="evenodd"
15
- d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
16
- clip-rule="evenodd"
17
- ></path>
18
- <path
19
- fill-rule="evenodd"
20
- d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
21
- clip-rule="evenodd"
22
- ></path>
23
- </svg>
24
- <div>
25
- <p>test</p>
26
- </div>
27
- <svg
28
- id="toggleSidebarMobileClose"
29
- class="hidden w-6 h-6"
30
- fill="currentColor"
31
- viewBox="0 0 20 20"
32
- xmlns="http://www.w3.org/2000/svg"
33
- >
34
- <path
35
- fill-rule="evenodd"
36
- d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
37
- clip-rule="evenodd"
38
- ></path>
39
- </svg>
40
- </Fragment>
41
- );
42
- });
43
-
44
- render(<Svg />, document.getElementById('root'));
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes