@routevn/creator-model 1.6.4 → 1.7.1
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 +27 -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",
|
|
@@ -3455,6 +3457,7 @@ const validateLayoutElementData = ({
|
|
|
3455
3457
|
"multiline",
|
|
3456
3458
|
"disabled",
|
|
3457
3459
|
"maxLength",
|
|
3460
|
+
"formRole",
|
|
3458
3461
|
"padding",
|
|
3459
3462
|
"conditionalOverrides",
|
|
3460
3463
|
"direction",
|
|
@@ -3489,6 +3492,7 @@ const validateLayoutElementData = ({
|
|
|
3489
3492
|
"paginationMode",
|
|
3490
3493
|
"paginationVariableId",
|
|
3491
3494
|
"paginationSize",
|
|
3495
|
+
"choiceItemIndex",
|
|
3492
3496
|
"$when",
|
|
3493
3497
|
"change",
|
|
3494
3498
|
];
|
|
@@ -3540,6 +3544,7 @@ const validateLayoutElementData = ({
|
|
|
3540
3544
|
"max",
|
|
3541
3545
|
"step",
|
|
3542
3546
|
"paginationSize",
|
|
3547
|
+
"choiceItemIndex",
|
|
3543
3548
|
"opacity",
|
|
3544
3549
|
"maxLength",
|
|
3545
3550
|
]) {
|
|
@@ -3551,6 +3556,18 @@ const validateLayoutElementData = ({
|
|
|
3551
3556
|
}
|
|
3552
3557
|
}
|
|
3553
3558
|
|
|
3559
|
+
if (
|
|
3560
|
+
data.choiceItemIndex !== undefined &&
|
|
3561
|
+
(!Number.isInteger(data.choiceItemIndex) ||
|
|
3562
|
+
data.choiceItemIndex < 0 ||
|
|
3563
|
+
data.choiceItemIndex > 19)
|
|
3564
|
+
) {
|
|
3565
|
+
return invalidFromErrorFactory(
|
|
3566
|
+
errorFactory,
|
|
3567
|
+
`${path}.choiceItemIndex must be an integer between 0 and 19 when provided`,
|
|
3568
|
+
);
|
|
3569
|
+
}
|
|
3570
|
+
|
|
3554
3571
|
if (
|
|
3555
3572
|
data.aspectRatioLock !== undefined &&
|
|
3556
3573
|
(!isFiniteNumber(data.aspectRatioLock) || data.aspectRatioLock <= 0)
|
|
@@ -3890,6 +3907,13 @@ const validateLayoutElementData = ({
|
|
|
3890
3907
|
);
|
|
3891
3908
|
}
|
|
3892
3909
|
|
|
3910
|
+
if (data.formRole !== undefined && data.formRole !== "submit") {
|
|
3911
|
+
return invalidFromErrorFactory(
|
|
3912
|
+
errorFactory,
|
|
3913
|
+
`${path}.formRole must be 'submit' when provided`,
|
|
3914
|
+
);
|
|
3915
|
+
}
|
|
3916
|
+
|
|
3893
3917
|
if (
|
|
3894
3918
|
data.direction !== undefined &&
|
|
3895
3919
|
data.direction !== "absolute" &&
|
|
@@ -4130,6 +4154,7 @@ const validateLayoutElementItems = ({ items, path, errorFactory }) => {
|
|
|
4130
4154
|
"multiline",
|
|
4131
4155
|
"disabled",
|
|
4132
4156
|
"maxLength",
|
|
4157
|
+
"formRole",
|
|
4133
4158
|
"padding",
|
|
4134
4159
|
"conditionalOverrides",
|
|
4135
4160
|
"direction",
|
|
@@ -4163,6 +4188,7 @@ const validateLayoutElementItems = ({ items, path, errorFactory }) => {
|
|
|
4163
4188
|
"paginationMode",
|
|
4164
4189
|
"paginationVariableId",
|
|
4165
4190
|
"paginationSize",
|
|
4191
|
+
"choiceItemIndex",
|
|
4166
4192
|
"$when",
|
|
4167
4193
|
"change",
|
|
4168
4194
|
],
|