@ktjs/core 0.11.2 → 0.12.0
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 +4 -3
- package/dist/index.iife.js +4 -4
- package/dist/index.legacy.js +5 -4
- package/dist/index.mjs +4 -4
- package/dist/jsx/index.d.ts +3 -3
- package/dist/jsx/index.mjs +3 -3
- package/dist/jsx/jsx-runtime.d.ts +1 -1
- package/dist/jsx/jsx-runtime.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ interface KTRef<T> {
|
|
|
25
25
|
* - can alse be used to store normal values, but it is not reactive.
|
|
26
26
|
* @param value mostly an HTMLElement
|
|
27
27
|
*/
|
|
28
|
-
declare function
|
|
28
|
+
declare function ref<T = HTMLElement>(value?: T): KTRef<T>;
|
|
29
29
|
|
|
30
30
|
type KTAvailableContent =
|
|
31
31
|
| KTRef<any>
|
|
@@ -134,7 +134,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
|
|
|
134
134
|
* ## About
|
|
135
135
|
* @package @ktjs/core
|
|
136
136
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
137
|
-
* @version 0.
|
|
137
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
138
138
|
* @license MIT
|
|
139
139
|
* @link https://github.com/baendlorel/kt.js
|
|
140
140
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -191,9 +191,10 @@ declare global {
|
|
|
191
191
|
type ExtractComponentProps<T> = T extends (props: infer P) => any ? Omit<P, 'ref' | 'children'> : {};
|
|
192
192
|
declare function KTAsync<T extends KTComponent>(props: {
|
|
193
193
|
ref?: KTRef<HTMLElement>;
|
|
194
|
+
skeleton?: HTMLElement;
|
|
194
195
|
component: T;
|
|
195
196
|
children?: KTRawContent;
|
|
196
197
|
} & ExtractComponentProps<T>): HTMLElement;
|
|
197
198
|
|
|
198
|
-
export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs,
|
|
199
|
+
export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs, ref };
|
|
199
200
|
export type { EventHandler, HTMLTag, KTAttribute, KTRawAttr, KTRawContent, KTRawContents, KTRef, KTRuntime };
|
package/dist/index.iife.js
CHANGED
|
@@ -225,7 +225,7 @@ var __ktjs_core__ = (function (exports) {
|
|
|
225
225
|
* ## About
|
|
226
226
|
* @package @ktjs/core
|
|
227
227
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
228
|
-
* @version 0.
|
|
228
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
229
229
|
* @license MIT
|
|
230
230
|
* @link https://github.com/baendlorel/kt.js
|
|
231
231
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -321,13 +321,13 @@ var __ktjs_core__ = (function (exports) {
|
|
|
321
321
|
* - can alse be used to store normal values, but it is not reactive.
|
|
322
322
|
* @param value mostly an HTMLElement
|
|
323
323
|
*/
|
|
324
|
-
function
|
|
324
|
+
function ref(value) {
|
|
325
325
|
return { value: value, isKT: true };
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
function KTAsync(props) {
|
|
329
329
|
const raw = props.component(props);
|
|
330
|
-
let comp = document.createComment('ktjs-suspense-placeholder');
|
|
330
|
+
let comp = props.skeleton ?? document.createComment('ktjs-suspense-placeholder');
|
|
331
331
|
if ($isThenable(raw)) {
|
|
332
332
|
raw.then((resolved) => comp.replaceWith(resolved));
|
|
333
333
|
}
|
|
@@ -344,7 +344,7 @@ var __ktjs_core__ = (function (exports) {
|
|
|
344
344
|
exports.jsx = jsx;
|
|
345
345
|
exports.jsxDEV = jsxDEV;
|
|
346
346
|
exports.jsxs = jsxs;
|
|
347
|
-
exports.
|
|
347
|
+
exports.ref = ref;
|
|
348
348
|
|
|
349
349
|
return exports;
|
|
350
350
|
|
package/dist/index.legacy.js
CHANGED
|
@@ -241,7 +241,7 @@ var __ktjs_core__ = (function (exports) {
|
|
|
241
241
|
* ## About
|
|
242
242
|
* @package @ktjs/core
|
|
243
243
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
244
|
-
* @version 0.
|
|
244
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
245
245
|
* @license MIT
|
|
246
246
|
* @link https://github.com/baendlorel/kt.js
|
|
247
247
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -377,13 +377,14 @@ var __ktjs_core__ = (function (exports) {
|
|
|
377
377
|
* - can alse be used to store normal values, but it is not reactive.
|
|
378
378
|
* @param value mostly an HTMLElement
|
|
379
379
|
*/
|
|
380
|
-
function
|
|
380
|
+
function ref(value) {
|
|
381
381
|
return { value: value, isKT: true };
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
function KTAsync(props) {
|
|
385
|
+
var _a;
|
|
385
386
|
var raw = props.component(props);
|
|
386
|
-
var comp = document.createComment('ktjs-suspense-placeholder');
|
|
387
|
+
var comp = (_a = props.skeleton) !== null && _a !== void 0 ? _a : document.createComment('ktjs-suspense-placeholder');
|
|
387
388
|
if ($isThenable(raw)) {
|
|
388
389
|
raw.then(function (resolved) { return comp.replaceWith(resolved); });
|
|
389
390
|
}
|
|
@@ -400,7 +401,7 @@ var __ktjs_core__ = (function (exports) {
|
|
|
400
401
|
exports.jsx = jsx;
|
|
401
402
|
exports.jsxDEV = jsxDEV;
|
|
402
403
|
exports.jsxs = jsxs;
|
|
403
|
-
exports.
|
|
404
|
+
exports.ref = ref;
|
|
404
405
|
|
|
405
406
|
return exports;
|
|
406
407
|
|
package/dist/index.mjs
CHANGED
|
@@ -222,7 +222,7 @@ function applyContent(element, content) {
|
|
|
222
222
|
* ## About
|
|
223
223
|
* @package @ktjs/core
|
|
224
224
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
225
|
-
* @version 0.
|
|
225
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
226
226
|
* @license MIT
|
|
227
227
|
* @link https://github.com/baendlorel/kt.js
|
|
228
228
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -318,13 +318,13 @@ const jsxs = jsx;
|
|
|
318
318
|
* - can alse be used to store normal values, but it is not reactive.
|
|
319
319
|
* @param value mostly an HTMLElement
|
|
320
320
|
*/
|
|
321
|
-
function
|
|
321
|
+
function ref(value) {
|
|
322
322
|
return { value: value, isKT: true };
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
function KTAsync(props) {
|
|
326
326
|
const raw = props.component(props);
|
|
327
|
-
let comp = document.createComment('ktjs-suspense-placeholder');
|
|
327
|
+
let comp = props.skeleton ?? document.createComment('ktjs-suspense-placeholder');
|
|
328
328
|
if ($isThenable(raw)) {
|
|
329
329
|
raw.then((resolved) => comp.replaceWith(resolved));
|
|
330
330
|
}
|
|
@@ -334,4 +334,4 @@ function KTAsync(props) {
|
|
|
334
334
|
return comp;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs,
|
|
337
|
+
export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs, ref };
|
package/dist/jsx/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ interface KTRef<T> {
|
|
|
14
14
|
* - can alse be used to store normal values, but it is not reactive.
|
|
15
15
|
* @param value mostly an HTMLElement
|
|
16
16
|
*/
|
|
17
|
-
declare function
|
|
17
|
+
declare function ref<T = HTMLElement>(value?: T): KTRef<T>;
|
|
18
18
|
|
|
19
19
|
type KTAvailableContent =
|
|
20
20
|
| KTRef<any>
|
|
@@ -109,7 +109,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
|
|
|
109
109
|
* ## About
|
|
110
110
|
* @package @ktjs/core
|
|
111
111
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
112
|
-
* @version 0.
|
|
112
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
113
113
|
* @license MIT
|
|
114
114
|
* @link https://github.com/baendlorel/kt.js
|
|
115
115
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -160,5 +160,5 @@ declare global {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
export { Fragment, h as createElement, jsx, jsxDEV, jsxs,
|
|
163
|
+
export { Fragment, h as createElement, jsx, jsxDEV, jsxs, ref };
|
|
164
164
|
export type { KTRef };
|
package/dist/jsx/index.mjs
CHANGED
|
@@ -205,7 +205,7 @@ function applyContent(element, content) {
|
|
|
205
205
|
* ## About
|
|
206
206
|
* @package @ktjs/core
|
|
207
207
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
208
|
-
* @version 0.
|
|
208
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
209
209
|
* @license MIT
|
|
210
210
|
* @link https://github.com/baendlorel/kt.js
|
|
211
211
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -301,8 +301,8 @@ const jsxs = jsx;
|
|
|
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
|
|
304
|
+
function ref(value) {
|
|
305
305
|
return { value: value, isKT: true };
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
export { Fragment, h as createElement, jsx, jsxDEV, jsxs,
|
|
308
|
+
export { Fragment, h as createElement, jsx, jsxDEV, jsxs, ref };
|
|
@@ -103,7 +103,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
|
|
|
103
103
|
* ## About
|
|
104
104
|
* @package @ktjs/core
|
|
105
105
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
106
|
-
* @version 0.
|
|
106
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
107
107
|
* @license MIT
|
|
108
108
|
* @link https://github.com/baendlorel/kt.js
|
|
109
109
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
package/dist/jsx/jsx-runtime.mjs
CHANGED
|
@@ -205,7 +205,7 @@ function applyContent(element, content) {
|
|
|
205
205
|
* ## About
|
|
206
206
|
* @package @ktjs/core
|
|
207
207
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
208
|
-
* @version 0.
|
|
208
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
209
209
|
* @license MIT
|
|
210
210
|
* @link https://github.com/baendlorel/kt.js
|
|
211
211
|
* @link https://baendlorel.github.io/ Welcome to my site!
|