mnfst 0.5.28 → 0.5.30
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/manifest.data.js +20 -3
- package/dist/manifest.markdown.js +4 -3
- package/package.json +1 -1
package/dist/manifest.data.js
CHANGED
|
@@ -1324,6 +1324,20 @@ function setNestedValue(obj, path, value) {
|
|
|
1324
1324
|
current[keys[keys.length - 1]] = value;
|
|
1325
1325
|
}
|
|
1326
1326
|
|
|
1327
|
+
// If the key-value result has only numeric top-level keys (e.g. 0.path, 1.path), convert to array
|
|
1328
|
+
// so $route/$search/$query work and the shape matches YAML/JSON array sources.
|
|
1329
|
+
function numericKeyObjectToArray(obj) {
|
|
1330
|
+
if (obj == null || Array.isArray(obj) || typeof obj !== 'object') {
|
|
1331
|
+
return obj;
|
|
1332
|
+
}
|
|
1333
|
+
const keys = Object.keys(obj);
|
|
1334
|
+
if (keys.length === 0) return obj;
|
|
1335
|
+
const numericKeys = keys.filter(k => /^\d+$/.test(k));
|
|
1336
|
+
if (numericKeys.length !== keys.length) return obj;
|
|
1337
|
+
const sorted = numericKeys.map(k => parseInt(k, 10)).sort((a, b) => a - b);
|
|
1338
|
+
return sorted.map(i => obj[String(i)]);
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1327
1341
|
// Parse CSV text to nested object structure
|
|
1328
1342
|
function parseCSVToNestedObject(csvText, options = {}) {
|
|
1329
1343
|
const {
|
|
@@ -1340,7 +1354,10 @@ function parseCSVToNestedObject(csvText, options = {}) {
|
|
|
1340
1354
|
});
|
|
1341
1355
|
|
|
1342
1356
|
if (parsed.errors && parsed.errors.length > 0) {
|
|
1343
|
-
|
|
1357
|
+
const serious = parsed.errors.filter(e => e.code !== 'TooFewFields');
|
|
1358
|
+
if (serious.length > 0) {
|
|
1359
|
+
console.warn('[Manifest Data] CSV parsing warnings:', serious);
|
|
1360
|
+
}
|
|
1344
1361
|
}
|
|
1345
1362
|
|
|
1346
1363
|
if (!parsed.data || parsed.data.length === 0) {
|
|
@@ -1427,7 +1444,7 @@ function parseCSVToNestedObject(csvText, options = {}) {
|
|
|
1427
1444
|
setNestedValue(result, key, value);
|
|
1428
1445
|
}
|
|
1429
1446
|
|
|
1430
|
-
return result;
|
|
1447
|
+
return numericKeyObjectToArray(result);
|
|
1431
1448
|
}
|
|
1432
1449
|
} else {
|
|
1433
1450
|
// Fallback simple parser (if PapaParse not loaded)
|
|
@@ -1539,7 +1556,7 @@ function parseCSVToNestedObject(csvText, options = {}) {
|
|
|
1539
1556
|
setNestedValue(result, key, value);
|
|
1540
1557
|
}
|
|
1541
1558
|
|
|
1542
|
-
return result;
|
|
1559
|
+
return numericKeyObjectToArray(result);
|
|
1543
1560
|
}
|
|
1544
1561
|
}
|
|
1545
1562
|
}
|
|
@@ -506,15 +506,16 @@ async function initializeMarkdownPlugin() {
|
|
|
506
506
|
}
|
|
507
507
|
lastProcessedContent = markdownContent;
|
|
508
508
|
|
|
509
|
-
//
|
|
510
|
-
|
|
509
|
+
// Ensure we have a string (e.g. $route('path')?.content can be a proxy while loading)
|
|
510
|
+
const contentStr = typeof markdownContent === 'string' ? markdownContent : '';
|
|
511
|
+
if (!contentStr || contentStr.trim() === '') {
|
|
511
512
|
el.style.opacity = '0';
|
|
512
513
|
hasContent = false;
|
|
513
514
|
return;
|
|
514
515
|
}
|
|
515
516
|
|
|
516
517
|
const marked = await loadMarkedJS();
|
|
517
|
-
let html = marked.parse(
|
|
518
|
+
let html = marked.parse(contentStr);
|
|
518
519
|
|
|
519
520
|
// Post-process HTML to enable checkboxes (remove disabled attribute)
|
|
520
521
|
html = enableCheckboxes(html);
|