@ktjs/core 0.11.1 → 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 +17 -8
- 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 +15 -7
- package/dist/jsx/index.mjs +3 -3
- package/dist/jsx/jsx-runtime.d.ts +12 -4
- package/dist/jsx/jsx-runtime.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -25,13 +25,21 @@ 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
|
|
29
|
-
|
|
30
|
-
type KTAvailableContent =
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
declare function ref<T = HTMLElement>(value?: T): KTRef<T>;
|
|
29
|
+
|
|
30
|
+
type KTAvailableContent =
|
|
31
|
+
| KTRef<any>
|
|
32
|
+
| HTMLElement
|
|
33
|
+
| Element
|
|
34
|
+
| string
|
|
35
|
+
| number
|
|
36
|
+
| boolean
|
|
37
|
+
| null
|
|
38
|
+
| undefined
|
|
39
|
+
| (KTRef<any> | HTMLElement | Element | string | number | boolean | null | undefined)[];
|
|
40
|
+
type KTRawContent = KTAvailableContent | Promise<KTAvailableContent>;
|
|
33
41
|
type KTRawAttr = KTAttribute | string;
|
|
34
|
-
type KTRawContents =
|
|
42
|
+
type KTRawContents = KTAvailableContent;
|
|
35
43
|
|
|
36
44
|
/**
|
|
37
45
|
* Event handler type for DOM events
|
|
@@ -126,7 +134,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
|
|
|
126
134
|
* ## About
|
|
127
135
|
* @package @ktjs/core
|
|
128
136
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
129
|
-
* @version 0.
|
|
137
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
130
138
|
* @license MIT
|
|
131
139
|
* @link https://github.com/baendlorel/kt.js
|
|
132
140
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -183,9 +191,10 @@ declare global {
|
|
|
183
191
|
type ExtractComponentProps<T> = T extends (props: infer P) => any ? Omit<P, 'ref' | 'children'> : {};
|
|
184
192
|
declare function KTAsync<T extends KTComponent>(props: {
|
|
185
193
|
ref?: KTRef<HTMLElement>;
|
|
194
|
+
skeleton?: HTMLElement;
|
|
186
195
|
component: T;
|
|
187
196
|
children?: KTRawContent;
|
|
188
197
|
} & ExtractComponentProps<T>): HTMLElement;
|
|
189
198
|
|
|
190
|
-
export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs,
|
|
199
|
+
export { Fragment, KTAsync, h as createElement, h, jsx, jsxDEV, jsxs, ref };
|
|
191
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,11 +14,19 @@ 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
|
|
18
|
-
|
|
19
|
-
type KTAvailableContent =
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
declare function ref<T = HTMLElement>(value?: T): KTRef<T>;
|
|
18
|
+
|
|
19
|
+
type KTAvailableContent =
|
|
20
|
+
| KTRef<any>
|
|
21
|
+
| HTMLElement
|
|
22
|
+
| Element
|
|
23
|
+
| string
|
|
24
|
+
| number
|
|
25
|
+
| boolean
|
|
26
|
+
| null
|
|
27
|
+
| undefined
|
|
28
|
+
| (KTRef<any> | HTMLElement | Element | string | number | boolean | null | undefined)[];
|
|
29
|
+
type KTRawContent = KTAvailableContent | Promise<KTAvailableContent>;
|
|
22
30
|
type KTRawAttr = KTAttribute | string;
|
|
23
31
|
|
|
24
32
|
/**
|
|
@@ -101,7 +109,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
|
|
|
101
109
|
* ## About
|
|
102
110
|
* @package @ktjs/core
|
|
103
111
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
104
|
-
* @version 0.
|
|
112
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
105
113
|
* @license MIT
|
|
106
114
|
* @link https://github.com/baendlorel/kt.js
|
|
107
115
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -152,5 +160,5 @@ declare global {
|
|
|
152
160
|
}
|
|
153
161
|
}
|
|
154
162
|
|
|
155
|
-
export { Fragment, h as createElement, jsx, jsxDEV, jsxs,
|
|
163
|
+
export { Fragment, h as createElement, jsx, jsxDEV, jsxs, ref };
|
|
156
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 };
|
|
@@ -10,9 +10,17 @@ interface KTRef<T> {
|
|
|
10
10
|
isKT: true;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
type KTAvailableContent =
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
type KTAvailableContent =
|
|
14
|
+
| KTRef<any>
|
|
15
|
+
| HTMLElement
|
|
16
|
+
| Element
|
|
17
|
+
| string
|
|
18
|
+
| number
|
|
19
|
+
| boolean
|
|
20
|
+
| null
|
|
21
|
+
| undefined
|
|
22
|
+
| (KTRef<any> | HTMLElement | Element | string | number | boolean | null | undefined)[];
|
|
23
|
+
type KTRawContent = KTAvailableContent | Promise<KTAvailableContent>;
|
|
16
24
|
type KTRawAttr = KTAttribute | string;
|
|
17
25
|
|
|
18
26
|
/**
|
|
@@ -95,7 +103,7 @@ type H = (<T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent)
|
|
|
95
103
|
* ## About
|
|
96
104
|
* @package @ktjs/core
|
|
97
105
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
98
|
-
* @version 0.
|
|
106
|
+
* @version 0.12.0 (Last Update: 2026.01.14 15:48:26.320)
|
|
99
107
|
* @license MIT
|
|
100
108
|
* @link https://github.com/baendlorel/kt.js
|
|
101
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!
|