@ktjs/core 0.10.1 → 0.10.3

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
@@ -47,6 +47,8 @@ type EventHandler<T extends Event = Event> = (this: HTMLElement, ev: T) => any;
47
47
  interface KTBaseAttribute {
48
48
  [k: string]: any;
49
49
 
50
+ ref?: KTRef<HTMLElement>;
51
+
50
52
  id?: string;
51
53
  class?: string;
52
54
  style?: string | Partial<CSSStyleDeclaration>;
@@ -78,6 +80,9 @@ interface KTBaseAttribute {
78
80
  for?: string;
79
81
 
80
82
  name?: string;
83
+ title?: string;
84
+ placeholder?: string;
85
+ contenteditable?: boolean;
81
86
  value?: string;
82
87
  valueAsDate?: Date;
83
88
  valueAsNumber?: number;
@@ -105,7 +110,8 @@ type KTComponent = (
105
110
  props: {
106
111
  ref?: KTRef<HTMLElement>;
107
112
  children?: KTRawContent;
108
- } & KTAttribute
113
+ } & KTAttribute &
114
+ any
109
115
  ) => HTMLElement | Promise<HTMLElement>;
110
116
 
111
117
  type HTML<T extends HTMLTag & otherstring> = T extends HTMLTag ? HTMLElementTagNameMap[T] : HTMLElement;
@@ -123,7 +129,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
123
129
  * ## About
124
130
  * @package @ktjs/core
125
131
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
126
- * @version 0.10.1 (Last Update: 2025.12.30 14:45:59.803)
132
+ * @version 0.10.3 (Last Update: 2025.12.31 15:05:46.905)
127
133
  * @license MIT
128
134
  * @link https://github.com/baendlorel/kt.js
129
135
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -174,11 +180,15 @@ declare global {
174
180
  }
175
181
  }
176
182
 
177
- 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: {
178
188
  ref?: KTRef<HTMLElement>;
179
- component: KTComponent;
189
+ component: T;
180
190
  children?: KTRawContent;
181
- }): HTMLElement;
191
+ } & ExtractComponentProps<T>): HTMLElement;
182
192
 
183
193
  export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs, ktref };
184
194
  export type { EventHandler, HTMLTag, KTAttribute, KTRawAttr, KTRawContent, KTRawContents, KTRef, KTRuntime };
