@drincs/pixi-vn-json 1.13.13 → 1.13.15

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.
@@ -1,413 +1,8 @@
1
- import { StorageElementType, CanvasBaseInterface, ImageSprite, ShakeEffectProps, ShowWithDissolveTransitionProps, ShowWithFadeTransitionProps, MoveInOutProps, ZoomInOutProps, PushInOutProps, ContainerOptions, ImageContainerOptions, ImageSpriteOptions, TextOptions, ImageSpriteMemory, VideoSpriteMemory, ImageContainerMemory, TextMemory, ContainerMemory, SoundPlayOptionsWithChannel, MediaInterface, LabelRunModeType, StorageObjectType, StepLabelPropsType } from '@drincs/pixi-vn';
1
+ import { a as PixiVNJsonValueSet, m as PixiVNJsonFunction, P as PixiVNJsonIfElse, c as PixiVNJsonValueGet, f as PixiVNJsonConditionalStatements } from './PixiVNJsonIfElse-B_OG8Qs1.js';
2
+ import { CanvasBaseInterface, ImageSprite, ShakeEffectProps, ShowWithDissolveTransitionProps, ShowWithFadeTransitionProps, MoveInOutProps, ZoomInOutProps, PushInOutProps, ContainerOptions, ImageContainerOptions, ImageSpriteOptions, TextOptions, ImageSpriteMemory, VideoSpriteMemory, ImageContainerMemory, TextMemory, ContainerMemory, SoundPlayOptionsWithChannel, MediaInterface, LabelRunModeType, StorageObjectType, StepLabelPropsType } from '@drincs/pixi-vn';
2
3
  import { KeyframesType, AnimationOptions, ObjectSegment, ObjectSegmentWithTransition, SequenceOptions } from '@drincs/pixi-vn/motion';
3
4
  import { UPDATE_PRIORITY } from 'pixi.js';
4
5
 
