@novely/core 0.44.2 → 0.44.3
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.global.js +9 -9
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -364,16 +364,16 @@ var Novely = (() => {
|
|
|
364
364
|
var isAction = (element) => {
|
|
365
365
|
return Array.isArray(element) && isString(element[0]);
|
|
366
366
|
};
|
|
367
|
+
var flatActions = (item) => {
|
|
368
|
+
return item.flatMap((data) => {
|
|
369
|
+
const type = data[0];
|
|
370
|
+
if (Array.isArray(type)) return flatActions(data);
|
|
371
|
+
return [data];
|
|
372
|
+
});
|
|
373
|
+
};
|
|
367
374
|
var flattenStory = (story) => {
|
|
368
375
|
const entries = Object.entries(story).map(([name, items]) => {
|
|
369
|
-
|
|
370
|
-
return item.flatMap((data) => {
|
|
371
|
-
const type = data[0];
|
|
372
|
-
if (Array.isArray(type)) return flat(data);
|
|
373
|
-
return [data];
|
|
374
|
-
});
|
|
375
|
-
};
|
|
376
|
-
return [name, flat(items)];
|
|
376
|
+
return [name, flatActions(items)];
|
|
377
377
|
});
|
|
378
378
|
return Object.fromEntries(entries);
|
|
379
379
|
};
|
|
@@ -1441,7 +1441,7 @@ var Novely = (() => {
|
|
|
1441
1441
|
const choice = props[i];
|
|
1442
1442
|
props[i] = [
|
|
1443
1443
|
choice.title,
|
|
1444
|
-
choice.children,
|
|
1444
|
+
flatActions(choice.children),
|
|
1445
1445
|
choice.active,
|
|
1446
1446
|
choice.visible,
|
|
1447
1447
|
choice.image
|