@ktjs/core 0.18.2 → 0.18.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
@@ -21,7 +21,7 @@ interface KTRef<T> {
21
21
  * - can alse be used to store normal values, but it is not reactive.
22
22
  * @param value mostly an HTMLElement
23
23
  */
24
- declare function ref<T = HTMLElement>(value?: T): KTRef<T>;
24
+ declare function ref<T = HTMLElement>(value?: T, onChange?: ChangeHandler<T>): KTRef<T>;
25
25
 
26
26
  type Redraw = (props?: KTAttribute, ...args: any[]) => KTHTMLElement;
27
27
  type KTHTMLElement<El extends HTMLElement = HTMLElement, R extends Function = Redraw> = El & {
@@ -178,7 +178,7 @@ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGEl
178
178
  * ## About
179
179
  * @package @ktjs/core
180
180
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
181
- * @version 0.18.2 (Last Update: 2026.01.30 22:52:42.408)
181
+ * @version 0.18.3 (Last Update: 2026.01.30 23:10:27.447)
182
182
  * @license MIT
183
183
  * @link https://github.com/baendlorel/kt.js
184
184
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -215,7 +215,7 @@ var __ktjs_core__ = (function (exports) {
215
215
  * ## About
216
216
  * @package @ktjs/core
217
217
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
218
- * @version 0.18.2 (Last Update: 2026.01.30 22:52:42.408)
218
+ * @version 0.18.3 (Last Update: 2026.01.30 23:10:27.447)
219
219
  * @license MIT
220
220
  * @link https://github.com/baendlorel/kt.js
221
221
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -243,9 +243,9 @@ var __ktjs_core__ = (function (exports) {
243
243
  * - can alse be used to store normal values, but it is not reactive.
244
244
  * @param value mostly an HTMLElement
245
245
  */
246
- function ref(value) {
246
+ function ref(value, onChange) {
247
247
  let _value = value;
248
- let _onChanges = [];
248
+ let _onChanges = onChange ? [onChange] : [];
249
249
  return {
250
250
  isKT: true,
251
251
  get value() {
@@ -240,7 +240,7 @@ var __ktjs_core__ = (function (exports) {
240
240
  * ## About
241
241
  * @package @ktjs/core
242
242
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
243
- * @version 0.18.2 (Last Update: 2026.01.30 22:52:42.408)
243
+ * @version 0.18.3 (Last Update: 2026.01.30 23:10:27.447)
244
244
  * @license MIT
245
245
  * @link https://github.com/baendlorel/kt.js
246
246
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -301,9 +301,9 @@ var __ktjs_core__ = (function (exports) {
301
301
  * - can alse be used to store normal values, but it is not reactive.
302
302
  * @param value mostly an HTMLElement
303
303
  */
304
- function ref(value) {
304
+ function ref(value, onChange) {
305
305
  var _value = value;
306
- var _onChanges = [];
306
+ var _onChanges = onChange ? [onChange] : [];
307
307
  return {
308
308
  isKT: true,
309
309
  get value() {
package/dist/index.mjs CHANGED
@@ -212,7 +212,7 @@ const svgTempWrapper = document.createElement('div');
212
212
  * ## About
213
213
  * @package @ktjs/core
214
214
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
215
- * @version 0.18.2 (Last Update: 2026.01.30 22:52:42.408)
215
+ * @version 0.18.3 (Last Update: 2026.01.30 23:10:27.447)
216
216
  * @license MIT
217
217
  * @link https://github.com/baendlorel/kt.js
218
218
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -240,9 +240,9 @@ const h = (tag, attr, content) => {
240
240
  * - can alse be used to store normal values, but it is not reactive.
241
241
  * @param value mostly an HTMLElement
242
242
  */
243
- function ref(value) {
243
+ function ref(value, onChange) {
244
244
  let _value = value;
245
- let _onChanges = [];
245
+ let _onChanges = onChange ? [onChange] : [];
246
246
  return {
247
247
  isKT: true,
248
248
  get value() {
@@ -21,7 +21,7 @@ interface KTRef<T> {
21
21
  * - can alse be used to store normal values, but it is not reactive.
22
22
  * @param value mostly an HTMLElement
23
23
  */
24
- declare function ref<T = HTMLElement>(value?: T): KTRef<T>;
24
+ declare function ref<T = HTMLElement>(value?: T, onChange?: ChangeHandler<T>): KTRef<T>;
25
25
 
26
26
  type Redraw = (props?: KTAttribute, ...args: any[]) => KTHTMLElement;
27
27
  type KTHTMLElement<El extends HTMLElement = HTMLElement, R extends Function = Redraw> = El & {
@@ -164,7 +164,7 @@ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGEl
164
164
  * ## About
165
165
  * @package @ktjs/core
166
166
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
167
- * @version 0.18.2 (Last Update: 2026.01.30 22:52:42.408)
167
+ * @version 0.18.3 (Last Update: 2026.01.30 23:10:27.447)
168
168
  * @license MIT
169
169
  * @link https://github.com/baendlorel/kt.js
170
170
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -212,7 +212,7 @@ const svgTempWrapper = document.createElement('div');
212
212
  * ## About
213
213
  * @package @ktjs/core
214
214
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
215
- * @version 0.18.2 (Last Update: 2026.01.30 22:52:42.408)
215
+ * @version 0.18.3 (Last Update: 2026.01.30 23:10:27.447)
216
216
  * @license MIT
217
217
  * @link https://github.com/baendlorel/kt.js
218
218
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -240,9 +240,9 @@ const h = (tag, attr, content) => {
240
240
  * - can alse be used to store normal values, but it is not reactive.
241
241
  * @param value mostly an HTMLElement
242
242
  */
243
- function ref(value) {
243
+ function ref(value, onChange) {
244
244
  let _value = value;
245
- let _onChanges = [];
245
+ let _onChanges = onChange ? [onChange] : [];
246
246
  return {
247
247
  isKT: true,
248
248
  get value() {
@@ -158,7 +158,7 @@ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGEl
158
158
  * ## About
159
159
  * @package @ktjs/core
160
160
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
161
- * @version 0.18.2 (Last Update: 2026.01.30 22:52:42.408)
161
+ * @version 0.18.3 (Last Update: 2026.01.30 23:10:27.447)
162
162
  * @license MIT
163
163
  * @link https://github.com/baendlorel/kt.js
164
164
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -212,7 +212,7 @@ const svgTempWrapper = document.createElement('div');
212
212
  * ## About
213
213
  * @package @ktjs/core
214
214
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
215
- * @version 0.18.2 (Last Update: 2026.01.30 22:52:42.408)
215
+ * @version 0.18.3 (Last Update: 2026.01.30 23:10:27.447)
216
216
  * @license MIT
217
217
  * @link https://github.com/baendlorel/kt.js
218
218
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -240,7 +240,7 @@ const h = (tag, attr, content) => {
240
240
  * - can alse be used to store normal values, but it is not reactive.
241
241
  * @param value mostly an HTMLElement
242
242
  */
243
- function ref(value) {
243
+ function ref(value, onChange) {
244
244
  let _value = value;
245
245
  let _onChanges = [];
246
246
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ktjs/core",
3
- "version": "0.18.2",
3
+ "version": "0.18.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",