@ktjs/core 0.15.2 → 0.15.3

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 CHANGED
@@ -3,7 +3,8 @@ type otherstring = string & {};
3
3
  /**
4
4
  * Normal HTML tags like `div`, `span`, `a`, etc.
5
5
  */
6
- type HTMLTag = keyof HTMLElementTagNameMap & otherstring;
6
+ type HTMLTag = keyof HTMLElementTagNameMap;
7
+ type SVGTag = keyof SVGElementTagNameMap;
7
8
 
8
9
  interface KTRef<T> {
9
10
  value: T;
@@ -138,7 +139,7 @@ type KTComponent = (
138
139
  any,
139
140
  ) => KTHTMLElement | Promise<KTHTMLElement> | any;
140
141
 
141
- type HTML<T extends HTMLTag & otherstring> = T extends HTMLTag ? HTMLElementTagNameMap[T] : HTMLElement;
142
+ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGElementTagNameMap[T] : T extends HTMLTag ? HTMLElementTagNameMap[T] : HTMLElement;
142
143
  /**
143
144
  * Create an enhanced HTMLElement.
144
145
  * - Only supports HTMLElements, **NOT** SVGElements or other Elements.
@@ -149,14 +150,14 @@ type HTML<T extends HTMLTag & otherstring> = T extends HTMLTag ? HTMLElementTagN
149
150
  * ## About
150
151
  * @package @ktjs/core
151
152
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
152
- * @version 0.15.2 (Last Update: 2026.01.25 14:25:37.357)
153
+ * @version 0.15.3 (Last Update: 2026.01.25 14:39:33.442)
153
154
  * @license MIT
154
155
  * @link https://github.com/baendlorel/kt.js
155
156
  * @link https://baendlorel.github.io/ Welcome to my site!
156
157
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
157
158
  * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
158
159
  */
159
- declare const h: <T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent) => HTML<T>;
160
+ declare const h: <T extends HTMLTag | SVGTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent) => HTML<T>;
160
161
 
161
162
  type JSXTag = HTMLTag | ((props?: any) => HTMLElement) | ((props?: any) => Promise<HTMLElement>) | ((props?: any) => KTHTMLElement) | ((props?: any) => Promise<KTHTMLElement>);
162
163
  /**
@@ -195,7 +195,7 @@ var __ktjs_core__ = (function (exports) {
195
195
  }
196
196
 
197
197
  const defaultCreator = (tag) => document.createElement(tag);
198
- const svgCreator = (tag) => document.createElementNS('http://www.w3.org/1999/xhtml', tag);
198
+ const svgCreator = (tag) => document.createElementNS('http://www.w3.org/2000/svg', tag);
199
199
  let creator = defaultCreator;
200
200
  /**
201
201
  * Create an enhanced HTMLElement.
@@ -207,7 +207,7 @@ var __ktjs_core__ = (function (exports) {
207
207
  * ## About
208
208
  * @package @ktjs/core
209
209
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
210
- * @version 0.15.2 (Last Update: 2026.01.25 14:25:37.357)
210
+ * @version 0.15.3 (Last Update: 2026.01.25 14:39:33.442)
211
211
  * @license MIT
212
212
  * @link https://github.com/baendlorel/kt.js
213
213
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -220,7 +220,7 @@ var __ktjs_core__ = (function (exports) {
220
220
  }
221
221
 
222
222
  var defaultCreator = function (tag) { return document.createElement(tag); };
223
- var svgCreator = function (tag) { return document.createElementNS('http://www.w3.org/1999/xhtml', tag); };
223
+ var svgCreator = function (tag) { return document.createElementNS('http://www.w3.org/2000/svg', tag); };
224
224
  var creator = defaultCreator;
225
225
  /**
226
226
  * Create an enhanced HTMLElement.
@@ -232,7 +232,7 @@ var __ktjs_core__ = (function (exports) {
232
232
  * ## About
233
233
  * @package @ktjs/core
234
234
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
235
- * @version 0.15.2 (Last Update: 2026.01.25 14:25:37.357)
235
+ * @version 0.15.3 (Last Update: 2026.01.25 14:39:33.442)
236
236
  * @license MIT
237
237
  * @link https://github.com/baendlorel/kt.js
238
238
  * @link https://baendlorel.github.io/ Welcome to my site!
package/dist/index.mjs CHANGED
@@ -192,7 +192,7 @@ function applyContent(element, content) {
192
192
  }
193
193
 
194
194
  const defaultCreator = (tag) => document.createElement(tag);
195
- const svgCreator = (tag) => document.createElementNS('http://www.w3.org/1999/xhtml', tag);
195
+ const svgCreator = (tag) => document.createElementNS('http://www.w3.org/2000/svg', tag);
196
196
  let creator = defaultCreator;
197
197
  /**
198
198
  * Create an enhanced HTMLElement.
@@ -204,7 +204,7 @@ let creator = defaultCreator;
204
204
  * ## About
205
205
  * @package @ktjs/core
206
206
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
207
- * @version 0.15.2 (Last Update: 2026.01.25 14:25:37.357)
207
+ * @version 0.15.3 (Last Update: 2026.01.25 14:39:33.442)
208
208
  * @license MIT
209
209
  * @link https://github.com/baendlorel/kt.js
210
210
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -3,7 +3,8 @@ type otherstring = string & {};
3
3
  /**
4
4
  * Normal HTML tags like `div`, `span`, `a`, etc.
5
5
  */
