@ktjs/core 0.10.0 → 0.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.
package/dist/index.d.ts CHANGED
@@ -20,7 +20,12 @@ interface KTRef<T> {
20
20
  value: T;
21
21
  isKT: true;
22
22
  }
23
- declare function ref<T>(value?: T): KTRef<T>;
23
+ /**
24
+ * Reference to the created HTML element.
25
+ * - can alse be used to store normal values, but it is not reactive.
26
+ * @param value mostly an HTMLElement
27
+ */
28
+ declare function ktref<T = HTMLElement>(value?: T): KTRef<T>;
24
29
 
25
30
  type KTAvailableContent = KTRef<any> | HTMLElement | string | number | undefined;
26
31
  type KTRawContent =
@@ -42,6 +47,8 @@ type EventHandler<T extends Event = Event> = (this: HTMLElement, ev: T) => any;
42
47
  interface KTBaseAttribute {
43
48
  [k: string]: any;
44
49
 
50
+ ref?: KTRef<HTMLElement>;
51
+
45
52
  id?: string;
46
53
  class?: string;
47
54
  style?: string | Partial<CSSStyleDeclaration>;
@@ -118,7 +125,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
118
125
  * ## About
119
126
  * @package @ktjs/core
120
127
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
121
- * @version 0.10.0 (Last Update: 2025.12.30 14:19:29.793)
128
+ * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
122
129
  * @license MIT
123
130
  * @link https://github.com/baendlorel/kt.js
124
131
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -175,5 +182,5 @@ declare function KTAsync(props: {
175
182
  children?: KTRawContent;
176
183
  }): HTMLElement;
177
184
 
178
- export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs, ref };
185
+ export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs, ktref };
179
186
  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.0 (Last Update: 2025.12.30 14:19:29.793)
224
+ * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
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
  }
@@ -312,7 +312,12 @@ var __ktjs_core__ = (function (exports) {
312
312
  */
313
313
  const jsxs = jsx;
314
314
 
315
- function ref(value) {
315
+ /**
316
+ * Reference to the created HTML element.
317
+ * - can alse be used to store normal values, but it is not reactive.
318
+ * @param value mostly an HTMLElement
319
+ */
320
+ function ktref(value) {
316
321
  return { value: value, isKT: true };
317
322
  }
318
323
 
@@ -335,7 +340,7 @@ var __ktjs_core__ = (function (exports) {
335
340
  exports.jsx = jsx;
336
341
  exports.jsxDEV = jsxDEV;
337
342
  exports.jsxs = jsxs;
338
- exports.ref = ref;
343
+ exports.ktref = ktref;
339
344
 
340
345
  return exports;
341
346
 
@@ -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.0 (Last Update: 2025.12.30 14:19:29.793)
240
+ * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
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
  }
@@ -368,7 +368,12 @@ var __ktjs_core__ = (function (exports) {
368
368
  */
369
369
  var jsxs = jsx;
370
370
 
371
- function ref(value) {
371
+ /**
372
+ * Reference to the created HTML element.
373
+ * - can alse be used to store normal values, but it is not reactive.
374
+ * @param value mostly an HTMLElement
375
+ */
376
+ function ktref(value) {
372
377
  return { value: value, isKT: true };
373
378
  }
374
379
 
@@ -391,7 +396,7 @@ var __ktjs_core__ = (function (exports) {
391
396
  exports.jsx = jsx;
392
397
  exports.jsxDEV = jsxDEV;
393
398
  exports.jsxs = jsxs;
394
- exports.ref = ref;
399
+ exports.ktref = ktref;
395
400
 
396
401
  return exports;
397
402
 
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.0 (Last Update: 2025.12.30 14:19:29.793)
221
+ * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
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
  }
@@ -309,7 +309,12 @@ const jsxDEV = (...args) => {
309
309
  */
310
310
  const jsxs = jsx;
311
311
 
312
- function ref(value) {
312
+ /**
313
+ * Reference to the created HTML element.
314
+ * - can alse be used to store normal values, but it is not reactive.
315
+ * @param value mostly an HTMLElement
316
+ */
317
+ function ktref(value) {
313
318
  return { value: value, isKT: true };
314
319
  }
315
320
 
@@ -325,4 +330,4 @@ function KTAsync(props) {
325
330
  return comp;
326
331
  }
327
332
 
328
- export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs, ref };
333
+ export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs, ktref };
@@ -9,7 +9,12 @@ interface KTRef<T> {
9
9
  value: T;
10
10
  isKT: true;
11
11
  }
12
- declare function ref<T>(value?: T): KTRef<T>;
12
+ /**
13
+ * Reference to the created HTML element.
14
+ * - can alse be used to store normal values, but it is not reactive.
15
+ * @param value mostly an HTMLElement
16
+ */
17
+ declare function ktref<T = HTMLElement>(value?: T): KTRef<T>;
13
18
 
14
19
  type KTAvailableContent = KTRef<any> | HTMLElement | string | number | undefined;
15
20
  type KTRawContent =
@@ -25,6 +30,8 @@ type KTRawAttr = KTAttribute | string;
25
30
  interface KTBaseAttribute {
26
31
  [k: string]: any;
27
32
 
33
+ ref?: KTRef<HTMLElement>;
34
+
28
35
  id?: string;
29
36
  class?: string;
30
37
  style?: string | Partial<CSSStyleDeclaration>;
@@ -94,7 +101,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
94
101
  * ## About
95
102
  * @package @ktjs/core
96
103
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
97
- * @version 0.10.0 (Last Update: 2025.12.30 14:19:29.793)
104
+ * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
98
105
  * @license MIT
99
106
  * @link https://github.com/baendlorel/kt.js
100
107
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -145,5 +152,5 @@ declare global {
145
152
  }
146
153
  }
147
154
 
148
- export { Fragment, h as createElement, jsx, jsxDEV, jsxs, ref };
155
+ export { Fragment, h as createElement, jsx, jsxDEV, jsxs, ktref };
149
156
  export type { KTRef };
@@ -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.0 (Last Update: 2025.12.30 14:19:29.793)
204
+ * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
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
  }
@@ -292,8 +292,13 @@ const jsxDEV = (...args) => {
292
292
  */
293
293
  const jsxs = jsx;
294
294
 
295
- function ref(value) {
295
+ /**
296
+ * Reference to the created HTML element.
297
+ * - can alse be used to store normal values, but it is not reactive.
298
+ * @param value mostly an HTMLElement
299
+ */
300
+ function ktref(value) {
296
301
  return { value: value, isKT: true };
297
302
  }
298
303
 
299
- export { Fragment, h as createElement, jsx, jsxDEV, jsxs, ref };
304
+ export { Fragment, h as createElement, jsx, jsxDEV, jsxs, ktref };
@@ -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>;
@@ -93,7 +95,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
93
95
  * ## About
94
96
  * @package @ktjs/core
95
97
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
96
- * @version 0.10.0 (Last Update: 2025.12.30 14:19:29.793)
98
+ * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
97
99
  * @license MIT
98
100
  * @link https://github.com/baendlorel/kt.js
99
101
  * @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.0 (Last Update: 2025.12.30 14:19:29.793)
204
+ * @version 0.10.2 (Last Update: 2025.12.30 15:34:11.276)
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.0",
3
+ "version": "0.10.2",
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",