@ktjs/core 0.5.5 → 0.6.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 +6 -6
- package/dist/index.iife.js +1 -1
- package/dist/index.legacy.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -20,11 +20,11 @@ type otherstring = string & {};
|
|
|
20
20
|
/**
|
|
21
21
|
* Normal HTML tags like `div`, `span`, `a`, etc.
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
type HTMLTag = keyof HTMLElementTagNameMap;
|
|
23
|
+
type HTMLTag = keyof HTMLElementTagNameMap & otherstring;
|
|
25
24
|
|
|
26
|
-
type KTRawContent = (HTMLElement | string | undefined)[] | HTMLElement | string;
|
|
25
|
+
type KTRawContent = (HTMLElement | string | undefined | number)[] | HTMLElement | string | number;
|
|
27
26
|
type KTRawAttr = KTAttribute | string;
|
|
27
|
+
type KTRawContents = (HTMLElement | string | undefined)[];
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Event handler type for DOM events
|
|
@@ -72,7 +72,7 @@ interface KTBaseAttribute {
|
|
|
72
72
|
valueAsDate?: Date;
|
|
73
73
|
valueAsNumber?: number;
|
|
74
74
|
label?: string;
|
|
75
|
-
disabled?:
|
|
75
|
+
disabled?: boolean;
|
|
76
76
|
|
|
77
77
|
min?: string | number;
|
|
78
78
|
max?: string | number;
|
|
@@ -110,7 +110,7 @@ type HTML<T extends HTMLTag & otherstring> = T extends HTMLTag ? HTMLElementTagN
|
|
|
110
110
|
* ## About
|
|
111
111
|
* @package @ktjs/core
|
|
112
112
|
* @author Kasukabe Tsumugi <futami16237@gmail.com>
|
|
113
|
-
* @version 0.
|
|
113
|
+
* @version 0.6.0 (Last Update: 2025.12.24 13:58:58.167)
|
|
114
114
|
* @license MIT
|
|
115
115
|
* @link https://github.com/baendlorel/kt.js
|
|
116
116
|
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
@@ -122,4 +122,4 @@ declare const h: <T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawCo
|
|
|
122
122
|
declare function notSupportTextNode(tag: HTMLTag): boolean;
|
|
123
123
|
|
|
124
124
|
export { h, ktnull, notSupportTextNode };
|
|
125
|
-
export type { EventHandler, KTAttribute, KTRawAttr, KTRawContent, KTRuntime };
|
|
125
|
+
export type { EventHandler, HTMLTag, KTAttribute, KTRawAttr, KTRawContent, KTRawContents, KTRuntime };
|
package/dist/index.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var __ktjs_core__=function(e){"use strict";const t=e=>{throw new Error("kt.js: ".concat(e))},n=Array.isArray,o=Object.keys,r=Object.defineProperties,s=(e,t)=>r(e,{t:{value:t,configurable:!0}}),
|
|
1
|
+
var __ktjs_core__=function(e){"use strict";const t=e=>{throw new Error("kt.js: ".concat(e))},n=Array.isArray,o=Object.keys,r=Object.defineProperties,s=(e,t)=>r(e,{t:{value:t,configurable:!0}}),u=()=>({});"undefined"==typeof Promise&&(window.Promise={resolve:u,reject:u}),(()=>{const e="__ktjs__";if(e in window)return;const n=Object.create(null);r(n,{throws:{value:t,enumerable:!0},defines:{value:r,enumerable:!0},mark:{value:s,enumerable:!0}}),r(window,{[e]:{value:n,enumerable:!0}})})();const i=Object.create(null),c=HTMLElement.prototype.appendChild,a=HTMLElement.prototype.append,l="function"==typeof a?function(...e){const t=e.filter(e=>e!==i);return a.apply(this,t)}:function(...e){if(e.length<50)for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n?c.call(this,document.createTextNode(n)):n!==i&&c.call(this,n)}else{const t=document.createDocumentFragment();for(let n=0;n<e.length;n++){const o=e[n];"string"==typeof o?c.call(t,document.createTextNode(o)):o!==i&&c.call(t,o)}c.call(this,t)}};function f(e,t,n){t in e?e[t]=!!n:e.setAttribute(t,n)}function d(e,t,n){t in e?e[t]=n:e.setAttribute(t,n)}const m={checked:f,selected:f,value:d,valueAsDate:d,valueAsNumber:d,defaultValue:d,defaultChecked:f,defaultSelected:f,disabled:f,readOnly:f,multiple:f,required:f,autofocus:f,open:f,controls:f,autoplay:f,loop:f,muted:f,defer:f,async:f,hidden:function(e,t,n){e.hidden=!!n}},p=function(e,t,n){return e.setAttribute(t,n)};function b(e,n){"string"==typeof n?e.className=n:"object"==typeof n&&null!==n?function(e,t){const n=t.class,r=t.style;if(void 0!==n&&(e.className=n,delete t.class),r){if("string"==typeof r)e.setAttribute("style",r);else if("object"==typeof r)for(const t in r)e.style[t]=r[t];delete t.style}const s=o(t);for(let n=s.length-1;n>=0;n--){const o=s[n],r=t[o];o.startsWith("@")?e.addEventListener(o.slice(1),r):"function"!=typeof r?(m[o]||p)(e,o,r):e.addEventListener(o,r)}void 0!==n&&(t.class=n),void 0!==r&&(t.style=r)}(e,n):t("__func__ attr must be an object.")}const _=(e,o="",r="")=>{"string"!=typeof e&&t("__func__ tagName must be a string.");const s=document.createElement(e);return b(s,o),function(e,t){n(t)?l.apply(e,t):"number"==typeof t?l.call(e,t.toString()):l.call(e,t)}(s,r),s};s(_,"h");const y={area:!0,audio:!0,base:!0,basefont:!0,br:!0,canvas:!0,datalist:!0,details:!0,dialog:!0,frameset:!0,head:!0,iframe:!0,img:!0,input:!0,link:!0,meta:!0,meter:!0,noembed:!0,noframes:!0,noscript:!0,optgroup:!0,param:!0,progress:!0,rp:!0,select:!0,style:!0,template:!0,textarea:!0,title:!0,video:!0,wbr:!0,embed:!0,frame:!0,keygen:!0,option:!0};return e.h=_,e.ktnull=i,e.notSupportTextNode=function(e){return y[e]},e}({});
|
package/dist/index.legacy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var __ktjs_core__=function(e){"use strict";var t=function(e){throw new Error("kt.js: ".concat(e))},n=Array.isArray,r=Object.keys,o=Object.defineProperties,a=function(e,t){return o(e,{t:{value:t,configurable:!0}})},
|
|
1
|
+
var __ktjs_core__=function(e){"use strict";var t=function(e){throw new Error("kt.js: ".concat(e))},n=Array.isArray,r=Object.keys,o=Object.defineProperties,a=function(e,t){return o(e,{t:{value:t,configurable:!0}})},u=function(){return{}};"undefined"==typeof Promise&&(window.Promise={resolve:u,reject:u}),function(){var e,n="__ktjs__";if(!(n in window)){var r=Object.create(null);o(r,{throws:{value:t,enumerable:!0},defines:{value:o,enumerable:!0},mark:{value:a,enumerable:!0}}),o(window,((e={})[n]={value:r,enumerable:!0},e))}}();var i=Object.create(null),f=HTMLElement.prototype.appendChild,l=HTMLElement.prototype.append,c="function"==typeof l?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(function(e){return e!==i});return l.apply(this,n)}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length<50)for(var n=0;n<e.length;n++){"string"==typeof(o=e[n])?f.call(this,document.createTextNode(o)):o!==i&&f.call(this,o)}else{var r=document.createDocumentFragment();for(n=0;n<e.length;n++){var o;"string"==typeof(o=e[n])?f.call(r,document.createTextNode(o)):o!==i&&f.call(r,o)}f.call(this,r)}};function s(e,t,n){t in e?e[t]=!!n:e.setAttribute(t,n)}function d(e,t,n){t in e?e[t]=n:e.setAttribute(t,n)}var v={checked:s,selected:s,value:d,valueAsDate:d,valueAsNumber:d,defaultValue:d,defaultChecked:s,defaultSelected:s,disabled:s,readOnly:s,multiple:s,required:s,autofocus:s,open:s,controls:s,autoplay:s,loop:s,muted:s,defer:s,async:s,hidden:function(e,t,n){e.hidden=!!n}},m=function(e,t,n){return e.setAttribute(t,n)};function p(e,n){"string"==typeof n?e.className=n:"object"==typeof n&&null!==n?function(e,t){var n=t.class,o=t.style;if(void 0!==n&&(e.className=n,delete t.class),o){if("string"==typeof o)e.setAttribute("style",o);else if("object"==typeof o)for(var a in o)e.style[a]=o[a];delete t.style}for(var u=r(t),i=u.length-1;i>=0;i--){var f=t[a=u[i]];a.startsWith("@")?e.addEventListener(a.slice(1),f):"function"!=typeof f?(v[a]||m)(e,a,f):e.addEventListener(a,f)}void 0!==n&&(t.class=n),void 0!==o&&(t.style=o)}(e,n):t("__func__ attr must be an object.")}var b=function(e,r,o){void 0===r&&(r=""),void 0===o&&(o=""),"string"!=typeof e&&t("__func__ tagName must be a string.");var a=document.createElement(e);return p(a,r),function(e,t){n(t)?c.apply(e,t):"number"==typeof t?c.call(e,t.toString()):c.call(e,t)}(a,o),a};a(b,"h");var _={area:!0,audio:!0,base:!0,basefont:!0,br:!0,canvas:!0,datalist:!0,details:!0,dialog:!0,frameset:!0,head:!0,iframe:!0,img:!0,input:!0,link:!0,meta:!0,meter:!0,noembed:!0,noframes:!0,noscript:!0,optgroup:!0,param:!0,progress:!0,rp:!0,select:!0,style:!0,template:!0,textarea:!0,title:!0,video:!0,wbr:!0,embed:!0,frame:!0,keygen:!0,option:!0};return e.h=b,e.ktnull=i,e.notSupportTextNode=function(e){return _[e]},e}({});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>{throw new Error("kt.js: ".concat(e))},t=Array.isArray,n=Object.keys,o=Object.defineProperties,r=(e,t)=>o(e,{t:{value:t,configurable:!0}}),i=()=>({});"undefined"==typeof Promise&&(window.Promise={resolve:i,reject:i}),(()=>{const t="__ktjs__";if(t in window)return;const n=Object.create(null);o(n,{throws:{value:e,enumerable:!0},defines:{value:o,enumerable:!0},mark:{value:r,enumerable:!0}}),o(window,{[t]:{value:n,enumerable:!0}})})();const s=Object.create(null),u=HTMLElement.prototype.appendChild,c=HTMLElement.prototype.append,a="function"==typeof c?function(...e){const t=e.filter(e=>e!==s);return c.apply(this,t)}:function(...e){if(e.length<50)for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n?u.call(this,document.createTextNode(n)):n!==s&&u.call(this,n)}else{const t=document.createDocumentFragment();for(let n=0;n<e.length;n++){const o=e[n];"string"==typeof o?u.call(t,document.createTextNode(o)):o!==s&&u.call(t,o)}u.call(this,t)}};function l(e,t,n){t in e?e[t]=!!n:e.setAttribute(t,n)}function f(e,t,n){t in e?e[t]=n:e.setAttribute(t,n)}const d={checked:l,selected:l,value:f,valueAsDate:f,valueAsNumber:f,defaultValue:f,defaultChecked:l,defaultSelected:l,disabled:l,readOnly:l,multiple:l,required:l,autofocus:l,open:l,controls:l,autoplay:l,loop:l,muted:l,defer:l,async:l,hidden:function(e,t,n){e.hidden=!!n}},m=function(e,t,n){return e.setAttribute(t,n)};function p(t,o){"string"==typeof o?t.className=o:"object"==typeof o&&null!==o?function(e,t){const o=t.class,r=t.style;if(void 0!==o&&(e.className=o,delete t.class),r){if("string"==typeof r)e.setAttribute("style",r);else if("object"==typeof r)for(const t in r)e.style[t]=r[t];delete t.style}const i=n(t);for(let n=i.length-1;n>=0;n--){const o=i[n],r=t[o];o.startsWith("@")?e.addEventListener(o.slice(1),r):"function"!=typeof r?(d[o]||m)(e,o,r):e.addEventListener(o,r)}void 0!==o&&(t.class=o),void 0!==r&&(t.style=r)}(t,o):e("__func__ attr must be an object.")}const b=(n,o="",r="")=>{"string"!=typeof n&&e("__func__ tagName must be a string.");const i=document.createElement(n);return p(i,o),function(e,n){t(n)?a.apply(e,n):a.call(e,n)}(i,r),i};r(b,"h");const y={area:!0,audio:!0,base:!0,basefont:!0,br:!0,canvas:!0,datalist:!0,details:!0,dialog:!0,frameset:!0,head:!0,iframe:!0,img:!0,input:!0,link:!0,meta:!0,meter:!0,noembed:!0,noframes:!0,noscript:!0,optgroup:!0,param:!0,progress:!0,rp:!0,select:!0,style:!0,template:!0,textarea:!0,title:!0,video:!0,wbr:!0,embed:!0,frame:!0,keygen:!0,option:!0};function _(e){return y[e]}export{b as h,s as ktnull,_ as notSupportTextNode};
|
|
1
|
+
const e=e=>{throw new Error("kt.js: ".concat(e))},t=Array.isArray,n=Object.keys,o=Object.defineProperties,r=(e,t)=>o(e,{t:{value:t,configurable:!0}}),i=()=>({});"undefined"==typeof Promise&&(window.Promise={resolve:i,reject:i}),(()=>{const t="__ktjs__";if(t in window)return;const n=Object.create(null);o(n,{throws:{value:e,enumerable:!0},defines:{value:o,enumerable:!0},mark:{value:r,enumerable:!0}}),o(window,{[t]:{value:n,enumerable:!0}})})();const s=Object.create(null),u=HTMLElement.prototype.appendChild,c=HTMLElement.prototype.append,a="function"==typeof c?function(...e){const t=e.filter(e=>e!==s);return c.apply(this,t)}:function(...e){if(e.length<50)for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n?u.call(this,document.createTextNode(n)):n!==s&&u.call(this,n)}else{const t=document.createDocumentFragment();for(let n=0;n<e.length;n++){const o=e[n];"string"==typeof o?u.call(t,document.createTextNode(o)):o!==s&&u.call(t,o)}u.call(this,t)}};function l(e,t,n){t in e?e[t]=!!n:e.setAttribute(t,n)}function f(e,t,n){t in e?e[t]=n:e.setAttribute(t,n)}const d={checked:l,selected:l,value:f,valueAsDate:f,valueAsNumber:f,defaultValue:f,defaultChecked:l,defaultSelected:l,disabled:l,readOnly:l,multiple:l,required:l,autofocus:l,open:l,controls:l,autoplay:l,loop:l,muted:l,defer:l,async:l,hidden:function(e,t,n){e.hidden=!!n}},m=function(e,t,n){return e.setAttribute(t,n)};function p(t,o){"string"==typeof o?t.className=o:"object"==typeof o&&null!==o?function(e,t){const o=t.class,r=t.style;if(void 0!==o&&(e.className=o,delete t.class),r){if("string"==typeof r)e.setAttribute("style",r);else if("object"==typeof r)for(const t in r)e.style[t]=r[t];delete t.style}const i=n(t);for(let n=i.length-1;n>=0;n--){const o=i[n],r=t[o];o.startsWith("@")?e.addEventListener(o.slice(1),r):"function"!=typeof r?(d[o]||m)(e,o,r):e.addEventListener(o,r)}void 0!==o&&(t.class=o),void 0!==r&&(t.style=r)}(t,o):e("__func__ attr must be an object.")}const b=(n,o="",r="")=>{"string"!=typeof n&&e("__func__ tagName must be a string.");const i=document.createElement(n);return p(i,o),function(e,n){t(n)?a.apply(e,n):"number"==typeof n?a.call(e,n.toString()):a.call(e,n)}(i,r),i};r(b,"h");const y={area:!0,audio:!0,base:!0,basefont:!0,br:!0,canvas:!0,datalist:!0,details:!0,dialog:!0,frameset:!0,head:!0,iframe:!0,img:!0,input:!0,link:!0,meta:!0,meter:!0,noembed:!0,noframes:!0,noscript:!0,optgroup:!0,param:!0,progress:!0,rp:!0,select:!0,style:!0,template:!0,textarea:!0,title:!0,video:!0,wbr:!0,embed:!0,frame:!0,keygen:!0,option:!0};function _(e){return y[e]}export{b as h,s as ktnull,_ as notSupportTextNode};
|