waibu-mpa 2.6.3 → 2.6.4

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.
@@ -190,8 +190,9 @@ class Wmpa {
190
190
  }
191
191
  }
192
192
 
193
- createComponentFromHtml = (html, wrapper) => {
193
+ createComponentFromHtml = (html, wrapper, returnText) => {
194
194
  if (wrapper) html = '<' + wrapper + '>' + html + '</' + wrapper + '>'
195
+ if (returnText) return html
195
196
  const tpl = document.createElement('template')
196
197
  tpl.innerHTML = html
197
198
  return tpl.content.firstElementChild
@@ -204,7 +205,7 @@ class Wmpa {
204
205
  createComponent = async (body, wrapper, opts = {}) => {
205
206
  if (_.isArray(body)) body = body.join('\n')
206
207
  const html = await this.fetchRender(body, opts)
207
- return this.createComponentFromHtml(html, wrapper)
208
+ return this.createComponentFromHtml(html, wrapper, opts.returnText)
208
209
  }
209
210
 
210
211
  replaceWithComponentHtml = (html, selector, wrapper) => {
@@ -241,9 +242,12 @@ class Wmpa {
241
242
  else cmp = body
242
243
  const el = this.getElement(selector)
243
244
  if (!el) return
245
+ /*
244
246
  if (checkChild) {
245
247
  if (!el.hasChildNodes()) el.appendChild(cmp)
246
248
  } else el.appendChild(cmp)
249
+ */
250
+ el.appendChild(cmp)
247
251
  return cmp.getAttribute('id')
248
252
  }
249
253
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-mpa",
3
- "version": "2.6.3",
3
+ "version": "2.6.4",
4
4
  "description": "MPA support for Waibu Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-03-03
4
+
5
+ - [2.6.4] Bug fix on ```wmpa.addComponent()```
6
+
3
7
  ## 2026-03-02
4
8
 
5
9
  - [2.6.3] Bug fix on ```applyFormat()```. In ```dev``` environment, prettier & minifier should be disabled