narrat 3.9.8 → 3.10.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.
@@ -32,6 +32,7 @@ export declare const useDialogStore: import("pinia").StoreDefinition<"dialog", D
32
32
  toggleAutoPlay(): void;
33
33
  toggleSkip(): void;
34
34
  clearDialog(): void;
35
+ makeLastDialogInteractive(): void;
35
36
  reset(): void;
36
37
  }>;
37
38
  export {};
@@ -30,6 +30,7 @@ export interface DataState {
30
30
  }
31
31
  export interface VMState {
32
32
  commandsWaitingForPlayerAnswer: Parser.Command<any, any>[];
33
+ promisesWaitingForTextAnimation: (() => void)[];
33
34
  stack: MachineFrame[];
34
35
  data: DataState;
35
36
  globalData: DataState;
@@ -65,6 +66,7 @@ export declare const useVM: import("pinia").StoreDefinition<"vm", VMState, {
65
66
  fileName: string;
66
67
  finishCommand?: ((res: any) => void) | undefined;
67
68
  }[];
69
+ promisesWaitingForTextAnimation: (() => void)[];
68
70
  stack: {
69
71
  blocks: {
70
72
  currentIndex: number;
@@ -132,6 +134,8 @@ export declare const useVM: import("pinia").StoreDefinition<"vm", VMState, {
132
134
  findEntitiesInData(data: any): void;
133
135
  setReturnValue(value: any): void;
134
136
  waitForPlayerAnswer(cmd: Parser.Command<any, any>): void;
137
+ waitForEndTextAnimation(): Promise<void>;
138
+ endTextAnimation(): void;
135
139
  popAnswerQueue(): {
136
140
  args: (Parser.Primitive | {
137
141
  code: string;
@@ -1,11 +1,25 @@
1
- import { CommandParserFunction, CommandPlugin } from './command-plugin';
1
+ import { ArgTypes, CommandParserFunction, CommandPlugin } from './command-plugin';
2
+ import { Parser } from '../../types/parser';
3
+ export interface BaseTextCommandArgs {
4
+ text: string;
5
+ delay?: number;
6
+ autoAdvance?: boolean;
7
+ }
8
+ export declare class BaseTextCommand<Options extends BaseTextCommandArgs> extends CommandPlugin<Options> {
9
+ static ManageAutoAdvance(cmd: Parser.Command<TalkArgs>): Promise<void>;
10
+ static ShouldBeInteractive(cmd: Parser.Command<TalkArgs>): boolean;
11
+ }
2
12
  export interface TalkArgs {
3
13
  speaker: string;
4
14
  pose: string;
5
15
  text: string;
16
+ delay?: number;
17
+ autoAdvance?: boolean;
6
18
  }
19
+ export declare const textCommandArgs: ArgTypes;
7
20
  export declare const talkCommand: CommandPlugin<TalkArgs, {}>;
8
21
  export declare const thinkCommand: CommandPlugin<TalkArgs, {}>;
22
+ export declare const narrateCommand: CommandPlugin<TalkArgs, {}>;
9
23
  export declare const textParser: () => CommandParserFunction<{}, {
10
24
  text: string;
11
25
  }>;
@@ -20,3 +20,11 @@ export declare function tokensToExpression(ctx: ParserContext, tokens: Parser.Pr
20
20
  export declare function validateExpression(ctx: ParserContext, expression: Parser.Expression): void;
21
21
  export declare function findExpressionStart(tokens: Parser.Primitive[]): number;
22
22
  export declare function findExpressionEnd(tokens: Parser.Primitive[]): number;
23
+ export interface LineData {
24
+ code: string;
25
+ line: number;
26
+ multiline: boolean;
27
+ }
28
+ /** Finds all the lines, handling merging multilines, removing comment and removing empty lines */
29
+ export declare function splitScriptIntoLines(ctx: ParserContext, data: string): LineData[];
30
+ export declare function getBranchesFromRawScript(ctx: ParserContext, data: string): Parser.Line[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "narrat",
3
- "version": "3.9.8",
3
+ "version": "3.10.0",
4
4
  "description": "narrat narrative engine",
5
5
  "main": "dist/narrat.umd.js",
6
6
  "module": "dist/narrat.es.js",
@@ -58,7 +58,7 @@
58
58
  "peerDependencies": {
59
59
  "es6-promise": "^4.2.8",
60
60
  "pinia": "^2.1.7",
61
- "vue": "^3.4.15"
61
+ "vue": "^3.4.21"
62
62
  },
63
63
  "dependencies": {
64
64
  "@sinclair/typebox": "^0.31.18",
@@ -111,8 +111,8 @@
111
111
  "vite-plugin-inspect": "^0.7.28",
112
112
  "vite-plugin-narrat": "workspace:*",
113
113
  "vite-plugin-windicss": "^1.9.0",
114
- "vitest": "^0.33.0",
115
- "vue": "^3.4.15",
114
+ "vitest": "^1.2.2",
115
+ "vue": "^3.4.21",
116
116
  "vue-tsc": "^1.8.22",
117
117
  "windicss": "^3.5.6"
118
118
  }