@novely/core 0.44.1 → 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.js CHANGED
@@ -292,16 +292,16 @@ var noop = () => {
292
292
  var isAction = (element) => {
293
293
  return Array.isArray(element) && isString(element[0]);
294
294
  };
295
+ var flatActions = (item) => {
296
+ return item.flatMap((data) => {
297
+ const type = data[0];
298
+ if (Array.isArray(type)) return flatActions(data);
299
+ return [data];
300
+ });
301
+ };
295
302
  var flattenStory = (story) => {
296
303
  const entries = Object.entries(story).map(([name, items]) => {
297
- const flat = (item) => {
298
- return item.flatMap((data) => {
299
- const type = data[0];
300
- if (Array.isArray(type)) return flat(data);
301
- return [data];
302
- });
303
- };
304
- return [name, flat(items)];
304
+ return [name, flatActions(items)];
305
305
  });
306
306
  return Object.fromEntries(entries);
307
307
  };
@@ -1198,7 +1198,7 @@ var novely = ({
1198
1198
  const choice = props[i];
1199
1199
  props[i] = [
1200
1200
  choice.title,
1201
- choice.children,
1201
+ flatActions(choice.children),
1202
1202
  choice.active,
1203
1203
  choice.visible,
1204
1204
  choice.image