6
- type HTMLTag = keyof HTMLElementTagNameMap & otherstring;
6
+ type HTMLTag = keyof HTMLElementTagNameMap;
7
+ type SVGTag = keyof SVGElementTagNameMap;
7
8
 
8
9
  interface KTRef<T> {
9
10
  value: T;
@@ -124,7 +125,7 @@ type KTSpecialEventHandlers = {
124
125
 
125
126
  type KTAttribute = KTBaseAttribute & KTPrefixedEventHandlers & KTSpecialEventHandlers;
126
127
 
127
- type HTML<T extends HTMLTag & otherstring> = T extends HTMLTag ? HTMLElementTagNameMap[T] : HTMLElement;
128
+ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGElementTagNameMap[T] : T extends HTMLTag ? HTMLElementTagNameMap[T] : HTMLElement;
128
129
  /**
129
130
  * Create an enhanced HTMLElement.
130
131
  * - Only supports HTMLElements, **NOT** SVGElements or other Elements.
@@ -135,14 +136,14 @@ type HTML<T extends HTMLTag & otherstring> = T extends HTMLTag ? HTMLElementTagN
135
136
  * ## About
136
137
  * @package @ktjs/core
137
138
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
138
- * @version 0.15.2 (Last Update: 2026.01.25 14:25:37.357)
139
+ * @version 0.15.3 (Last Update: 2026.01.25 14:39:33.442)
139
140
  * @license MIT
140
141
  * @link https://github.com/baendlorel/kt.js
141
142
  * @link https://baendlorel.github.io/ Welcome to my site!
142
143
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
143
144
  * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
144
145
  */
145
- declare const h: <T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent) => HTML<T>;
146
+ declare const h: <T extends HTMLTag | SVGTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent) => HTML<T>;
146
147
 
147
148
  type JSXTag = HTMLTag | ((props?: any) => HTMLElement) | ((props?: any) => Promise<HTMLElement>) | ((props?: any) => KTHTMLElement) | ((props?: any) => Promise<KTHTMLElement>);
