@ktjs/core 0.14.0 → 0.14.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 +2 -2
- package/dist/index.iife.js +3 -1
- package/dist/index.legacy.js +3 -1
- package/dist/index.mjs +3 -1
- package/dist/jsx/index.d.ts +2 -2
- package/dist/jsx/index.mjs +3 -1
- package/dist/jsx/jsx-runtime.d.ts +19 -3
- package/dist/jsx/jsx-runtime.mjs +30 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ type KTHTMLElement = HTMLElement & {
|
|
|
21
21
|
* Automically generate a redraw function if it is not provided
|
|
22
22
|
* @param props
|
|
23
23
|
*/
|
|
24
|
-
redraw: (props?: KTAttribute, children?: KTRawContent) =>
|
|
24
|
+
redraw: (props?: KTAttribute, children?: KTRawContent) => KTHTMLElement;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
declare global {
|
|
@@ -161,7 +161,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
|
|
|
161
161
|
* ## About
|
|
162
162
|
* @package @ktjs/core
|
|
163
163
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
164
|
-
* @version 0.14.
|
|
164
|
+
* @version 0.14.2 (Last Update: 2026.01.16 22:23:59.363)
|
|
165
165
|
* @license MIT
|
|
166
166
|
* @link https://github.com/baendlorel/kt.js
|
|
167
167
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
package/dist/index.iife.js
CHANGED
|
@@ -223,7 +223,7 @@ var __ktjs_core__ = (function (exports) {
|
|
|
223
223
|
* ## About
|
|
224
224
|
* @package @ktjs/core
|
|
225
225
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
226
|
-
* @version 0.14.
|
|
226
|
+
* @version 0.14.2 (Last Update: 2026.01.16 22:23:59.363)
|
|
227
227
|
* @license MIT
|
|
228
228
|
* @link https://github.com/baendlorel/kt.js
|
|
229
229
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -268,6 +268,7 @@ var __ktjs_core__ = (function (exports) {
|
|
|
268
268
|
ref.value = el;
|
|
269
269
|
}
|
|
270
270
|
old.replaceWith(el);
|
|
271
|
+
return el;
|
|
271
272
|
};
|
|
272
273
|
}
|
|
273
274
|
if (ref) {
|
|
@@ -294,6 +295,7 @@ var __ktjs_core__ = (function (exports) {
|
|
|
294
295
|
ref.value = el;
|
|
295
296
|
}
|
|
296
297
|
old.replaceWith(el);
|
|
298
|
+
return el;
|
|
297
299
|
};
|
|
298
300
|
return el;
|
|
299
301
|
}
|
package/dist/index.legacy.js
CHANGED
|
@@ -248,7 +248,7 @@ var __ktjs_core__ = (function (exports) {
|
|
|
248
248
|
* ## About
|
|
249
249
|
* @package @ktjs/core
|
|
250
250
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
251
|
-
* @version 0.14.
|
|
251
|
+
* @version 0.14.2 (Last Update: 2026.01.16 22:23:59.363)
|
|
252
252
|
* @license MIT
|
|
253
253
|
* @link https://github.com/baendlorel/kt.js
|
|
254
254
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -330,6 +330,7 @@ var __ktjs_core__ = (function (exports) {
|
|
|
330
330
|
ref.value = el_1;
|
|
331
331
|
}
|
|
332
332
|
old.replaceWith(el_1);
|
|
333
|
+
return el_1;
|
|
333
334
|
};
|
|
334
335
|
}
|
|
335
336
|
if (ref) {
|
|
@@ -356,6 +357,7 @@ var __ktjs_core__ = (function (exports) {
|
|
|
356
357
|
ref.value = el_2;
|
|
357
358
|
}
|
|
358
359
|
old.replaceWith(el_2);
|
|
360
|
+
return el_2;
|
|
359
361
|
};
|
|
360
362
|
return el_2;
|
|
361
363
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -220,7 +220,7 @@ function applyContent(element, content) {
|
|
|
220
220
|
* ## About
|
|
221
221
|
* @package @ktjs/core
|
|
222
222
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
223
|
-
* @version 0.14.
|
|
223
|
+
* @version 0.14.2 (Last Update: 2026.01.16 22:23:59.363)
|
|
224
224
|
* @license MIT
|
|
225
225
|
* @link https://github.com/baendlorel/kt.js
|
|
226
226
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -265,6 +265,7 @@ function jsx(tag, props = {}) {
|
|
|
265
265
|
ref.value = el;
|
|
266
266
|
}
|
|
267
267
|
old.replaceWith(el);
|
|
268
|
+
return el;
|
|
268
269
|
};
|
|
269
270
|
}
|
|
270
271
|
if (ref) {
|
|
@@ -291,6 +292,7 @@ function jsx(tag, props = {}) {
|
|
|
291
292
|
ref.value = el;
|
|
292
293
|
}
|
|
293
294
|
old.replaceWith(el);
|
|
295
|
+
return el;
|
|
294
296
|
};
|
|
295
297
|
return el;
|
|
296
298
|
}
|
package/dist/jsx/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ type KTHTMLElement = HTMLElement & {
|
|
|
21
21
|
* Automically generate a redraw function if it is not provided
|
|
22
22
|
* @param props
|
|
23
23
|
*/
|
|
24
|
-
redraw: (props?: KTAttribute, children?: KTRawContent) =>
|
|
24
|
+
redraw: (props?: KTAttribute, children?: KTRawContent) => KTHTMLElement;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
declare global {
|
|
@@ -147,7 +147,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
|
|
|
147
147
|
* ## About
|
|
148
148
|
* @package @ktjs/core
|
|
149
149
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
150
|
-
* @version 0.14.
|
|
150
|
+
* @version 0.14.2 (Last Update: 2026.01.16 22:23:59.363)
|
|
151
151
|
* @license MIT
|
|
152
152
|
* @link https://github.com/baendlorel/kt.js
|
|
153
153
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
package/dist/jsx/index.mjs
CHANGED
|
@@ -220,7 +220,7 @@ function applyContent(element, content) {
|
|
|
220
220
|
* ## About
|
|
221
221
|
* @package @ktjs/core
|
|
222
222
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
223
|
-
* @version 0.14.
|
|
223
|
+
* @version 0.14.2 (Last Update: 2026.01.16 22:23:59.363)
|
|
224
224
|
* @license MIT
|
|
225
225
|
* @link https://github.com/baendlorel/kt.js
|
|
226
226
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -265,6 +265,7 @@ function jsx(tag, props = {}) {
|
|
|
265
265
|
ref.value = el;
|
|
266
266
|
}
|
|
267
267
|
old.replaceWith(el);
|
|
268
|
+
return el;
|
|
268
269
|
};
|
|
269
270
|
}
|
|
270
271
|
if (ref) {
|
|
@@ -291,6 +292,7 @@ function jsx(tag, props = {}) {
|
|
|
291
292
|
ref.value = el;
|
|
292
293
|
}
|
|
293
294
|
old.replaceWith(el);
|
|
295
|
+
return el;
|
|
294
296
|
};
|
|
295
297
|
return el;
|
|
296
298
|
}
|
|
@@ -15,7 +15,7 @@ type KTHTMLElement = HTMLElement & {
|
|
|
15
15
|
* Automically generate a redraw function if it is not provided
|
|
16
16
|
* @param props
|
|
17
17
|
*/
|
|
18
|
-
redraw: (props?: KTAttribute, children?: KTRawContent) =>
|
|
18
|
+
redraw: (props?: KTAttribute, children?: KTRawContent) => KTHTMLElement;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
declare global {
|
|
@@ -141,7 +141,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
|
|
|
141
141
|
* ## About
|
|
142
142
|
* @package @ktjs/core
|
|
143
143
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
144
|
-
* @version 0.14.
|
|
144
|
+
* @version 0.14.2 (Last Update: 2026.01.16 22:23:59.363)
|
|
145
145
|
* @license MIT
|
|
146
146
|
* @link https://github.com/baendlorel/kt.js
|
|
147
147
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -173,4 +173,20 @@ declare const jsxDEV: typeof jsx;
|
|
|
173
173
|
*/
|
|
174
174
|
declare const jsxs: typeof jsx;
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
/**
|
|
177
|
+
* A helper to create redrawable elements
|
|
178
|
+
* ```tsx
|
|
179
|
+
* export function MyComponent() {
|
|
180
|
+
* let aa = 10;
|
|
181
|
+
* // ...
|
|
182
|
+
* // aa might be changed
|
|
183
|
+
* return createRedrawable(() => <div>{aa}</div>);
|
|
184
|
+
* }
|
|
185
|
+
* ```
|
|
186
|
+
* Then the returned element has a `redraw` method to redraw itself with new values.
|
|
187
|
+
* @param creator
|
|
188
|
+
* @returns created element
|
|
189
|
+
*/
|
|
190
|
+
declare function createRedrawable(creator: () => KTHTMLElement): KTHTMLElement;
|
|
191
|
+
|
|
192
|
+
export { Fragment, h as createElement, createRedrawable, h, jsx, jsxDEV, jsxs };
|
package/dist/jsx/jsx-runtime.mjs
CHANGED
|
@@ -220,7 +220,7 @@ function applyContent(element, content) {
|
|
|
220
220
|
* ## About
|
|
221
221
|
* @package @ktjs/core
|
|
222
222
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
223
|
-
* @version 0.14.
|
|
223
|
+
* @version 0.14.2 (Last Update: 2026.01.16 22:23:59.363)
|
|
224
224
|
* @license MIT
|
|
225
225
|
* @link https://github.com/baendlorel/kt.js
|
|
226
226
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -265,6 +265,7 @@ function jsx(tag, props = {}) {
|
|
|
265
265
|
ref.value = el;
|
|
266
266
|
}
|
|
267
267
|
old.replaceWith(el);
|
|
268
|
+
return el;
|
|
268
269
|
};
|
|
269
270
|
}
|
|
270
271
|
if (ref) {
|
|
@@ -291,6 +292,7 @@ function jsx(tag, props = {}) {
|
|
|
291
292
|
ref.value = el;
|
|
292
293
|
}
|
|
293
294
|
old.replaceWith(el);
|
|
295
|
+
return el;
|
|
294
296
|
};
|
|
295
297
|
return el;
|
|
296
298
|
}
|
|
@@ -335,5 +337,31 @@ const jsxDEV = (...args) => {
|
|
|
335
337
|
* This is called when using jsx: "react-jsx" or "react-jsxdev"
|
|
336
338
|
*/
|
|
337
339
|
const jsxs = jsx;
|
|
340
|
+
/**
|
|
341
|
+
* A helper to create redrawable elements
|
|
342
|
+
* ```tsx
|
|
343
|
+
* export function MyComponent() {
|
|
344
|
+
* let aa = 10;
|
|
345
|
+
* // ...
|
|
346
|
+
* // aa might be changed
|
|
347
|
+
* return createRedrawable(() => <div>{aa}</div>);
|
|
348
|
+
* }
|
|
349
|
+
* ```
|
|
350
|
+
* Then the returned element has a `redraw` method to redraw itself with new values.
|
|
351
|
+
* @param creator
|
|
352
|
+
* @returns created element
|
|
353
|
+
*/
|
|
354
|
+
function createRedrawable(creator) {
|
|
355
|
+
let element = creator();
|
|
356
|
+
const redraw = () => {
|
|
357
|
+
const old = element;
|
|
358
|
+
element = creator();
|
|
359
|
+
old.replaceWith(element);
|
|
360
|
+
element.redraw = redraw;
|
|
361
|
+
return element;
|
|
362
|
+
};
|
|
363
|
+
element.redraw = redraw;
|
|
364
|
+
return element;
|
|
365
|
+
}
|
|
338
366
|
|
|
339
|
-
export { Fragment, h as createElement, h, jsx, jsxDEV, jsxs };
|
|
367
|
+
export { Fragment, h as createElement, createRedrawable, h, jsx, jsxDEV, jsxs };
|