@ktjs/core 0.15.4 → 0.15.5

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
@@ -150,7 +150,7 @@ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGEl
150
150
  * ## About
151
151
  * @package @ktjs/core
152
152
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
153
- * @version 0.15.4 (Last Update: 2026.01.25 14:47:00.746)
153
+ * @version 0.15.5 (Last Update: 2026.01.25 18:25:48.373)
154
154
  * @license MIT
155
155
  * @link https://github.com/baendlorel/kt.js
156
156
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -195,7 +195,6 @@ 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/2000/svg', tag);
199
198
  let creator = defaultCreator;
200
199
  /**
201
200
  * Create an enhanced HTMLElement.
@@ -207,7 +206,7 @@ var __ktjs_core__ = (function (exports) {
207
206
  * ## About
208
207
  * @package @ktjs/core
209
208
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
210
- * @version 0.15.4 (Last Update: 2026.01.25 14:47:00.746)
209
+ * @version 0.15.5 (Last Update: 2026.01.25 18:25:48.373)
211
210
  * @license MIT
212
211
  * @link https://github.com/baendlorel/kt.js
213
212
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -218,16 +217,16 @@ var __ktjs_core__ = (function (exports) {
218
217
  if (typeof tag !== 'string') {
219
218
  $throw('tagName must be a string.');
220
219
  }
221
- let lastCreator = creator;
222
- if (tag === 'svg') {
223
- creator = svgCreator;
224
- }
225
220
  // * start creating the element
226
221
  const element = creator(tag);
227
222
  // * Handle content
228
223
  applyAttr(element, attr);
229
224
  applyContent(element, content);
230
- creator = lastCreator; // restore previous creator
225
+ if (tag === 'svg') {
226
+ const div = document.createElement('div');
227
+ div.innerHTML = element.outerHTML;
228
+ return div.firstChild;
229
+ }
231
230
  return element;
232
231
  };
233
232
 
@@ -220,7 +220,6 @@ 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/2000/svg', tag); };
224
223
  var creator = defaultCreator;
225
224
  /**
226
225
  * Create an enhanced HTMLElement.
@@ -232,7 +231,7 @@ var __ktjs_core__ = (function (exports) {
232
231
  * ## About
233
232
  * @package @ktjs/core
234
233
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
235
- * @version 0.15.4 (Last Update: 2026.01.25 14:47:00.746)
234
+ * @version 0.15.5 (Last Update: 2026.01.25 18:25:48.373)
236
235
  * @license MIT
237
236
  * @link https://github.com/baendlorel/kt.js
238
237
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -243,16 +242,16 @@ var __ktjs_core__ = (function (exports) {
243
242
  if (typeof tag !== 'string') {
244
243
  $throw('tagName must be a string.');
245
244
  }
246
- var lastCreator = creator;
247
- if (tag === 'svg') {
248
- creator = svgCreator;
249
- }
250
245
  // * start creating the element
251
246
  var element = creator(tag);
252
247
  // * Handle content
253
248
  applyAttr(element, attr);
254
249
  applyContent(element, content);
255
- creator = lastCreator; // restore previous creator
250
+ if (tag === 'svg') {
251
+ var div = document.createElement('div');
252
+ div.innerHTML = element.outerHTML;
253
+ return div.firstChild;
254
+ }
256
255
  return element;
257
256
  };
258
257
 
package/dist/index.mjs CHANGED
@@ -192,7 +192,6 @@ 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/2000/svg', tag);
196
195
  let creator = defaultCreator;
197
196
  /**
198
197
  * Create an enhanced HTMLElement.
@@ -204,7 +203,7 @@ let creator = defaultCreator;
204
203
  * ## About
205
204
  * @package @ktjs/core
206
205
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
207
- * @version 0.15.4 (Last Update: 2026.01.25 14:47:00.746)
206
+ * @version 0.15.5 (Last Update: 2026.01.25 18:25:48.373)
208
207
  * @license MIT
209
208
  * @link https://github.com/baendlorel/kt.js
210
209
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -215,16 +214,16 @@ const h = (tag, attr, content) => {
215
214
  if (typeof tag !== 'string') {
216
215
  $throw('tagName must be a string.');
217
216
  }
218
- let lastCreator = creator;
219
- if (tag === 'svg') {
220
- creator = svgCreator;
221
- }
222
217
  // * start creating the element
223
218
  const element = creator(tag);
224
219
  // * Handle content
225
220
  applyAttr(element, attr);
226
221
  applyContent(element, content);
227
- creator = lastCreator; // restore previous creator
222
+ if (tag === 'svg') {
223
+ const div = document.createElement('div');
224
+ div.innerHTML = element.outerHTML;
225
+ return div.firstChild;
226
+ }
228
227
  return element;
229
228
  };
230
229
 
@@ -136,7 +136,7 @@ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGEl
136
136
  * ## About
137
137
  * @package @ktjs/core
138
138
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
139
- * @version 0.15.4 (Last Update: 2026.01.25 14:47:00.746)
139
+ * @version 0.15.5 (Last Update: 2026.01.25 18:25:48.373)
140
140
  * @license MIT
141
141
  * @link https://github.com/baendlorel/kt.js
142
142
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -192,7 +192,6 @@ 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/2000/svg', tag);
196
195
  let creator = defaultCreator;
197
196
  /**
198
197
  * Create an enhanced HTMLElement.
@@ -204,7 +203,7 @@ let creator = defaultCreator;
204
203
  * ## About
205
204
  * @package @ktjs/core
206
205
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
207
- * @version 0.15.4 (Last Update: 2026.01.25 14:47:00.746)
206
+ * @version 0.15.5 (Last Update: 2026.01.25 18:25:48.373)
208
207
  * @license MIT
209
208
  * @link https://github.com/baendlorel/kt.js
210
209
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -215,16 +214,16 @@ const h = (tag, attr, content) => {
215
214
  if (typeof tag !== 'string') {
216
215
  $throw('tagName must be a string.');
217
216
  }
218
- let lastCreator = creator;
219
- if (tag === 'svg') {
220
- creator = svgCreator;
221
- }
222
217
  // * start creating the element
223
218
  const element = creator(tag);
224
219
  // * Handle content
225
220
  applyAttr(element, attr);
226
221
  applyContent(element, content);
227
- creator = lastCreator; // restore previous creator
222
+ if (tag === 'svg') {
223
+ const div = document.createElement('div');
224
+ div.innerHTML = element.outerHTML;
225
+ return div.firstChild;
226
+ }
228
227
  return element;
229
228
  };
230
229
 
@@ -130,7 +130,7 @@ type HTML<T extends (HTMLTag | SVGTag) & otherstring> = T extends SVGTag ? SVGEl
130
130
  * ## About
131
131
  * @package @ktjs/core
132
132
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
133
- * @version 0.15.4 (Last Update: 2026.01.25 14:47:00.746)
133
+ * @version 0.15.5 (Last Update: 2026.01.25 18:25:48.373)
134
134
  * @license MIT
135
135
  * @link https://github.com/baendlorel/kt.js
136
136
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -192,7 +192,6 @@ 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/2000/svg', tag);
196
195
  let creator = defaultCreator;
197
196
  /**
198
197
  * Create an enhanced HTMLElement.
@@ -204,7 +203,7 @@ let creator = defaultCreator;
204
203
  * ## About
205
204
  * @package @ktjs/core
206
205
  * @author Kasukabe Tsumugi <futami16237@gmail.com>
207
- * @version 0.15.4 (Last Update: 2026.01.25 14:47:00.746)
206
+ * @version 0.15.5 (Last Update: 2026.01.25 18:25:48.373)
208
207
  * @license MIT
209
208
  * @link https://github.com/baendlorel/kt.js
210
209
  * @link https://baendlorel.github.io/ Welcome to my site!
@@ -215,16 +214,16 @@ const h = (tag, attr, content) => {
215
214
  if (typeof tag !== 'string') {
216
215
  $throw('tagName must be a string.');
217
216
  }
218
- let lastCreator = creator;
219
- if (tag === 'svg') {
220
- creator = svgCreator;
221
- }
222
217
  // * start creating the element
223
218
  const element = creator(tag);
224
219
  // * Handle content
225
220
  applyAttr(element, attr);
226
221
  applyContent(element, content);
227
- creator = lastCreator; // restore previous creator
222
+ if (tag === 'svg') {
223
+ const div = document.createElement('div');
224
+ div.innerHTML = element.outerHTML;
225
+ return div.firstChild;
226
+ }
228
227
  return element;
229
228
  };
230
229
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ktjs/core",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
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",