148
149
  /**
@@ -192,7 +192,7 @@ function applyContent(element, content) {
192
192
  }
193
193
 
194
194
  const defaultCreator = (tag) => document.createElement(tag);
195
- const svgCreator = (tag) => document.createElementNS('http://www.w3.org/1999/xhtml', tag);
195
+ const svgCreator = (tag) => document.createElementNS('http://www.w3.org/2000/svg', tag);
196
196
  let creator = defaultCreator;
197
197
  /**
198
198
  * Create an enhanced HTMLElement.
@@ -204,7 +204,7 @@ let creator = defaultCreator;
204
204
  * ## About
205
205
  * @package @ktjs/core
206
206
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
207
- * @version 0.15.2 (Last Update: 2026.01.25 14:25:37.357)
207
+ * @version 0.15.3 (Last Update: 2026.01.25 14:39:33.442)
208
208
  * @license MIT
209
209
  * @link https://github.com/baendlorel/kt.js
210
210
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -3,7 +3,8 @@ type otherstring = string & {};
3
3
  /**
4
4
  * Normal HTML tags like `div`, `span`, `a`, etc.
5
5
  */
6
- type HTMLTag = keyof HTMLElementTagNameMap & otherstring;
6
+ type HTMLTag = keyof HTMLElementTagNameMap;
7
+ type SVGTag = keyof SVGElementTagNameMap;
7
8
 
8
9
  interface KTRef<T> {
9
10
  value: T;
@@ -118,7 +119,7 @@ type KTSpecialEventHandlers = {
118
119
 
119
120
  type KTAttribute = KTBaseAttribute & KTPrefixedEventHandlers & KTSpecialEventHandlers;
120
121
 
121
- type HTML<T extends HTMLTag & otherstring> = T extends HTMLTag ? HTMLElementTagNameMap[T] : HTMLElement;
122
+ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGElementTagNameMap[T] : T extends HTMLTag ? HTMLElementTagNameMap[T] : HTMLElement;
122
123
  /**
123
124
  * Create an enhanced HTMLElement.
124
125
  * - Only supports HTMLElements, **NOT** SVGElements or other Elements.
@@ -129,14 +130,14 @@ type HTML<T extends HTMLTag & otherstring> = T extends HTMLTag ? HTMLElementTagN
129
130
  * ## About
130
131
  * @package @ktjs/core
131
132
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
132
- * @version 0.15.2 (Last Update: 2026.01.25 14:25:37.357)
133
+ * @version 0.15.3 (Last Update: 2026.01.25 14:39:33.442)
133
134
  * @license MIT
134
135
  * @link https://github.com/baendlorel/kt.js
135
136
  * @link https://baendlorel.github.io/ Welcome to my site!
136
137
  * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
137
138
  * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved.
138
139
  */
139
- declare const h: <T extends HTMLTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent) => HTML<T>;
140
+ declare const h: <T extends HTMLTag | SVGTag>(tag: T, attr?: KTRawAttr, content?: KTRawContent) => HTML<T>;
140
141
 
141
142
  type JSXTag = HTMLTag | ((props?: any) => HTMLElement) | ((props?: any) => Promise<HTMLElement>) | ((props?: any) => KTHTMLElement) | ((props?: any) => Promise<KTHTMLElement>);
142
143
  /**
@@ -192,7 +192,7 @@ function applyContent(element, content) {
192
192
  }
193
193
 
194
194
  const defaultCreator = (tag) => document.createElement(tag);
195
- const svgCreator = (tag) => document.createElementNS('http://www.w3.org/1999/xhtml', tag);
195
+ const svgCreator = (tag) => document.createElementNS('http://www.w3.org/2000/svg', tag);
196
196
  let creator = defaultCreator;
197
197
  /**
198
198
  * Create an enhanced HTMLElement.
@@ -204,7 +204,7 @@ let creator = defaultCreator;
204
204
  * ## About
205
205
  * @package @ktjs/core
206
206
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
207
- * @version 0.15.2 (Last Update: 2026.01.25 14:25:37.357)
207
+ * @version 0.15.3 (Last Update: 2026.01.25 14:39:33.442)
208
208
  * @license MIT
209
209
  * @link https://github.com/baendlorel/kt.js
210
210
  * @link https://baendlorel.github.io/ Welcome to my site!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ktjs/core",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",