@erickxavier/no-js 1.9.0 → 1.9.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/dist/cjs/no.js +5 -5
- package/dist/cjs/no.js.map +3 -3
- package/dist/esm/no.js +5 -5
- package/dist/esm/no.js.map +3 -3
- package/dist/iife/no.js +5 -5
- package/dist/iife/no.js.map +3 -3
- package/package.json +1 -1
- package/src/directives/loops.js +18 -0
- package/src/evaluate.js +1 -0
- package/src/i18n.js +4 -4
- package/src/index.js +1 -1
package/package.json
CHANGED
package/src/directives/loops.js
CHANGED
|
@@ -146,6 +146,24 @@ registerDirective("foreach", {
|
|
|
146
146
|
? null // Will use external template
|
|
147
147
|
: el.cloneNode(true); // Use the element itself as template
|
|
148
148
|
|
|
149
|
+
// Prevent infinite recursion: strip directive attributes from inline template clone
|
|
150
|
+
if (templateContent) {
|
|
151
|
+
templateContent.removeAttribute("foreach");
|
|
152
|
+
templateContent.removeAttribute("from");
|
|
153
|
+
templateContent.removeAttribute("index");
|
|
154
|
+
templateContent.removeAttribute("filter");
|
|
155
|
+
templateContent.removeAttribute("sort");
|
|
156
|
+
templateContent.removeAttribute("limit");
|
|
157
|
+
templateContent.removeAttribute("offset");
|
|
158
|
+
templateContent.removeAttribute("else");
|
|
159
|
+
templateContent.removeAttribute("template");
|
|
160
|
+
templateContent.removeAttribute("animate-enter");
|
|
161
|
+
templateContent.removeAttribute("animate");
|
|
162
|
+
templateContent.removeAttribute("animate-leave");
|
|
163
|
+
templateContent.removeAttribute("animate-stagger");
|
|
164
|
+
templateContent.removeAttribute("animate-duration");
|
|
165
|
+
}
|
|
166
|
+
|
|
149
167
|
function update() {
|
|
150
168
|
let list = resolve(fromPath, ctx);
|
|
151
169
|
if (!Array.isArray(list)) return;
|
package/src/evaluate.js
CHANGED
package/src/i18n.js
CHANGED
|
@@ -21,7 +21,7 @@ export function _notifyI18n() {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// ─── Deep merge (recursive, returns new object) ─────────────────────
|
|
24
|
-
|
|
24
|
+
function _deepMerge(target, source) {
|
|
25
25
|
const out = { ...target };
|
|
26
26
|
for (const key of Object.keys(source)) {
|
|
27
27
|
if (
|
|
@@ -37,11 +37,11 @@ export function _deepMerge(target, source) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// ─── Locale file cache: Map<string, object> key = "en" or "en:dashboard"
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const _i18nCache = new Map();
|
|
41
|
+
const _loadedNs = new Set();
|
|
42
42
|
|
|
43
43
|
// ─── Fetch a single JSON file and merge into _i18n.locales[locale] ──
|
|
44
|
-
|
|
44
|
+
async function _loadLocale(locale, ns) {
|
|
45
45
|
const cacheKey = ns ? `${locale}:${ns}` : locale;
|
|
46
46
|
if (_config.i18n.cache && _i18nCache.has(cacheKey)) return;
|
|
47
47
|
|