@routevn/creator-model 1.6.4 → 1.7.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/package.json +1 -1
- package/src/model.js +18 -1
package/package.json
CHANGED
package/src/model.js
CHANGED
|
@@ -385,17 +385,19 @@ const LAYOUT_ELEMENT_BASE_TYPES = [
|
|
|
385
385
|
"sprite-ref-save-load-slot-image",
|
|
386
386
|
"fragment-ref",
|
|
387
387
|
"container-ref-choice-item",
|
|
388
|
+
"container-ref-choice-single-item",
|
|
388
389
|
"container-ref-save-load-slot",
|
|
389
390
|
"container-ref-dialogue-line",
|
|
390
391
|
"container-ref-history-line",
|
|
391
392
|
"container-ref-confirm-dialog-ok",
|
|
392
393
|
"container-ref-confirm-dialog-cancel",
|
|
393
394
|
];
|
|
394
|
-
export const SCHEMA_VERSION =
|
|
395
|
+
export const SCHEMA_VERSION = 7;
|
|
395
396
|
const LAYOUT_CONTAINER_ELEMENT_TYPES = [
|
|
396
397
|
"folder",
|
|
397
398
|
"container",
|
|
398
399
|
"container-ref-choice-item",
|
|
400
|
+
"container-ref-choice-single-item",
|
|
399
401
|
"container-ref-save-load-slot",
|
|
400
402
|
"container-ref-dialogue-line",
|
|
401
403
|
"container-ref-history-line",
|
|
@@ -3489,6 +3491,7 @@ const validateLayoutElementData = ({
|
|
|
3489
3491
|
"paginationMode",
|
|
3490
3492
|
"paginationVariableId",
|
|
3491
3493
|
"paginationSize",
|
|
3494
|
+
"choiceItemIndex",
|
|
3492
3495
|
"$when",
|
|
3493
3496
|
"change",
|
|
3494
3497
|
];
|
|
@@ -3540,6 +3543,7 @@ const validateLayoutElementData = ({
|
|
|
3540
3543
|
"max",
|
|
3541
3544
|
"step",
|
|
3542
3545
|
"paginationSize",
|
|
3546
|
+
"choiceItemIndex",
|
|
3543
3547
|
"opacity",
|
|
3544
3548
|
"maxLength",
|
|
3545
3549
|
]) {
|
|
@@ -3551,6 +3555,18 @@ const validateLayoutElementData = ({
|
|
|
3551
3555
|
}
|
|
3552
3556
|
}
|
|
3553
3557
|
|
|
3558
|
+
if (
|
|
3559
|
+
data.choiceItemIndex !== undefined &&
|
|
3560
|
+
(!Number.isInteger(data.choiceItemIndex) ||
|
|
3561
|
+
data.choiceItemIndex < 0 ||
|
|
3562
|
+
data.choiceItemIndex > 19)
|
|
3563
|
+
) {
|
|
3564
|
+
return invalidFromErrorFactory(
|
|
3565
|
+
errorFactory,
|
|
3566
|
+
`${path}.choiceItemIndex must be an integer between 0 and 19 when provided`,
|
|
3567
|
+
);
|
|
3568
|
+
}
|
|
3569
|
+
|
|
3554
3570
|
if (
|
|
3555
3571
|
data.aspectRatioLock !== undefined &&
|
|
3556
3572
|
(!isFiniteNumber(data.aspectRatioLock) || data.aspectRatioLock <= 0)
|
|
@@ -4163,6 +4179,7 @@ const validateLayoutElementItems = ({ items, path, errorFactory }) => {
|
|
|
4163
4179
|
"paginationMode",
|
|
4164
4180
|
"paginationVariableId",
|
|
4165
4181
|
"paginationSize",
|
|
4182
|
+
"choiceItemIndex",
|
|
4166
4183
|
"$when",
|
|
4167
4184
|
"change",
|
|
4168
4185
|
],
|