@daz4126/helium 0.28.0 → 0.30.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/helium.js +5 -3
- package/package.json +1 -1
package/helium.js
CHANGED
|
@@ -43,8 +43,9 @@ window.helium = async function() {
|
|
|
43
43
|
const element = target instanceof Node ? target : (HELIUM.refs.get(target.trim()) || $(target.trim()));
|
|
44
44
|
if(element){
|
|
45
45
|
const content = template ? template(data) : data;
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const htmlContent = html(content)
|
|
47
|
+
actions[i] ? element[actions[i]=="replace"?"replaceWith":actions[i]](htmlContent) : element.innerHTML = content;
|
|
48
|
+
newTargets.push(actions[i] ? htmlContent : element)
|
|
48
49
|
} else state[target] = data
|
|
49
50
|
})
|
|
50
51
|
return newTargets
|
|
@@ -200,8 +201,9 @@ async function processElements(element) {
|
|
|
200
201
|
const importAttr = el.getAttribute("@import") || el.getAttribute("data-he-import");
|
|
201
202
|
if (importAttr) {
|
|
202
203
|
importAttr.split(",").map((m) => m.trim()).forEach((moduleName) => {
|
|
204
|
+
const path = "helium_modules/" + moduleName;
|
|
203
205
|
importPromises.push(
|
|
204
|
-
import(
|
|
206
|
+
import(path)
|
|
205
207
|
.then((module) => {
|
|
206
208
|
Object.keys(module).forEach(
|
|
207
209
|
(key) => (state[key] = module[key]),
|