@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.d.ts +2 -2
- package/dist/index.global.js +11 -5
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -97,9 +97,9 @@ type Context = {
|
|
|
97
97
|
clearCustom: (fn: CustomHandler<Lang, State>) => void;
|
|
98
98
|
/**
|
|
99
99
|
* Clears all mentioned actions except for preserved one
|
|
100
|
-
* @param preserve Action
|
|
100
|
+
* @param preserve Action that should not be cleared
|
|
101
101
|
*/
|
|
102
|
-
|
|
102
|
+
clearBlockingActions: (preserve: 'dialog' | 'choice' | 'input' | 'text' | undefined) => void;
|
|
103
103
|
text: (str: string, resolve: () => void) => void;
|
|
104
104
|
vibrate: (pattern: VibratePattern) => void;
|
|
105
105
|
audio: {
|
package/dist/index.global.js
CHANGED
|
@@ -1274,8 +1274,11 @@ var Novely = (() => {
|
|
|
1274
1274
|
data: latest[1]
|
|
1275
1275
|
});
|
|
1276
1276
|
});
|
|
1277
|
-
|
|
1277
|
+
if (!context.meta.goingBack) {
|
|
1278
|
+
context.meta.restoring = false;
|
|
1279
|
+
}
|
|
1278
1280
|
render(context);
|
|
1281
|
+
context.meta.restoring = context.meta.goingBack = false;
|
|
1279
1282
|
};
|
|
1280
1283
|
const refer = createReferFunction(story);
|
|
1281
1284
|
const exit = (force = false, saving = true) => {
|
|
@@ -1505,7 +1508,7 @@ var Novely = (() => {
|
|
|
1505
1508
|
}
|
|
1506
1509
|
return c || "";
|
|
1507
1510
|
})();
|
|
1508
|
-
ctx.
|
|
1511
|
+
ctx.clearBlockingActions("dialog");
|
|
1509
1512
|
ctx.dialog(
|
|
1510
1513
|
templateReplace(content, data2),
|
|
1511
1514
|
templateReplace(name, data2),
|
|
@@ -1556,7 +1559,7 @@ var Novely = (() => {
|
|
|
1556
1559
|
if (DEV && transformedChoices.length === 0) {
|
|
1557
1560
|
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]`);
|
|
1558
1561
|
}
|
|
1559
|
-
ctx.
|
|
1562
|
+
ctx.clearBlockingActions("choice");
|
|
1560
1563
|
ctx.choices(templateReplace(question, data2), transformedChoices, (selected) => {
|
|
1561
1564
|
if (!ctx.meta.preview) {
|
|
1562
1565
|
enmemory(ctx);
|
|
@@ -1620,7 +1623,7 @@ var Novely = (() => {
|
|
|
1620
1623
|
exit(true, false);
|
|
1621
1624
|
},
|
|
1622
1625
|
input({ ctx, data: data2, forward }, [question, onInput, setup]) {
|
|
1623
|
-
ctx.
|
|
1626
|
+
ctx.clearBlockingActions("input");
|
|
1624
1627
|
ctx.input(
|
|
1625
1628
|
templateReplace(question, data2),
|
|
1626
1629
|
onInput,
|
|
@@ -1629,6 +1632,9 @@ var Novely = (() => {
|
|
|
1629
1632
|
);
|
|
1630
1633
|
},
|
|
1631
1634
|
custom({ ctx, push }, [handler]) {
|
|
1635
|
+
if (handler.requireUserAction) {
|
|
1636
|
+
ctx.clearBlockingActions(void 0);
|
|
1637
|
+
}
|
|
1632
1638
|
const result = ctx.custom(handler, () => {
|
|
1633
1639
|
if (ctx.meta.restoring)
|
|
1634
1640
|
return;
|
|
@@ -1664,7 +1670,7 @@ var Novely = (() => {
|
|
|
1664
1670
|
if (DEV && string.length === 0) {
|
|
1665
1671
|
throw new Error(`Action Text was called with empty string or array`);
|
|
1666
1672
|
}
|
|
1667
|
-
ctx.
|
|
1673
|
+
ctx.clearBlockingActions("text");
|
|
1668
1674
|
ctx.text(string, forward);
|
|
1669
1675
|
},
|
|
1670
1676
|
exit({ ctx, data: data2 }) {
|