@ktjs/core 0.24.2 → 0.24.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
@@ -38,10 +38,10 @@ declare class KTComputed<T> {
38
38
  * @param computeFn
39
39
  * @param reactives refs and computeds that this computed depends on
40
40
  */
41
- declare function computed<T = JSX.Element>(computeFn: () => T, reactives: Array<KTReactive<unknown>>): KTComputed<T>;
41
+ declare function computed<T = JSX.Element>(computeFn: () => T, reactives: Array<KTReactive<any>>): KTComputed<T>;
42
42
 
43
43
  type KTReactive<T> = KTRef<T> | KTComputed<T>;
44
- declare const toReactive: <T>(value: T | KTReactive<T>) => KTReactive<T>;
44
+ declare const toReactive: <T>(value: T | KTReactive<T>, onChange?: ReactiveChangeHandler<T>) => KTReactive<T>;
45
45
 
46
46
  declare const enum KTReactiveType {
47
47
  REF = 1,
@@ -228,7 +228,7 @@ type KTComponent = (
228
228
  * ## About
229
229
  * @package @ktjs/core
230
230
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
231
- * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
231
+ * @version 0.24.3 (Last Update: 2026.02.05 13:45:10.968)
232
232
  * @license MIT
233
233
  * @link https://github.com/baendlorel/kt.js
234
234
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -470,11 +470,16 @@ var __ktjs_core__ = (function (exports) {
470
470
  return new KTComputed(computeFn, reactives);
471
471
  }
472
472
 
473
- const toReactive = (value) => {
473
+ const toReactive = (value, onChange) => {
474
474
  if (isKT(value)) {
475
+ if (onChange) {
476
+ value.addOnChange(onChange);
477
+ }
475
478
  return value;
476
479
  }
477
- return ref(value);
480
+ else {
481
+ return ref(value, onChange);
482
+ }
478
483
  };
479
484
 
480
485
  function applyKModel(element, valueRef) {
@@ -515,7 +520,7 @@ var __ktjs_core__ = (function (exports) {
515
520
  * ## About
516
521
  * @package @ktjs/core
517
522
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
518
- * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
523
+ * @version 0.24.3 (Last Update: 2026.02.05 13:45:10.968)
519
524
  * @license MIT
520
525
  * @link https://github.com/baendlorel/kt.js
521
526
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -470,11 +470,16 @@ var __ktjs_core__ = (function (exports) {
470
470
  return new KTComputed(computeFn, reactives);
471
471
  }
472
472
 
473
- var toReactive = function (value) {
473
+ var toReactive = function (value, onChange) {
474
474
  if (isKT(value)) {
475
+ if (onChange) {
476
+ value.addOnChange(onChange);
477
+ }
475
478
  return value;
476
479
  }
477
- return ref(value);
480
+ else {
481
+ return ref(value, onChange);
482
+ }
478
483
  };
479
484
 
480
485
  function applyKModel(element, valueRef) {
@@ -515,7 +520,7 @@ var __ktjs_core__ = (function (exports) {
515
520
  * ## About
516
521
  * @package @ktjs/core
517
522
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
518
- * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
523
+ * @version 0.24.3 (Last Update: 2026.02.05 13:45:10.968)
519
524
  * @license MIT
520
525
  * @link https://github.com/baendlorel/kt.js
521
526
  * @link https://baendlorel.github.io/ Welcome to my site!
package/dist/index.mjs CHANGED
@@ -467,11 +467,16 @@ function computed(computeFn, reactives) {
467
467
  return new KTComputed(computeFn, reactives);
468
468
  }
469
469
 
470
- const toReactive = (value) => {
470
+ const toReactive = (value, onChange) => {
471
471
  if (isKT(value)) {
472
+ if (onChange) {
473
+ value.addOnChange(onChange);
474
+ }
472
475
  return value;
473
476
  }
474
- return ref(value);
477
+ else {
478
+ return ref(value, onChange);
479
+ }
475
480
  };
476
481
 
477
482
  function applyKModel(element, valueRef) {
@@ -512,7 +517,7 @@ let creator = htmlCreator;
512
517
  * ## About
513
518
  * @package @ktjs/core
514
519
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
515
- * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
520
+ * @version 0.24.3 (Last Update: 2026.02.05 13:45:10.968)
516
521
  * @license MIT
517
522
  * @link https://github.com/baendlorel/kt.js
518
523
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -141,7 +141,7 @@ type KTAttribute = KTBaseAttribute & KTPrefixedEventAttribute;
141
141
  * ## About
142
142
  * @package @ktjs/core
143
143
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
144
- * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
144
+ * @version 0.24.3 (Last Update: 2026.02.05 13:45:10.968)
145
145
  * @license MIT
146
146
  * @link https://github.com/baendlorel/kt.js
147
147
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -360,7 +360,7 @@ let creator = htmlCreator;
360
360
  * ## About
361
361
  * @package @ktjs/core
362
362
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
363
- * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
363
+ * @version 0.24.3 (Last Update: 2026.02.05 13:45:10.968)
364
364
  * @license MIT
365
365
  * @link https://github.com/baendlorel/kt.js
366
366
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -141,7 +141,7 @@ type KTAttribute = KTBaseAttribute & KTPrefixedEventAttribute;
141
141
  * ## About
142
142
  * @package @ktjs/core
143
143
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
144
- * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
144
+ * @version 0.24.3 (Last Update: 2026.02.05 13:45:10.968)
145
145
  * @license MIT
146
146
  * @link https://github.com/baendlorel/kt.js
147
147
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -360,7 +360,7 @@ let creator = htmlCreator;
360
360
  * ## About
361
361
  * @package @ktjs/core
362
362
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
363
- * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
363
+ * @version 0.24.3 (Last Update: 2026.02.05 13:45:10.968)
364
364
  * @license MIT
365
365
  * @link https://github.com/baendlorel/kt.js
366
366
  * @link https://baendlorel.github.io/ Welcome to my site!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ktjs/core",
3
- "version": "0.24.2",
3
+ "version": "0.24.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",