narrat 3.9.7 → 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 {};
@@ -613,7 +613,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
613
613
  };
614
614
  skills: import("./skills").SkillsState;
615
615
  };
616
- screen: {
616
+ screens: {
617
617
  layers: (string | null)[];
618
618
  buttons: import("./screens-store").ButtonsState;
619
619
  };
@@ -1281,7 +1281,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
1281
1281
  };
1282
1282
  skills: import("./skills").SkillsState;
1283
1283
  };
1284
- screen: {
1284
+ screens: {
1285
1285
  layers: (string | null)[];
1286
1286
  buttons: import("./screens-store").ButtonsState;
1287
1287
  };
@@ -1949,7 +1949,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
1949
1949
  };
1950
1950
  skills: import("./skills").SkillsState;
1951
1951
  };
1952
- screen: {
1952
+ screens: {
1953
1953
  layers: (string | null)[];
1954
1954
  buttons: import("./screens-store").ButtonsState;
1955
1955
  };
@@ -2617,7 +2617,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
2617
2617
  };
2618
2618
  skills: import("./skills").SkillsState;
2619
2619
  };
2620
- screen: {
2620
+ screens: {
2621
2621
  layers: (string | null)[];
2622
2622
  buttons: import("./screens-store").ButtonsState;
2623
2623
  };
@@ -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;
@@ -31,7 +31,7 @@ export type ExtractedGameSave = {
31
31
  [key: string]: any;
32
32
  };
33
33
  skills: SkillsSave;
34
- screen: ScreenSave;
34
+ screens: ScreenSave;
35
35
  main: MainSaveData;
36
36
  dialog: DialogSave;
37
37
  vm: VMSave;
@@ -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.7",
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",
@@ -80,7 +80,7 @@
80
80
  "@types/js-yaml": "^4.0.5",
81
81
  "@types/jsdom": "^21.1.1",
82
82
  "@types/testing-library__jest-dom": "^5.14.5",
83
- "@typescript-eslint/eslint-plugin": "^5.30.0",
83
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
84
84
  "@typescript-eslint/parser": "^6.9.0",
85
85
  "@vitejs/plugin-vue": "^4.2.3",
86
86
  "chai-style": "^1.0.3",
@@ -91,14 +91,14 @@
91
91
  "eslint-config-standard": "^17.0.0",
92
92
  "eslint-import-resolver-typescript": "^3.1.1",
93
93
  "eslint-plugin-import": "^2.26.0",
94
- "eslint-plugin-n": "^15.2.3",
94
+ "eslint-plugin-n": "^16.6.2",
95
95
  "eslint-plugin-node": "^11.1.0",
96
96
  "eslint-plugin-promise": "^6.0.0",
97
97
  "eslint-plugin-vue": "^9.15.1",
98
98
  "jsdom": "^20.0.0",
99
99
  "kolorist": "^1.5.1",
100
100
  "pinia": "^2.1.7",
101
- "prettier": "^3.0.0",
101
+ "prettier": "^3.2.5",
102
102
  "rollup-plugin-visualizer": "^5.9.2",
103
103
  "shelljs": "^0.8.5",
104
104
  "shx": "^0.3.4",
@@ -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
  }