@ktjs/jsx 0.6.10 → 0.6.11
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.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/jsx-runtime.cjs +8 -3
- package/dist/jsx-runtime.mjs +8 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@ktjs/core");function t(t,n,...r){const o="string"==typeof n?{class:n}:n;if(null==o)return e.h(t);const s=o.children;delete o.children;const c=
|
|
1
|
+
"use strict";var e=require("@ktjs/core");function t(t,n,...r){const o="string"==typeof n?{class:n}:n;if(null==o)return e.h(t);const s=o.children;delete o.children;const c="ref"in o&&"object"==typeof o.ref&&null!==o.ref,u=c?o.ref:null;c&&delete o.ref;const l=e.h(t,o,s);return c&&(u.value=l),l}const n=t,r=t;Object.defineProperty(exports,"createElement",{enumerable:!0,get:function(){return e.h}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return e.h}}),exports.Fragment=function(e){window.__ktjs__.throws("kt.js doesn't have a Fragment concept")},exports.jsx=t,exports.jsxDEV=n,exports.jsxs=r,exports.ref=function(){return{value:null}};
|
package/dist/index.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ declare global {
|
|
|
68
68
|
* ## About
|
|
69
69
|
* @package @ktjs/jsx
|
|
70
70
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
71
|
-
* @version 0.6.
|
|
71
|
+
* @version 0.6.11 (Last Update: 2025.12.24 17:47:48.230)
|
|
72
72
|
* @license MIT
|
|
73
73
|
* @link https://github.com/baendlorel/kt.js
|
|
74
74
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t}from"@ktjs/core";export{h as createElement,h}from"@ktjs/core";function e(e,n,...o){const r="string"==typeof n?{class:n}:n;if(null==r)return t(e);const c=r.children;delete r.children;const
|
|
1
|
+
import{h as t}from"@ktjs/core";export{h as createElement,h}from"@ktjs/core";function e(e,n,...o){const r="string"==typeof n?{class:n}:n;if(null==r)return t(e);const c=r.children;delete r.children;const l="ref"in r&&"object"==typeof r.ref&&null!==r.ref,s=l?r.ref:null;l&&delete r.ref;const u=t(e,r,c);return l&&(s.value=u),u}function n(t){window.__ktjs__.throws("kt.js doesn't have a Fragment concept")}const o=e,r=e;function c(){return{value:null}}export{n as Fragment,e as jsx,o as jsxDEV,r as jsxs,c as ref};
|
package/dist/jsx-runtime.cjs
CHANGED
|
@@ -14,11 +14,16 @@ function jsx(tag, props, ..._metadata) {
|
|
|
14
14
|
}
|
|
15
15
|
const children = propObj.children;
|
|
16
16
|
delete propObj.children;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
// deal with ref attribute
|
|
18
|
+
const hasRef = 'ref' in propObj && typeof propObj.ref === 'object' && propObj.ref !== null;
|
|
19
|
+
const ref = hasRef ? propObj.ref : null;
|
|
20
|
+
if (hasRef) {
|
|
20
21
|
delete propObj.ref;
|
|
21
22
|
}
|
|
23
|
+
const el = core.h(tag, propObj, children);
|
|
24
|
+
if (hasRef) {
|
|
25
|
+
ref.value = el;
|
|
26
|
+
}
|
|
22
27
|
return el;
|
|
23
28
|
}
|
|
24
29
|
/**
|
package/dist/jsx-runtime.mjs
CHANGED
|
@@ -13,11 +13,16 @@ function jsx(tag, props, ..._metadata) {
|
|
|
13
13
|
}
|
|
14
14
|
const children = propObj.children;
|
|
15
15
|
delete propObj.children;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
// deal with ref attribute
|
|
17
|
+
const hasRef = 'ref' in propObj && typeof propObj.ref === 'object' && propObj.ref !== null;
|
|
18
|
+
const ref = hasRef ? propObj.ref : null;
|
|
19
|
+
if (hasRef) {
|
|
19
20
|
delete propObj.ref;
|
|
20
21
|
}
|
|
22
|
+
const el = h(tag, propObj, children);
|
|
23
|
+
if (hasRef) {
|
|
24
|
+
ref.value = el;
|
|
25
|
+
}
|
|
21
26
|
return el;
|
|
22
27
|
}
|
|
23
28
|
/**
|