@novely/core 0.33.0-beta.2 → 0.33.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/dist/index.js CHANGED
@@ -1083,8 +1083,11 @@ var novely = ({
1083
1083
  data: latest[1]
1084
1084
  });
1085
1085
  });
1086
- context.meta.restoring = context.meta.goingBack = false;
1086
+ if (!context.meta.goingBack) {
1087
+ context.meta.restoring = false;
1088
+ }
1087
1089
  render(context);
1090
+ context.meta.restoring = context.meta.goingBack = false;
1088
1091
  };
1089
1092
  const refer = createReferFunction(story);
1090
1093
  const exit = (force = false, saving = true) => {
@@ -1314,7 +1317,7 @@ var novely = ({
1314
1317
  }
1315
1318
  return c || "";
1316
1319
  })();
1317
- ctx.clearAction("dialog");
1320
+ ctx.clearBlockingActions("dialog");
1318
1321
  ctx.dialog(
1319
1322
  templateReplace(content, data2),
1320
1323
  templateReplace(name, data2),
@@ -1365,7 +1368,7 @@ var novely = ({
1365
1368
  if (DEV2 && transformedChoices.length === 0) {
1366
1369
  throw new Error(`Running choice without variants to choose from, look at how to use Choice action properly [https://novely.pages.dev/guide/actions/choice#usage]`);
1367
1370
  }
1368
- ctx.clearAction("choice");
1371
+ ctx.clearBlockingActions("choice");
1369
1372
  ctx.choices(templateReplace(question, data2), transformedChoices, (selected) => {
1370
1373
  if (!ctx.meta.preview) {
1371
1374
  enmemory(ctx);
@@ -1429,7 +1432,7 @@ var novely = ({
1429
1432
  exit(true, false);
1430
1433
  },
1431
1434
  input({ ctx, data: data2, forward }, [question, onInput, setup]) {
1432
- ctx.clearAction("input");
1435
+ ctx.clearBlockingActions("input");
1433
1436
  ctx.input(
1434
1437
  templateReplace(question, data2),
1435
1438
  onInput,
@@ -1438,6 +1441,9 @@ var novely = ({
1438
1441
  );
1439
1442
  },
1440
1443
  custom({ ctx, push }, [handler]) {
1444
+ if (handler.requireUserAction) {
1445
+ ctx.clearBlockingActions(void 0);
1446
+ }
1441
1447
  const result = ctx.custom(handler, () => {
1442
1448
  if (ctx.meta.restoring)
1443
1449
  return;
@@ -1473,7 +1479,7 @@ var novely = ({
1473
1479
  if (DEV2 && string.length === 0) {
1474
1480
  throw new Error(`Action Text was called with empty string or array`);
1475
1481
  }
1476
- ctx.clearAction("text");
1482
+ ctx.clearBlockingActions("text");
1477
1483
  ctx.text(string, forward);
1478
1484
  },
1479
1485
  exit({ ctx, data: data2 }) {