@ktjs/core 0.24.1 → 0.24.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
@@ -41,6 +41,7 @@ declare class KTComputed<T> {
41
41
  declare function computed<T = JSX.Element>(computeFn: () => T, reactives: Array<KTReactive<unknown>>): 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
45
 
45
46
  declare const enum KTReactiveType {
46
47
  REF = 1,
@@ -227,7 +228,7 @@ type KTComponent = (
227
228
  * ## About
228
229
  * @package @ktjs/core
229
230
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
230
- * @version 0.24.1 (Last Update: 2026.02.05 12:51:38.436)
231
+ * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
231
232
  * @license MIT
232
233
  * @link https://github.com/baendlorel/kt.js
233
234
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -1406,5 +1407,5 @@ interface KTForProps<T> {
1406
1407
  */
1407
1408
  declare function KTFor<T>(props: KTForProps<T>): KTForElement;
1408
1409
 
1409
- export { $modelOrRef, Fragment, KTAsync, KTComputed, KTFor, KTReactiveType, KTRef, computed, h as createElement, createRedrawable, deref, h, isComputed, isKT, isRef, jsx, jsxDEV, jsxs, ref, surfaceRef, toRef };
1410
+ export { $modelOrRef, Fragment, KTAsync, KTComputed, KTFor, KTReactiveType, KTRef, computed, h as createElement, createRedrawable, deref, h, isComputed, isKT, isRef, jsx, jsxDEV, jsxs, ref, surfaceRef, toReactive, toRef };
1410
1411
  export type { EventHandler, HTMLTag, InputElementTag, KTAttribute, KTForElement, KTForProps, KTPrefixedEventAttribute, KTRawAttr, KTRawContent, KTRawContents, KTReactive, KTSurfaceRef, MathMLTag, ReactiveChangeHandler, SVGTag };
@@ -470,6 +470,13 @@ var __ktjs_core__ = (function (exports) {
470
470
  return new KTComputed(computeFn, reactives);
471
471
  }
472
472
 
473
+ const toReactive = (value) => {
474
+ if (isKT(value)) {
475
+ return value;
476
+ }
477
+ return ref(value);
478
+ };
479
+
473
480
  function applyKModel(element, valueRef) {
474
481
  if (!isKT(valueRef)) {
475
482
  console.warn('[kt.js warn] k-model value must be a KTRef.');
@@ -508,7 +515,7 @@ var __ktjs_core__ = (function (exports) {
508
515
  * ## About
509
516
  * @package @ktjs/core
510
517
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
511
- * @version 0.24.1 (Last Update: 2026.02.05 12:51:38.436)
518
+ * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
512
519
  * @license MIT
513
520
  * @link https://github.com/baendlorel/kt.js
514
521
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -898,6 +905,7 @@ var __ktjs_core__ = (function (exports) {
898
905
  exports.jsxs = jsxs;
899
906
  exports.ref = ref;
900
907
  exports.surfaceRef = surfaceRef;
908
+ exports.toReactive = toReactive;
901
909
  exports.toRef = toRef;
902
910
 
903
911
  return exports;
@@ -470,6 +470,13 @@ var __ktjs_core__ = (function (exports) {
470
470
  return new KTComputed(computeFn, reactives);
471
471
  }
472
472
 
473
+ var toReactive = function (value) {
474
+ if (isKT(value)) {
475
+ return value;
476
+ }
477
+ return ref(value);
478
+ };
479
+
473
480
  function applyKModel(element, valueRef) {
474
481
  if (!isKT(valueRef)) {
475
482
  console.warn('[kt.js warn] k-model value must be a KTRef.');
@@ -508,7 +515,7 @@ var __ktjs_core__ = (function (exports) {
508
515
  * ## About
509
516
  * @package @ktjs/core
510
517
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
511
- * @version 0.24.1 (Last Update: 2026.02.05 12:51:38.436)
518
+ * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
512
519
  * @license MIT
513
520
  * @link https://github.com/baendlorel/kt.js
514
521
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -905,6 +912,7 @@ var __ktjs_core__ = (function (exports) {
905
912
  exports.jsxs = jsxs;
906
913
  exports.ref = ref;
907
914
  exports.surfaceRef = surfaceRef;
915
+ exports.toReactive = toReactive;
908
916
  exports.toRef = toRef;
909
917
 
910
918
  return exports;
package/dist/index.mjs CHANGED
@@ -467,6 +467,13 @@ function computed(computeFn, reactives) {
467
467
  return new KTComputed(computeFn, reactives);
468
468
  }
469
469
 
470
+ const toReactive = (value) => {
471
+ if (isKT(value)) {
472
+ return value;
473
+ }
474
+ return ref(value);
475
+ };
476
+
470
477
  function applyKModel(element, valueRef) {
471
478
  if (!isKT(valueRef)) {
472
479
  console.warn('[kt.js warn] k-model value must be a KTRef.');
@@ -505,7 +512,7 @@ let creator = htmlCreator;
505
512
  * ## About
506
513
  * @package @ktjs/core
507
514
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
508
- * @version 0.24.1 (Last Update: 2026.02.05 12:51:38.436)
515
+ * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
509
516
  * @license MIT
510
517
  * @link https://github.com/baendlorel/kt.js
511
518
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -876,4 +883,4 @@ function getSequence(arr) {
876
883
  return result;
877
884
  }
878
885
 
879
- export { $modelOrRef, Fragment, KTAsync, KTComputed, KTFor, KTRef, computed, h as createElement, createRedrawable, deref, h, isComputed, isKT, isRef, jsx, jsxDEV, jsxs, ref, surfaceRef, toRef };
886
+ export { $modelOrRef, Fragment, KTAsync, KTComputed, KTFor, KTRef, computed, h as createElement, createRedrawable, deref, h, isComputed, isKT, isRef, jsx, jsxDEV, jsxs, ref, surfaceRef, toReactive, toRef };
@@ -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.1 (Last Update: 2026.02.05 12:51:38.436)
144
+ * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
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.1 (Last Update: 2026.02.05 12:51:38.436)
363
+ * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
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.1 (Last Update: 2026.02.05 12:51:38.436)
144
+ * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
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.1 (Last Update: 2026.02.05 12:51:38.436)
363
+ * @version 0.24.2 (Last Update: 2026.02.05 13:36:44.993)
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.1",
3
+ "version": "0.24.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",