5
- /**
6
- * A single element that can appear inside a step-switch, which may be a direct value,
7
- * a conditional statement, or a result-to-combine.
8
- */
9
- type PixiVNJsonStepSwitchElementType<Then> = Then | PixiVNJsonConditionalStatements<Then> | PixiVNJsonConditionalResultToCombine<Then>;
10
- /**
11
- * The elements collection of a step-switch — either a plain array or a conditional that produces an array.
12
- */
13
- type PixiVNJsonStepSwitchElementsType<Then> = PixiVNJsonStepSwitchElementType<Then>[] | PixiVNJsonConditionalStatements<Then[]>;
14
- /**
15
- * Picks one element at random each time the step is visited.
16
- */
17
- interface PixiVNJsonRandom<Then> {
18
- type: "stepswitch";
19
- choiceType: "random";
20
- /**
21
- * The pool of elements to choose from randomly.
22
- */
23
- elements: PixiVNJsonStepSwitchElementsType<Then>;
24
- }
25
- /**
26
- * Picks elements in a random order, advancing through the list across visits (no repeats until exhausted).
27
- */
28
- interface PixiVNJsonSequentialRandom<Then> {
29
- type: "stepswitch";
30
- choiceType: "sequentialrandom";
31
- /**
32
- * The pool of elements to iterate through in randomised order.
33
- */
34
- elements: PixiVNJsonStepSwitchElementsType<Then>;
35
- /**
36
- * When the sequential ends, what should be the value? If undefined, it will return undefined.
37
- * If "lastItem", it will return the last item in the array.
38
- */
39
- end: undefined | "lastItem";
40
- /**
41
- * The subId is used for managing nested switches
42
- */
43
- nestedId?: string;
44
- }
45
- /**
46
- * Advances through the elements list one by one on each visit (in order).
47
- */
48
- interface PixiVNJsonSequential<Then> {
49
- type: "stepswitch";
50
- choiceType: "sequential";
51
- /**
52
- * The ordered list of elements to iterate through.
53
- */
54
- elements: PixiVNJsonStepSwitchElementsType<Then>;
55
- /**
56
- * When the sequential ends, what should be the value? If undefined, it will return undefined.
57
- * If "lastItem", it will return the last item in the array.
58
- */
59
- end: undefined | "lastItem";
60
- /**
61
- * The subId is used for managing nested switches
62
- */
63
- nestedId?: string;
64
- }
65
- /**
66
- * Loops through the elements list indefinitely, cycling back to the first element after the last.
67
- */
68
- interface PixiVNJsonLoop<Then> {
69
- type: "stepswitch";
70
- choiceType: "loop";
71
- /**
72
- * The list of elements to cycle through.
73
- */
74
- elements: PixiVNJsonStepSwitchElementsType<Then>;
75
- /**
76
- * The subId is used for managing nested switches
77
- */
78
- nestedId?: string;
79
- }
80
- /**
81
- * A step-switch selects one element from a list using a defined strategy (random, sequential, loop, or sequential-random).
82
- */
83
- type PixiVNJsonStepSwitch<Then> = PixiVNJsonRandom<Then> | PixiVNJsonSequential<Then> | PixiVNJsonLoop<Then> | PixiVNJsonSequentialRandom<Then>;
84
-
85
- /**
86
- * This element is used in case a {@link PixiVNJsonConditionalStatements} gives a result that must be combined with another calculated through other {@link PixiVNJsonConditionalStatements}.
87
- * in case this possibility is not managed, it will be taken into consideration {@link PixiVNJsonConditionalResultToCombine.firstItem}
88
- */
89
- type PixiVNJsonConditionalResultToCombine<T> = {
90
- type: "resulttocombine";
91
- /**
92
- * Defines how the two results are combined:
93
- * - `"cross"` — cartesian product / pairwise combination of both results
94
- * - `"union"` — concatenation / merge of both results into a single collection
95
- */
96
- combine: "cross" | "union";
97
- /**
98
- * The first (primary) result item, used as a fallback if the second conditional produces no result.
99
- */
100
- firstItem?: T;
101
- /**
102
- * The second conditional item(s) whose result will be combined with {@link firstItem}.
103
- */
104
- secondConditionalItem?: PixiVNJsonStepSwitchElementType<T>[];
105
- };
106
-
107
- /**
108
- * A conditional statement that evaluates to a value of type `Then`.
109
- * It can be either:
110
- * - a {@link PixiVNJsonStepSwitch} — selects a result from a list based on a strategy (random, sequential, loop)
111
- * - a {@link PixiVNJsonIfElse} — evaluates a condition and returns the matching branch result,
112
- * which may itself be another conditional or a {@link PixiVNJsonConditionalResultToCombine}
113
- */
114
- type PixiVNJsonConditionalStatements<Then> = PixiVNJsonStepSwitch<Then> | PixiVNJsonIfElse<Then | PixiVNJsonConditionalStatements<Then> | PixiVNJsonConditionalResultToCombine<Then>>;
115
-
116
- /**
117
- * Retrieves a value from the persistent storage, flag storage, or temporary storage.
118
- */
119
- type PixiVNJsonStorageGet = {
120
- type: "value";
121
- storageOperationType: "get";
122
- /**
123
- * Key of the storage
124
- */
125
- key: string;
126
- /**
127
- * Type of the storage, if it is a flagStorage or a storage.
128
- * If it is a flagStorage, the value will be get with the function {@link getFlag}
129
- */
130
- storageType: "storage" | "flagStorage" | "tempstorage";
131
- };
132
- type PixiVNJsonParamGet = {
133
- type: "value";
134
- storageOperationType: "get";
135
- /**
136
- * Index of the parameter in the params array.
137
- */
138
- key: number;
139
- storageType: "params";
140
- };
141
- /**
142
- * Retrieves the number of times a label has been opened.
143
- */
144
- type PixiVNJsonLabelGet = {
145
- type: "value";
146
- storageOperationType: "get";
147
- /**
148
- * Id of the label
149
- */
150
- label: string;
151
- /**
152
- * If it is a label, the value will be get with the function {@link narration.getTimesLabelOpened}
153
- */
154
- storageType: "label";
155
- };
156
- /**
157
- * Retrieves the number of times a specific choice has been selected.
158
- */
159
- type PixiVNJsonChoiceGet = {
160
- type: "value";
161
- storageOperationType: "get";
162
- /**
163
- * index of the choice
164
- */
165
- index: number;
166
- /**
167
- * If it is a choice, the value will be get with the function {@link narration.getTimesChoiceOpened}
168
- */
169
- storageType: "choice";
170
- };
171
- /**
172
- * Retrieves a value from the logic/arithmetic layer (result of a computation or condition).
173
- */
174
- type PixiVNJsonLogicGet = {
175
- type: "value";
176
- storageOperationType: "get";
177
- /**
178
- * The arithmetic or conditional operation whose result is the retrieved value.
179
- */
180
- operation: PixiVNJsonArithmeticOperations | PixiVNJsonConditions;
181
- storageType: "logic";
182
- };
183
- /**
184
- * Union of all "get value" operations — reads from storage, params, labels, choices, or a logic expression.
185
- */
186
- type PixiVNJsonValueGet = PixiVNJsonStorageGet | PixiVNJsonParamGet | PixiVNJsonLabelGet | PixiVNJsonChoiceGet | PixiVNJsonLogicGet | PixiVNJsonFunction;
187
- /**
188
- * Invokes a named function and returns its result.
189
- * Functions are registered in the Pixi'VN runtime and can receive typed arguments.
190
- */
191
- type PixiVNJsonFunction = {
192
- type: "function";
193
- /**
194
- * The name of the registered function to call.
195
- */
196
- functionName: string;
197
- /**
198
- * Arguments to pass to the function. Each argument can be a condition, a raw value,
199
- * a value-get operation, or an arithmetic expression.
200
- */
201
- args: (PixiVNJsonConditions | StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations)[];
202
- };
203
- /**
204
- * Sets a value in either the persistent storage or the temporary (session) storage.
205
- */
206
- type PixiVNJsonOnlyStorageSet = {
207
- type: "value";
208
- storageOperationType: "set";
209
- /**
210
- * Key of the storage
211
- */
212
- key: string;
213
- /**
214
- * Value to be set in the storage
215
- */
216
- value: StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditionalStatements<StorageElementType>;
217
- /**
218
- * Type of the storage, if it is a flagStorage or a storage.
219
- */
220
- storageType: "storage" | "tempstorage";
221
- };
222
- /**
223
- * Sets a positional parameter value in the params temporary storage.
224
- */
225
- type PixiVNJsonOnlyParamSet = {
226
- type: "value";
227
- storageOperationType: "set";
228
- /**
229
- * Index of the parameter in the params array to set.
230
- */
231
- key: number;
232
- /**
233
- * Value to be set at the given param index.
234
- */
235
- value: StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditionalStatements<StorageElementType>;
236
- storageType: "params";
237
- };
238
- /**
239
- * Sets a boolean flag in the flag storage.
240
- * Flag storage is a dedicated boolean key-value store queried with {@link getFlag}.
241
- */
242
- type PixiVNJsonFlagSet = {
243
- type: "value";
244
- storageOperationType: "set";
245
- /**
246
- * Key of the storage
247
- */
248
- key: string;
249
- /**
250
- * Value to be set in the storage
251
- */
252
- value: boolean;
253
- /**
254
- * Type of the storage, if it is a flagStorage or a storage.
255
- */
256
- storageType: "flagStorage";
257
- };
258
- /**
259
- * Union of all "set value" operations — writes to storage, flag storage, or params.
260
- */
261
- type PixiVNJsonValueSet = PixiVNJsonOnlyStorageSet | PixiVNJsonFlagSet | PixiVNJsonOnlyParamSet;
262
-
263
- /**
264
- * Binary arithmetic operation between two values (left OP right).
265
- */
266
- interface PixiVNJsonArithmeticOperationsArithmetic {
267
- type: "arithmetic";
268
- /**
269
- * Left value of the arithmetic operation
270
- */
271
- leftValue: StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditionalStatements<StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations>;
272
- /**
273
- * Right value of the arithmetic operation
274
- */
275
- rightValue: StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditionalStatements<StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations>;
276
- /**
277
- * Operator of the arithmetic operation:
278
- * - `"*"` multiplication
279
- * - `"/"` division
280
- * - `"+"` addition (concatenation for strings and arrays)
281
- * - `"-"` subtraction (removal of elements for arrays)
282
- * - `"%"` modulo
283
- * - `"POW"` exponentiation
284
- * - `"RANDOM"` random integer between leftValue and rightValue (inclusive)
285
- * - `"INTERSECTION"` intersection of two arrays (only elements present in both arrays are included in the result)
286
- */
287
- operator: "*" | "/" | "+" | "-" | "%" | "POW" | "RANDOM" | "INTERSECTION";
288
- }
289
- /**
290
- * Unary arithmetic operation applied to a single value (e.g. INT, FLOOR, FLOAT).
291
- */
292
- interface PixiVNJsonArithmeticOperationsArithmeticSingle {
293
- type: "arithmeticsingle";
294
- /**
295
- * Left value of the arithmetic operation
296
- */
297
- leftValue: StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditionalStatements<StorageElementType | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations>;
298
- /**
299
- * Operator of the arithmetic operation:
300
- * - `"INT"` truncates the value to an integer (removes the decimal part)
301
- * - `"FLOOR"` rounds down to the nearest integer
302
- * - `"FLOAT"` converts the value to a floating-point number
303
- */
304
- operator: "INT" | "FLOOR" | "FLOAT";
305
- }
306
- /**
307
- * Arithmetic operations for the PixiVNJson
308
- */
309
- type PixiVNJsonArithmeticOperations = PixiVNJsonArithmeticOperationsArithmeticSingle | PixiVNJsonArithmeticOperationsArithmetic;
310
-
311
- /**
312
- * Combines multiple conditions with a logical AND or OR.
313
- */
314
- type PixiVNJsonUnionConditionAndOr = {
315
- type: "union";
316
- /**
317
- * The list of conditions to combine.
318
- */
319
- conditions: PixiVNJsonConditions[];
320
- /**
321
- * - `"and"` — all conditions must be true
322
- * - `"or"` — at least one condition must be true
323
- */
324
- unionType: "and" | "or";
325
- };
326
- /**
327
- * Negates a single condition with a logical NOT.
328
- */
329
- type PixiVNJsonUnionConditionNot = {
330
- type: "union";
331
- /**
332
- * The condition to negate.
333
- */
334
- condition: PixiVNJsonConditions;
335
- unionType: "not";
336
- };
337
- /**
338
- * Union of AND/OR and NOT logical operators over conditions.
339
- */
340
- type PixiVNJsonUnionCondition = PixiVNJsonUnionConditionAndOr | PixiVNJsonUnionConditionNot;
341
-
342
- /**
343
- * Supported comparison operators.
344
- * - `"=="` equal
345
- * - `"!="` not equal
346
- * - `"<"` less than
347
- * - `"<="` less than or equal
348
- * - `">"` greater than
349
- * - `">="` greater than or equal
350
- * - `"CONTAINS"` checks whether the left string/array contains the right value, if left and right are arrays, checks if all items in right are included in left
351
- */
352
- type PixiVNJsonComparationOperatorsType = "==" | "!=" | "<" | "<=" | ">" | ">=" | "CONTAINS";
353
- /**
354
- * Comparation for PixiVNJson.
355
- * In this comparation, the values to be converted to string and compared.
356
- */
357
- type PixiVNJsonComparation = {
358
- type: "compare";
359
- /**
360
- * Left value of the comparation
361
- */
362
- leftValue: StorageElementType | PixiVNJsonValueGet | PixiVNJsonConditions;
363
- /**
364
- * Right value of the comparation
365
- */
366
- rightValue: StorageElementType | PixiVNJsonValueGet | PixiVNJsonConditions;
367
- /**
368
- * Operator of the comparation
369
- */
370
- operator: PixiVNJsonComparationOperatorsType;
371
- };
372
- /**
373
- * A plain value condition — truthy/falsy evaluation of a raw value or a value-get result.
374
- */
375
- type PixiVNJsonValueCondition = StorageElementType | PixiVNJsonValueGet;
376
- /**
377
- * Union of all condition types supported by PixiVNJson:
378
- * - {@link PixiVNJsonComparation} — binary comparison between two values
379
- * - {@link PixiVNJsonValueCondition} — truthy/falsy check on a plain value
380
- * - {@link PixiVNJsonUnionCondition} — logical AND, OR, or NOT of other conditions
381
- * - {@link PixiVNJsonArithmeticOperations} — arithmetic result used as a boolean (non-zero = true)
382
- */
383
- type PixiVNJsonConditions = PixiVNJsonComparation | PixiVNJsonValueCondition | PixiVNJsonUnionCondition | PixiVNJsonArithmeticOperations;
384
-
385
- /**
386
- * If-Else condition for PixiVNJson
387
- */
388
- interface PixiVNJsonIfElse<Then> {
389
- type: "ifelse";
390
- /**
391
- * The list of conditions to be checked.
392
- *
393
- * if is a {@link StorageElementType} or a {@link PixiVNJsonValueGet}:
394
- * - if is a array or object, the condition is true if not empty
395
- * - if is a string, the condition is true if not empty
396
- * - if is a number, the condition is true if not zero
397
- * - if is a boolean, the condition is true if true
398
- * - if is null or undefined, the condition is false
399
- */
400
- condition: PixiVNJsonConditions;
401
- /**
402
- * The value to be returned if the condition is true.
403
- */
404
- then: Then | PixiVNJsonIfElse<Then>;
405
- /**
406
- * The value to be returned if the condition is false.
407
- */
408
- else?: Then | PixiVNJsonIfElse<Then>;
409
- }
410
-
411
6
  /**
412
7
  * Animates one or more canvas elements simultaneously using keyframe-based animation.
413
8
  */