@@ -221,7 +221,7 @@ var __ktjs_core__ = (function (exports) {
221
221
  * ## About
222
222
  * @package @ktjs/core
223
223
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
224
- * @version 0.10.1 (Last Update: 2025.12.30 14:45:59.803)
224
+ * @version 0.10.3 (Last Update: 2025.12.31 15:05:46.905)
225
225
  * @license MIT
226
226
  * @link https://github.com/baendlorel/kt.js
227
227
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -261,7 +261,7 @@ var __ktjs_core__ = (function (exports) {
261
261
  const children = propObj.children;
262
262
  delete propObj.children;
263
263
  // deal with ref attribute
264
- const ref = propObj.ref?.isRef ? propObj.ref : null;
264
+ const ref = propObj.ref?.isKT ? propObj.ref : null;
265
265
  if (ref) {
266
266
  delete propObj.ref;
267
267
  }
@@ -237,7 +237,7 @@ var __ktjs_core__ = (function (exports) {
237
237
  * ## About
238
238
  * @package @ktjs/core
239
239
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
240
- * @version 0.10.1 (Last Update: 2025.12.30 14:45:59.803)
240
+ * @version 0.10.3 (Last Update: 2025.12.31 15:05:46.905)
241
241
  * @license MIT
242
242
  * @link https://github.com/baendlorel/kt.js
243
243
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -313,7 +313,7 @@ var __ktjs_core__ = (function (exports) {
313
313
  var children = propObj.children;
314
314
  delete propObj.children;
315
315
  // deal with ref attribute
316
- var ref = ((_a = propObj.ref) === null || _a === void 0 ? void 0 : _a.isRef) ? propObj.ref : null;
316
+ var ref = ((_a = propObj.ref) === null || _a === void 0 ? void 0 : _a.isKT) ? propObj.ref : null;
317
317
  if (ref) {
318
318
  delete propObj.ref;
319
319
  }
package/dist/index.mjs CHANGED
@@ -218,7 +218,7 @@ function applyContent(element, content) {
218
218
  * ## About
219
219
  * @package @ktjs/core
220
220
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
221
- * @version 0.10.1 (Last Update: 2025.12.30 14:45:59.803)
221
+ * @version 0.10.3 (Last Update: 2025.12.31 15:05:46.905)
222
222
  * @license MIT
223
223
  * @link https://github.com/baendlorel/kt.js
224
224
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -258,7 +258,7 @@ function jsx(tag, props, ..._metadata) {
258
258
  const children = propObj.children;
259
259
  delete propObj.children;
260
260
  // deal with ref attribute
261
- const ref = propObj.ref?.isRef ? propObj.ref : null;
261
+ const ref = propObj.ref?.isKT ? propObj.ref : null;
262
262
  if (ref) {
263
263
  delete propObj.ref;
264
264
  }
@@ -30,6 +30,8 @@ type KTRawAttr = KTAttribute | string;
30
30
  interface KTBaseAttribute {
31
31
  [k: string]: any;
32
32
 
33
+ ref?: KTRef<HTMLElement>;
34
+
33
35
  id?: string;
34
36
  class?: string;
35
37
  style?: string | Partial<CSSStyleDeclaration>;
@@ -61,6 +63,9 @@ interface KTBaseAttribute {
61
63
  for?: string;
62
64
 
63
65
  name?: string;
66
+ title?: string;
67
+ placeholder?: string;
68
+ contenteditable?: boolean;
64
69
  value?: string;
65
70
  valueAsDate?: Date;
66
71
  valueAsNumber?: number;
@@ -99,7 +104,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
99
104
  * ## About
100
105
  * @package @ktjs/core
101
106
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
102
- * @version 0.10.1 (Last Update: 2025.12.30 14:45:59.803)
107
+ * @version 0.10.3 (Last Update: 2025.12.31 15:05:46.905)
103
108
  * @license MIT
104
109
  * @link https://github.com/baendlorel/kt.js
105
110
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -201,7 +201,7 @@ function applyContent(element, content) {
201
201
  * ## About
202
202
  * @package @ktjs/core
203
203
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
204
- * @version 0.10.1 (Last Update: 2025.12.30 14:45:59.803)
204
+ * @version 0.10.3 (Last Update: 2025.12.31 15:05:46.905)
205
205
  * @license MIT
206
206
  * @link https://github.com/baendlorel/kt.js
207
207
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -241,7 +241,7 @@ function jsx(tag, props, ..._metadata) {
241
241
  const children = propObj.children;
242
242
  delete propObj.children;
243
243
  // deal with ref attribute
244
- const ref = propObj.ref?.isRef ? propObj.ref : null;
244
+ const ref = propObj.ref?.isKT ? propObj.ref : null;
245
245
  if (ref) {
246
246
  delete propObj.ref;
247
247
  }
@@ -24,6 +24,8 @@ type KTRawAttr = KTAttribute | string;
24
24
  interface KTBaseAttribute {
25
25
  [k: string]: any;
26
26
 
27
+ ref?: KTRef<HTMLElement>;
28
+
27
29
  id?: string;
28
30
  class?: string;
29
31
  style?: string | Partial<CSSStyleDeclaration>;
@@ -55,6 +57,9 @@ interface KTBaseAttribute {
55
57
  for?: string;
56
58
 
57
59
  name?: string;
60
+ title?: string;
61
+ placeholder?: string;
62
+ contenteditable?: boolean;
58
63
  value?: string;
59
64
  valueAsDate?: Date;
60
65
  valueAsNumber?: number;
@@ -93,7 +98,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
93
98
  * ## About
94
99
  * @package @ktjs/core
95
100
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
96
- * @version 0.10.1 (Last Update: 2025.12.30 14:45:59.803)
101
+ * @version 0.10.3 (Last Update: 2025.12.31 15:05:46.905)
97
102
  * @license MIT
98
103
  * @link https://github.com/baendlorel/kt.js
99
104
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -201,7 +201,7 @@ function applyContent(element, content) {
201
201
  * ## About
202
202
  * @package @ktjs/core
203
203
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
204
- * @version 0.10.1 (Last Update: 2025.12.30 14:45:59.803)
204
+ * @version 0.10.3 (Last Update: 2025.12.31 15:05:46.905)
205
205
  * @license MIT
206
206
  * @link https://github.com/baendlorel/kt.js
207
207
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -241,7 +241,7 @@ function jsx(tag, props, ..._metadata) {
241
241
  const children = propObj.children;
242
242
  delete propObj.children;
243
243
  // deal with ref attribute
244
- const ref = propObj.ref?.isRef ? propObj.ref : null;
244
+ const ref = propObj.ref?.isKT ? propObj.ref : null;
245
245
  if (ref) {
246
246
  delete propObj.ref;
247
247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ktjs/core",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
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",