kt.js 0.0.1
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/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/index.mjs +1 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 kasukabe tsumugi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# KT.js
|
|
2
|
+
|
|
3
|
+
(still developing)
|
|
4
|
+
|
|
5
|
+
(image wait to be placed here)
|
|
6
|
+
|
|
7
|
+
## Philosophy: No Forced Repaint
|
|
8
|
+
|
|
9
|
+
KT.js is designed with a simple but radical philosophy: **never repaint unless absolutely necessary**. Unlike most frontend frameworks that rely on frequent DOM diffing and re-rendering, KT.js believes in minimal DOM operations and maximum stability.
|
|
10
|
+
|
|
11
|
+
- **Direct DOM Manipulation**: KT.js works with the DOM as it is, updating only what truly needs to change. No virtual DOM, no diffing, no hidden magic.
|
|
12
|
+
- **Predictable UI**: Your UI remains stable and predictable. If you don't explicitly change something, KT.js won't touch it.
|
|
13
|
+
- **Performance First**: By avoiding unnecessary redraws, KT.js achieves high performance, especially in complex or dynamic interfaces.
|
|
14
|
+
- **Developer Control**: You decide when and what to update. KT.js gives you the tools, not the rules.
|
|
15
|
+
|
|
16
|
+
> "Just don't repaint. Let the DOM be."
|
|
17
|
+
|
|
18
|
+
KT.js is for developers who want full control, minimal abstraction, and a framework that respects the browser's native strengths.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
For API details and usage, see the documentation and examples in the `example/` folder.
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class t extends Error{reason;filename;line;column;source;constructor(t,n,e,s,i){super(`${t}:${e}:${s}: ${n}`),this.reason=n,this.filename=t,this.line=e,this.column=s,this.source=i}}class n{start;end;source;constructor(t,n,e){this.start=t,this.end=n,this.source=e}}var e;!function(t){t.stylesheet="stylesheet",t.rule="rule",t.declaration="declaration",t.comment="comment",t.container="container",t.charset="charset",t.document="document",t.customMedia="custom-media",t.fontFace="font-face",t.host="host",t.import="import",t.keyframes="keyframes",t.keyframe="keyframe",t.layer="layer",t.media="media",t.namespace="namespace",t.page="page",t.startingStyle="starting-style",t.supports="supports"}(e||(e={}));const s=(t,n,e)=>{let s=e,i=1e4;do{const e=n.map(n=>t.indexOf(n,s));e.push(t.indexOf("\\",s));const r=e.filter(t=>-1!==t);if(0===r.length)return-1;const o=Math.min(...r);if("\\"!==t[o])return o;s=o+2,i--}while(i>0);throw new Error("Too many escaping")},i=(t,n,e)=>{let r=e,o=1e4;do{const e=n.map(n=>t.indexOf(n,r));e.push(t.indexOf("(",r)),e.push(t.indexOf('"',r)),e.push(t.indexOf("'",r)),e.push(t.indexOf("\\",r));const c=e.filter(t=>-1!==t);if(0===c.length)return-1;const h=Math.min(...c);switch(t[h]){case"\\":r=h+2;break;case"(":{const n=i(t,[")"],h+1);if(-1===n)return-1;r=n+1}break;case'"':{const n=s(t,['"'],h+1);if(-1===n)return-1;r=n+1}break;case"'":{const n=s(t,["'"],h+1);if(-1===n)return-1;r=n+1}break;default:return h}o--}while(o>0);throw new Error("Too many escaping")},r=/\/\*[^]*?(?:\*\/|$)/g;function o(t){return t?t.trim():""}function c(t,n){const e=t&&"string"==typeof t.type,s=e?t:n;for(const n in t){const e=t[n];Array.isArray(e)?e.forEach(t=>{c(t,s)}):e&&"object"==typeof e&&c(e,s)}return e&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null}),t}class h{level=0;indentation=" ";compress=!1;constructor(t){"string"==typeof t?.indent&&(this.indentation=t?.indent),t?.compress&&(this.compress=!0)}emit(t,n){return t}indent(t){return this.level=this.level||1,t?(this.level+=t,""):Array(this.level).join(this.indentation)}visit(t){switch(t.type){case e.stylesheet:return this.stylesheet(t);case e.rule:return this.rule(t);case e.declaration:return this.declaration(t);case e.comment:return this.comment(t);case e.container:return this.container(t);case e.charset:return this.charset(t);case e.document:return this.document(t);case e.customMedia:return this.customMedia(t);case e.fontFace:return this.fontFace(t);case e.host:return this.host(t);case e.import:return this.import(t);case e.keyframes:return this.keyframes(t);case e.keyframe:return this.keyframe(t);case e.layer:return this.layer(t);case e.media:return this.media(t);case e.namespace:return this.namespace(t);case e.page:return this.page(t);case e.startingStyle:return this.startingStyle(t);case e.supports:return this.supports(t)}}mapVisit(t,n){let e="";n=n||"";for(let s=0,i=t.length;s<i;s++)e+=this.visit(t[s]),n&&s<i-1&&(e+=this.emit(n));return e}compile(t){return this.compress?t.stylesheet.rules.map(this.visit,this).join(""):this.stylesheet(t)}stylesheet(t){return this.mapVisit(t.stylesheet.rules,"\n\n")}comment(t){return this.compress?this.emit("",t.position):this.emit(`${this.indent()}/*${t.comment}*/`,t.position)}container(t){return this.compress?this.emit(`@container ${t.container}`,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):this.emit(`${this.indent()}@container ${t.container}`,t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}layer(t){return this.compress?this.emit(`@layer ${t.layer}`,t.position)+(t.rules?this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):";"):this.emit(`${this.indent()}@layer ${t.layer}`,t.position)+(t.rules?this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`\n${this.indent(-1)}${this.indent()}}`):";")}import(t){return this.emit(`@import ${t.import};`,t.position)}media(t){return this.compress?this.emit(`@media ${t.media}`,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):this.emit(`${this.indent()}@media ${t.media}`,t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}document(t){const n=`@${t.vendor||""}document ${t.document}`;return this.compress?this.emit(n,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):this.emit(n,t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`${this.indent(-1)}\n}`)}charset(t){return this.emit(`@charset ${t.charset};`,t.position)}namespace(t){return this.emit(`@namespace ${t.namespace};`,t.position)}startingStyle(t){return this.compress?this.emit("@starting-style",t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):this.emit(`${this.indent()}@starting-style`,t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}supports(t){return this.compress?this.emit(`@supports ${t.supports}`,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):this.emit(`${this.indent()}@supports ${t.supports}`,t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}keyframes(t){return this.compress?this.emit(`@${t.vendor||""}keyframes ${t.name}`,t.position)+this.emit("{")+this.mapVisit(t.keyframes)+this.emit("}"):this.emit(`@${t.vendor||""}keyframes ${t.name}`,t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.keyframes,"\n")+this.emit(`${this.indent(-1)}}`)}keyframe(t){const n=t.declarations;return this.compress?this.emit(t.values.join(","),t.position)+this.emit("{")+this.mapVisit(n)+this.emit("}"):this.emit(this.indent())+this.emit(t.values.join(", "),t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(n,"\n")+this.emit(`${this.indent(-1)}\n${this.indent()}}\n`)}page(t){if(this.compress){const n=t.selectors.length?t.selectors.join(", "):"";return this.emit(`@page ${n}`,t.position)+this.emit("{")+this.mapVisit(t.declarations)+this.emit("}")}const n=t.selectors.length?`${t.selectors.join(", ")} `:"";return this.emit(`@page ${n}`,t.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(t.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")}fontFace(t){return this.compress?this.emit("@font-face",t.position)+this.emit("{")+this.mapVisit(t.declarations)+this.emit("}"):this.emit("@font-face ",t.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(t.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")}host(t){return this.compress?this.emit("@host",t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}"):this.emit("@host",t.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t.rules,"\n\n")+this.emit(`${this.indent(-1)}\n}`)}customMedia(t){return this.emit(`@custom-media ${t.name} ${t.media};`,t.position)}rule(t){const n=t.declarations;if(!n.length)return"";if(this.compress)return this.emit(t.selectors.join(","),t.position)+this.emit("{")+this.mapVisit(n)+this.emit("}");const e=this.indent();return this.emit(t.selectors.map(t=>e+t).join(",\n"),t.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit(`\n${this.indent()}}`)}declaration(t){return this.compress?this.emit(`${t.property}:${t.value}`,t.position)+this.emit(";"):"grid-template-areas"===t.property?this.emit(this.indent())+this.emit(t.property+": "+t.value.split("\n").join("\n".padEnd(22)+this.indent()),t.position)+this.emit(";"):this.emit(this.indent())+this.emit(`${t.property}: ${t.value}`,t.position)+this.emit(";")}}const u=(s,h)=>{h=h||{};let u=1,a=1;function f(){const t={line:u,column:a};return e=>(e.position=new n(t,{line:u,column:a},h?.source||""),$(),e)}const l=[];function m(n){const e=new t(h?.source||"",n,u,a,s);if(!h?.silent)throw e;l.push(e)}function p(){const t=/^{\s*/.exec(s);return!!t&&(g(t),!0)}function d(){const t=/^}/.exec(s);return!!t&&(g(t),!0)}function y(){let t;const n=[];for($(),E(n);s.length&&"}"!==s.charAt(0)&&(t=S()||j(),t);)n.push(t),E(n);return n}function g(t){const n=t[0];return function(t){const n=t.match(/\n/g);n&&(u+=n.length);const e=t.lastIndexOf("\n");a=~e?t.length-e:a+t.length}(n),s=s.slice(n.length),t}function $(){const t=/^\s*/.exec(s);t&&g(t)}function E(t){t=t||[];let n=T();for(;n;)t.push(n),n=T();return t}function T(){const t=f();if("/"!==s.charAt(0)||"*"!==s.charAt(1))return;const n=/^\/\*[^]*?\*\//.exec(s);return n?(g(n),t({type:e.comment,comment:n[0].slice(2,-2)})):m("End of comment missing")}function L(){const t=/^([^{]+)/.exec(s);if(t)return g(t),((t,n)=>{const e=[];let s=0;for(;s<t.length;){const r=i(t,n,s);if(-1===r)return e.push(t.substring(s)),e;e.push(t.substring(s,r)),s=r+1}return e})(o(t[0]).replace(r,""),[","]).map(t=>o(t))}function M(){const t=f(),n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(s);if(!n)return;g(n);const c=o(n[0]),h=/^:\s*/.exec(s);if(!h)return m("property missing ':'");g(h);let u="";const a=i(s,[";","}"]);-1!==a&&(u=s.substring(0,a),g([u]),u=o(u).replace(r,""));const l=t({type:e.declaration,property:c.replace(r,""),value:u}),p=/^[;\s]*/.exec(s);return p&&g(p),l}function H(){const t=[];if(!p())return m("missing '{'");E(t);let n=M();for(;n;)t.push(n),E(t),n=M();return d()?t:m("missing '}'")}function w(){const t=[],n=f();let i=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(s);for(;i;){const n=g(i);t.push(n[1]);const e=/^,\s*/.exec(s);e&&g(e),i=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(s)}if(t.length)return n({type:e.keyframe,values:t,declarations:H()||[]})}const b=B("import"),v=B("charset"),k=B("namespace");function B(t){const n=new RegExp("^@"+t+"\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");return()=>{const e=f(),i=n.exec(s);if(!i)return;const r=g(i),o={type:t};return o[t]=r[1].trim(),e(o)}}function S(){if("@"===s[0])return function(){const t=f(),n=/^@([-\w]+)?keyframes\s*/.exec(s);if(!n)return;const i=g(n)[1],r=/^([-\w]+)\s*/.exec(s);if(!r)return m("@keyframes missing name");const o=g(r)[1];if(!p())return m("@keyframes missing '{'");let c=E(),h=w();for(;h;)c.push(h),c=c.concat(E()),h=w();return d()?t({type:e.keyframes,name:o,vendor:i,keyframes:c}):m("@keyframes missing '}'")}()||function(){const t=f(),n=/^@media *([^{]+)/.exec(s);if(!n)return;const i=o(g(n)[1]);if(!p())return m("@media missing '{'");const r=E().concat(y());return d()?t({type:e.media,media:i,rules:r}):m("@media missing '}'")}()||function(){const t=f(),n=/^@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/.exec(s);if(!n)return;const i=g(n);return t({type:e.customMedia,name:o(i[1]),media:o(i[2])})}()||function(){const t=f(),n=/^@supports *([^{]+)/.exec(s);if(!n)return;const i=o(g(n)[1]);if(!p())return m("@supports missing '{'");const r=E().concat(y());return d()?t({type:e.supports,supports:i,rules:r}):m("@supports missing '}'")}()||b()||v()||k()||function(){const t=f(),n=/^@([-\w]+)?document *([^{]+)/.exec(s);if(!n)return;const i=g(n),r=o(i[1]),c=o(i[2]);if(!p())return m("@document missing '{'");const h=E().concat(y());return d()?t({type:e.document,document:c,vendor:r,rules:h}):m("@document missing '}'")}()||function(){const t=f(),n=/^@page */.exec(s);if(!n)return;g(n);const i=L()||[];if(!p())return m("@page missing '{'");let r=E(),o=M();for(;o;)r.push(o),r=r.concat(E()),o=M();return d()?t({type:e.page,selectors:i,declarations:r}):m("@page missing '}'")}()||function(){const t=f(),n=/^@host\s*/.exec(s);if(!n)return;if(g(n),!p())return m("@host missing '{'");const i=E().concat(y());return d()?t({type:e.host,rules:i}):m("@host missing '}'")}()||function(){const t=f(),n=/^@font-face\s*/.exec(s);if(!n)return;if(g(n),!p())return m("@font-face missing '{'");let i=E(),r=M();for(;r;)i.push(r),i=i.concat(E()),r=M();return d()?t({type:e.fontFace,declarations:i}):m("@font-face missing '}'")}()||function(){const t=f(),n=/^@container *([^{]+)/.exec(s);if(!n)return;const i=o(g(n)[1]);if(!p())return m("@container missing '{'");const r=E().concat(y());return d()?t({type:e.container,container:i,rules:r}):m("@container missing '}'")}()||function(){const t=f(),n=/^@starting-style\s*/.exec(s);if(!n)return;if(g(n),!p())return m("@starting-style missing '{'");const i=E().concat(y());return d()?t({type:e.startingStyle,rules:i}):m("@starting-style missing '}'")}()||function(){const t=f(),n=/^@layer *([^{;@]+)/.exec(s);if(!n)return;const i=o(g(n)[1]);if(!p()){const n=/^[;\s]*/.exec(s);return n&&g(n),t({type:e.layer,layer:i})}const r=E().concat(y());return d()?t({type:e.layer,layer:i,rules:r}):m("@layer missing '}'")}()}function j(){const t=f(),n=L();return n?(E(),t({type:e.rule,selectors:n,declarations:H()||[]})):m("selector missing")}return c(function(){const t=y();return{type:e.stylesheet,stylesheet:{source:h?.source,rules:t,parsingErrors:l}}}())},a=Reflect.apply,f=Reflect.get,l=Reflect.defineProperty,m=Array.isArray,p=Object.keys,d=Object.assign,y=Object.is,g=Number.isSafeInteger,$=t=>"object"==typeof t&&null!==t,E=document.createElement.bind(document),T=document.createTextNode.bind(document);function L(t,n){const e=[];for(let s=0;s<t.length;s++)e.push(t[s]),s<n.length&&e.push(String(n[s]));return e.join("").replace(/\r\n/g,"\n").trim()}function M(t,...n){return L(t,n)}function H(t){return function(n,...s){const i=L(n,s),r=u(i),o=n=>{if(!$(n))return;n.type===e.rule&&(n.selectors=n.selectors.map(n=>`[${t}]${n}`));const s=p(n),i=s.length;for(let t=0;t<i;t++){const e=f(n,s[t]);if(m(e)){const t=e.length;for(let n=0;n<t;n++)o(e[n]);continue}$(e)&&o(e)}};o(r);const c=((t,n)=>new h(n||{}).compile(t))(r);return c}}class w extends(null){static kid=0;static scopeIndex=0;static genScopeName(){return"data-k-"+(++w.scopeIndex).toString(36).padStart(6,"0")}static nextKid(){return++w.kid}}const b=Symbol(),v=Symbol();function k(t,n,e=v){if(y(e,v))return a(addEventListener,this,[t,n]),n;if(!$(e)||!("triggerLimit"in e))return a(addEventListener,this,[t,n,e]),n;const s=e.triggerLimit;if(delete e.triggerLimit,!g(s)||s<=0)throw new TypeError("[Kt.js:kon] options.triggerLimit must be a positive safe integer.");if(1===s)return e.once=!0,a(addEventListener,this,[t,n,e]),n;let i=s;const r=function(s){const o=a(n,this,[s]);return i--,i<=0&&a(removeEventListener,this,[t,r,e]),o};return a(addEventListener,this,[t,r,e]),r}function B(t,n,e=v){y(v,e)?a(removeEventListener,this,[t,n]):a(removeEventListener,this,[t,n,e])}function S(t){return t.appendChild(this)}function j(t,n="",e=""){if("string"!=typeof t)throw new TypeError("[Kt.js:h] tagName must be a string.");if("string"!=typeof n&&!$(n))throw new TypeError("[Kt.js:h] attr must be an object.");if("string"!=typeof e&&!$(e)&&!m(e))throw new TypeError("[Kt.js:h] content must be a string or an array of html elements.");const s=E(t);if(l(s,"kid",{value:w.nextKid(),enumerable:!0}),l(s,b,{value:!0}),s.kon=k,s.koff=B,s.kmount=S,"string"==typeof e){const t=T(e);s.appendChild(t)}else if(m(e)){const t=e.length;for(let n=0;n<t;n++){const t=e[n];if("string"!=typeof t){if(!(b in t))throw new TypeError("[Kt.js:h] content must be a string or an array of HTMLEnhancedElement.");s.appendChild(t)}else s.appendChild(T(t))}}else b in e&&s.appendChild(e);if(!n)return s;if("string"==typeof n)return s.className=n,s;n.class&&(m(n.class)?s.classList.add(...n.class):s.className=n.class,delete n.class),n.style&&("string"==typeof n.style?s.setAttribute("style",n.style):d(s.style,n.style),delete n.style);const i=p(n),r=i.length;for(let t=0;t<r;t++){const e=i[t],r=n[e];"function"!=typeof r&&("checked"!==e?"value"!==e?"selected"!==e?"defaultValue"!==e?"defaultChecked"!==e?"defaultSelected"!==e?"disabled"!==e?"readOnly"!==e?"multiple"!==e?"autofocus"!==e?"required"!==e?"hidden"!==e?"open"===e&&s instanceof HTMLDetailsElement?s.open=Boolean(r):"controls"===e&&s instanceof HTMLMediaElement?s.controls=Boolean(r):"autoplay"===e&&s instanceof HTMLMediaElement?s.autoplay=Boolean(r):"loop"===e&&s instanceof HTMLMediaElement?s.loop=Boolean(r):"muted"===e&&s instanceof HTMLMediaElement?s.muted=Boolean(r):"defer"===e&&s instanceof HTMLScriptElement?s.defer=Boolean(r):"async"===e&&s instanceof HTMLScriptElement?s.async=Boolean(r):s.setAttribute(e,r):s.hidden=Boolean(r):s instanceof HTMLInputElement||s instanceof HTMLSelectElement||s instanceof HTMLTextAreaElement?s.required=Boolean(r):s.setAttribute(e,r):s instanceof HTMLInputElement||s instanceof HTMLButtonElement||s instanceof HTMLSelectElement||s instanceof HTMLTextAreaElement?s.autofocus=Boolean(r):s.setAttribute(e,r):s instanceof HTMLSelectElement?s.multiple=Boolean(r):s.setAttribute(e,r):s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement?s.readOnly=Boolean(r):s.setAttribute(e,r):s instanceof HTMLInputElement||s instanceof HTMLButtonElement||s instanceof HTMLSelectElement||s instanceof HTMLOptGroupElement||s instanceof HTMLOptionElement||s instanceof HTMLFieldSetElement||s instanceof HTMLTextAreaElement?s.disabled=Boolean(r):s.setAttribute(e,r):s instanceof HTMLOptionElement?s.defaultSelected=Boolean(r):s.setAttribute(e,r):s instanceof HTMLInputElement?s.defaultChecked=Boolean(r):s.setAttribute(e,r):s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement?s.defaultValue=String(r):s.setAttribute(e,r):s instanceof HTMLOptionElement?s.selected=Boolean(r):s.setAttribute(e,r):s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement?s.value=String(r):s.setAttribute(e,r):s instanceof HTMLInputElement?s.checked=Boolean(r):s.setAttribute(e,r))}return s}function x(t){return function(...n){const e=j(...n);return e.setAttribute(t,""),e}}function A(t=w.genScopeName()){return{h:x(t),css:H(t)}}export{M as css,j as h,A as useScope};
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kt.js",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Kasukabe Tsumugi",
|
|
6
|
+
"email": "futami16237@gmail.com"
|
|
7
|
+
},
|
|
8
|
+
"purpose": "npm",
|
|
9
|
+
"description": "A simple and easy-to-use web framework, never re-render. Abbreviation of Kasukabe Tsumugi.",
|
|
10
|
+
"description_zh": "KT.js,简单易用,never重绘。取自Kasukabe Tsumugi的首字母。",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.mjs",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.mjs",
|
|
18
|
+
"require": "./dist/index.cjs",
|
|
19
|
+
"default": "./dist/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"homepage": "https://github.com/baendlorel/kt.js#readme",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/baendlorel/kt.js"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"framework",
|
|
31
|
+
"web",
|
|
32
|
+
"typescript",
|
|
33
|
+
"javascript"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"test": "clear & vitest",
|
|
37
|
+
"lint": "oxlint .",
|
|
38
|
+
"cover": "clear & vitest --coverage",
|
|
39
|
+
"build": "node ./scripts/rollup.mjs"
|
|
40
|
+
},
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@babel/plugin-proposal-decorators": "^7.28.0",
|
|
44
|
+
"@babel/preset-env": "^7.28.3",
|
|
45
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
46
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
47
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
48
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
49
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
50
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
51
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
52
|
+
"@types/node": "^24.5.1",
|
|
53
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
54
|
+
"jsdom": "^27.0.0",
|
|
55
|
+
"oxlint": "^1.16.0",
|
|
56
|
+
"prettier": "^3.6.2",
|
|
57
|
+
"rimraf": "^6.0.1",
|
|
58
|
+
"rollup": "^4.50.2",
|
|
59
|
+
"rollup-plugin-dts": "^6.2.3",
|
|
60
|
+
"rollup-plugin-dts-merger": "^1.2.4",
|
|
61
|
+
"tinyrainbow": "^3.0.3",
|
|
62
|
+
"tslib": "^2.8.1",
|
|
63
|
+
"typescript": "^5.9.2",
|
|
64
|
+
"vitest": "^3.2.4"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@adobe/css-tools": "^4.4.4"
|
|
68
|
+
}
|
|
69
|
+
}
|