@@ -1004,4 +599,4 @@ type PixiVNJsonLabelStep = {
1004
599
  conditionalStep?: PixiVNJsonConditionalStatements<PixiVNJsonLabelStep | PixiVNJsonLabelStep[]>;
1005
600
  };
1006
601
 
1007
- export type { PixiVNJsonStepSwitch as $, PixiVNJsonAnimateSequence as A, PixiVNJsonArithmeticOperationsArithmetic as B, PixiVNJsonArithmeticOperationsArithmeticSingle as C, PixiVNJsonCanvas as D, PixiVNJsonCanvasEdit as E, PixiVNJsonCanvasShow as F, PixiVNJsonChoice as G, PixiVNJsonChoiceGet as H, PixiVNJsonChoices as I, PixiVNJsonComparation as J, PixiVNJsonConditionalOperation as K, PixiVNJsonConditionalResultToCombine as L, PixiVNJsonDialog as M, PixiVNJsonDialogText as N, PixiVNJsonDialogue as O, PixiVNJsonOperation as P, PixiVNJsonFunction as Q, PixiVNJsonInputRequest as R, PixiVNJsonLabelGet as S, PixiVNJsonLabelToOpen as T, PixiVNJsonLogicGet as U, PixiVNJsonMediaTransiotions as V, PixiVNJsonParamGet as W, PixiVNJsonSoundEdit as X, PixiVNJsonSoundPauseResume as Y, PixiVNJsonSoundPlay as Z, PixiVNJsonSoundRemove as _, PixiVNJsonIfElse as a, PixiVNJsonStepSwitchElementType as a0, PixiVNJsonStepSwitchElementsType as a1, PixiVNJsonStorageGet as a2, PixiVNJsonUnionCondition as a3, PixiVNJsonOperationString as b, PixiVNJsonSound as c, PixiVNJsonCanvasImageVideoShow as d, PixiVNJsonImageEdit as e, PixiVNJsonCanvasRemove as f, PixiVNJsonVideoEdit as g, PixiVNJsonVideoPauseResume as h, PixiVNJsonCanvasImageContainerShow as i, PixiVNJsonImageContainerEdit as j, PixiVNJsonCanvasTextShow as k, PixiVNJsonTextEdit as l, PixiVNJsonUnknownEdit as m, PixiVNJsonValueSet as n, PixiVNJsonOnlyStorageSet as o, PixiVNJsonNarration as p, PixiVNJsonCanvasEffect as q, PixiVNJsonCanvasAnimate as r, PixiVNJsonCanvasClear as s, PixiVNJsonValueGet as t, PixiVNJsonArithmeticOperations as u, PixiVNJsonConditions as v, PixiVNJsonConditionalStatements as w, PixiVNJsonLabelStep as x, PixiVNJsonComparationOperatorsType as y, PixiVNJsonAnimateBase as z };
602
+ export type { PixiVNJsonDialogText as A, PixiVNJsonDialogue as B, PixiVNJsonInputRequest as C, PixiVNJsonLabelToOpen as D, PixiVNJsonMediaTransiotions as E, PixiVNJsonSoundEdit as F, PixiVNJsonSoundPauseResume as G, PixiVNJsonSoundPlay as H, PixiVNJsonSoundRemove as I, PixiVNJsonOperation as P, PixiVNJsonOperationString as a, PixiVNJsonSound as b, PixiVNJsonCanvasImageVideoShow as c, PixiVNJsonImageEdit as d, PixiVNJsonCanvasRemove as e, PixiVNJsonVideoEdit as f, PixiVNJsonVideoPauseResume as g, PixiVNJsonCanvasImageContainerShow as h, PixiVNJsonImageContainerEdit as i, PixiVNJsonCanvasTextShow as j, PixiVNJsonTextEdit as k, PixiVNJsonUnknownEdit as l, PixiVNJsonNarration as m, PixiVNJsonCanvasEffect as n, PixiVNJsonCanvasAnimate as o, PixiVNJsonCanvasClear as p, PixiVNJsonLabelStep as q, PixiVNJsonAnimateBase as r, PixiVNJsonAnimateSequence as s, PixiVNJsonCanvas as t, PixiVNJsonCanvasEdit as u, PixiVNJsonCanvasShow as v, PixiVNJsonChoice as w, PixiVNJsonChoices as x, PixiVNJsonConditionalOperation as y, PixiVNJsonDialog as z };