@ktjs/core 0.10.2 → 0.11.0

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/index.d.ts CHANGED
@@ -27,7 +27,7 @@ interface KTRef<T> {
27
27
  */
28
28
  declare function ktref<T = HTMLElement>(value?: T): KTRef<T>;
29
29
 
30
- type KTAvailableContent = KTRef<any> | HTMLElement | string | number | undefined;
30
+ type KTAvailableContent = KTRef<any> | HTMLElement | Element | string | number | boolean | null | undefined;
31
31
  type KTRawContent =
32
32
  | KTAvailableContent[]
33
33
  | KTAvailableContent
@@ -80,6 +80,9 @@ interface KTBaseAttribute {
80
80
  for?: string;
81
81
 
82
82
  name?: string;
83
+ title?: string;
84
+ placeholder?: string;
85
+ contenteditable?: boolean;
83
86
  value?: string;
84
87
  valueAsDate?: Date;
85
88
  valueAsNumber?: number;
@@ -107,7 +110,8 @@ type KTComponent = (
107
110
  props: {
108
111
  ref?: KTRef<HTMLElement>;
109
112
  children?: KTRawContent;
110
- } & KTAttribute
113
+ } & KTAttribute &
114
+ any
111
115
  ) => HTMLElement | Promise<HTMLElement>;
112
116
 
113
117
  type HTML<T extends HTMLTag & otherstring> = T extends HTMLTag ? HTMLElementTagNameMap[T] : HTMLElement;
@@ -125,12 +129,12 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
125
129
  * ## About
126
130
  * @package @ktjs/core
127
131
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
128
- * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
132
+ * @version 0.11.0 (Last Update: 2026.01.14 15:06:22.073)
129
133
  * @license MIT
130
134
  * @link https://github.com/baendlorel/kt.js
131
135
  * @link https://baendlorel.github.io/ Welcome to my site!
132
136
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
133
- * @copyright Copyright (c) 2025 Kasukabe Tsumugi. All rights reserved.
137
+ * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
134
138
  */
135
139
  declare const h: H;
136
140
 
@@ -176,11 +180,15 @@ declare global {
176
180
  }
177
181
  }
178
182
 
179
- declare function KTAsync(props: {
183
+ /**
184
+ * Extract component props type (excluding ref and children)
185
+ */
186
+ type ExtractComponentProps<T> = T extends (props: infer P) => any ? Omit<P, 'ref' | 'children'> : {};
187
+ declare function KTAsync<T extends KTComponent>(props: {
180
188
  ref?: KTRef<HTMLElement>;
181
- component: KTComponent;
189
+ component: T;
182
190
  children?: KTRawContent;
183
- }): HTMLElement;
191
+ } & ExtractComponentProps<T>): HTMLElement;
184
192
 
185
193
  export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs, ktref };
186
194
  export type { EventHandler, HTMLTag, KTAttribute, KTRawAttr, KTRawContent, KTRawContents, KTRef, KTRuntime };
@@ -170,6 +170,10 @@ var __ktjs_core__ = (function (exports) {
170
170
  }
171
171
 
172
172
  function apdSingle(element, c) {
173
+ // & JSX should ignore false, undefined, and null
174
+ if (c === false || c === undefined || c === null) {
175
+ return;
176
+ }
173
177
  if (typeof c === 'object' && c !== null && 'isKT' in c) {
174
178
  $append.call(element, c.value);
175
179
  }
@@ -221,12 +225,12 @@ var __ktjs_core__ = (function (exports) {
221
225
  * ## About
222
226
  * @package @ktjs/core
223
227
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
224
- * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
228
+ * @version 0.11.0 (Last Update: 2026.01.14 15:06:22.073)
225
229
  * @license MIT
226
230
  * @link https://github.com/baendlorel/kt.js
227
231
  * @link https://baendlorel.github.io/ Welcome to my site!
228
232
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
229
- * @copyright Copyright (c) 2025 Kasukabe Tsumugi. All rights reserved.
233
+ * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
230
234
  */
231
235
  const h = ((tag, attr = '', content = '') => {
232
236
  if (typeof tag !== 'string') {
@@ -183,6 +183,10 @@ var __ktjs_core__ = (function (exports) {
183
183
  }
184
184
 
185
185
  function apdSingle(element, c) {
186
+ // & JSX should ignore false, undefined, and null
187
+ if (c === false || c === undefined || c === null) {
188
+ return;
189
+ }
186
190
  if (typeof c === 'object' && c !== null && 'isKT' in c) {
187
191
  $append.call(element, c.value);
188
192
  }
@@ -237,12 +241,12 @@ var __ktjs_core__ = (function (exports) {
237
241
  * ## About
238
242
  * @package @ktjs/core
239
243
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
240
- * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
244
+ * @version 0.11.0 (Last Update: 2026.01.14 15:06:22.073)
241
245
  * @license MIT
242
246
  * @link https://github.com/baendlorel/kt.js
243
247
  * @link https://baendlorel.github.io/ Welcome to my site!
244
248
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
245
- * @copyright Copyright (c) 2025 Kasukabe Tsumugi. All rights reserved.
249
+ * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
246
250
  */
247
251
  var h = (function (tag, attr, content) {
248
252
  if (attr === void 0) { attr = ''; }
package/dist/index.mjs CHANGED
@@ -167,6 +167,10 @@ function applyAttr(element, attr) {
167
167
  }
168
168
 
169
169
  function apdSingle(element, c) {
170
+ // & JSX should ignore false, undefined, and null
171
+ if (c === false || c === undefined || c === null) {
172
+ return;
173
+ }
170
174
  if (typeof c === 'object' && c !== null && 'isKT' in c) {
171
175
  $append.call(element, c.value);
172
176
  }
@@ -218,12 +222,12 @@ function applyContent(element, content) {
218
222
  * ## About
219
223
  * @package @ktjs/core
220
224
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
221
- * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
225
+ * @version 0.11.0 (Last Update: 2026.01.14 15:06:22.073)
222
226
  * @license MIT
223
227
  * @link https://github.com/baendlorel/kt.js
224
228
  * @link https://baendlorel.github.io/ Welcome to my site!
225
229
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
226
- * @copyright Copyright (c) 2025 Kasukabe Tsumugi. All rights reserved.
230
+ * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
227
231
  */
228
232
  const h = ((tag, attr = '', content = '') => {
229
233
  if (typeof tag !== 'string') {
@@ -16,7 +16,7 @@ interface KTRef<T> {
16
16
  */
17
17
  declare function ktref<T = HTMLElement>(value?: T): KTRef<T>;
18
18
 
19
- type KTAvailableContent = KTRef<any> | HTMLElement | string | number | undefined;
19
+ type KTAvailableContent = KTRef<any> | HTMLElement | Element | string | number | boolean | null | undefined;
20
20
  type KTRawContent =
21
21
  | KTAvailableContent[]
22
22
  | KTAvailableContent
@@ -63,6 +63,9 @@ interface KTBaseAttribute {
63
63
  for?: string;
64
64
 
65
65
  name?: string;
66
+ title?: string;
67
+ placeholder?: string;
68
+ contenteditable?: boolean;
66
69
  value?: string;
67
70
  valueAsDate?: Date;
68
71
  valueAsNumber?: number;
@@ -101,12 +104,12 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
101
104
  * ## About
102
105
  * @package @ktjs/core
103
106
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
104
- * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
107
+ * @version 0.11.0 (Last Update: 2026.01.14 15:06:22.073)
105
108
  * @license MIT
106
109
  * @link https://github.com/baendlorel/kt.js
107
110
  * @link https://baendlorel.github.io/ Welcome to my site!
108
111
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
109
- * @copyright Copyright (c) 2025 Kasukabe Tsumugi. All rights reserved.
112
+ * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
110
113
  */
111
114
  declare const h: H;
112
115
 
@@ -150,6 +150,10 @@ function applyAttr(element, attr) {
150
150
  }
151
151
 
152
152
  function apdSingle(element, c) {
153
+ // & JSX should ignore false, undefined, and null
154
+ if (c === false || c === undefined || c === null) {
155
+ return;
156
+ }
153
157
  if (typeof c === 'object' && c !== null && 'isKT' in c) {
154
158
  $append.call(element, c.value);
155
159
  }
@@ -201,12 +205,12 @@ function applyContent(element, content) {
201
205
  * ## About
202
206
  * @package @ktjs/core
203
207
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
204
- * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
208
+ * @version 0.11.0 (Last Update: 2026.01.14 15:06:22.073)
205
209
  * @license MIT
206
210
  * @link https://github.com/baendlorel/kt.js
207
211
  * @link https://baendlorel.github.io/ Welcome to my site!
208
212
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
209
- * @copyright Copyright (c) 2025 Kasukabe Tsumugi. All rights reserved.
213
+ * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
210
214
  */
211
215
  const h = ((tag, attr = '', content = '') => {
212
216
  if (typeof tag !== 'string') {
@@ -10,7 +10,7 @@ interface KTRef<T> {
10
10
  isKT: true;
11
11
  }
12
12
 
13
- type KTAvailableContent = KTRef<any> | HTMLElement | string | number | undefined;
13
+ type KTAvailableContent = KTRef<any> | HTMLElement | Element | string | number | boolean | null | undefined;
14
14
  type KTRawContent =
15
15
  | KTAvailableContent[]
16
16
  | KTAvailableContent
@@ -57,6 +57,9 @@ interface KTBaseAttribute {
57
57
  for?: string;
58
58
 
59
59
  name?: string;
60
+ title?: string;
61
+ placeholder?: string;
62
+ contenteditable?: boolean;
60
63
  value?: string;
61
64
  valueAsDate?: Date;
62
65
  valueAsNumber?: number;
@@ -95,12 +98,12 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
95
98
  * ## About
96
99
  * @package @ktjs/core
97
100
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
98
- * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
101
+ * @version 0.11.0 (Last Update: 2026.01.14 15:06:22.073)
99
102
  * @license MIT
100
103
  * @link https://github.com/baendlorel/kt.js
101
104
  * @link https://baendlorel.github.io/ Welcome to my site!
102
105
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
103
- * @copyright Copyright (c) 2025 Kasukabe Tsumugi. All rights reserved.
106
+ * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
104
107
  */
105
108
  declare const h: H;
106
109
 
@@ -150,6 +150,10 @@ function applyAttr(element, attr) {
150
150
  }
151
151
 
152
152
  function apdSingle(element, c) {
153
+ // & JSX should ignore false, undefined, and null
154
+ if (c === false || c === undefined || c === null) {
155
+ return;
156
+ }
153
157
  if (typeof c === 'object' && c !== null && 'isKT' in c) {
154
158
  $append.call(element, c.value);
155
159
  }
@@ -201,12 +205,12 @@ function applyContent(element, content) {
201
205
  * ## About
202
206
  * @package @ktjs/core
203
207
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
204
- * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
208
+ * @version 0.11.0 (Last Update: 2026.01.14 15:06:22.073)
205
209
  * @license MIT
206
210
  * @link https://github.com/baendlorel/kt.js
207
211
  * @link https://baendlorel.github.io/ Welcome to my site!
208
212
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
209
- * @copyright Copyright (c) 2025 Kasukabe Tsumugi. All rights reserved.
213
+ * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
210
214
  */
211
215
  const h = ((tag, attr = '', content = '') => {
212
216
  if (typeof tag !== 'string') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ktjs/core",
3
- "version": "0.10.2",
3
+ "version": "0.11.0",
4
4
  "description": "Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",