@routevn/creator-model 1.8.1 → 1.9.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 +21 -2
package/package.json
CHANGED
package/src/model.js
CHANGED
|
@@ -394,7 +394,7 @@ const LAYOUT_ELEMENT_BASE_TYPES = [
|
|
|
394
394
|
"container-ref-confirm-dialog-ok",
|
|
395
395
|
"container-ref-confirm-dialog-cancel",
|
|
396
396
|
];
|
|
397
|
-
export const SCHEMA_VERSION =
|
|
397
|
+
export const SCHEMA_VERSION = 9;
|
|
398
398
|
const LAYOUT_CONTAINER_ELEMENT_TYPES = [
|
|
399
399
|
"folder",
|
|
400
400
|
"container",
|
|
@@ -3817,6 +3817,7 @@ const validateLayoutElementData = ({
|
|
|
3817
3817
|
"clickImageId",
|
|
3818
3818
|
"hoverSoundId",
|
|
3819
3819
|
"clickSoundId",
|
|
3820
|
+
"revealSoundId",
|
|
3820
3821
|
"textStyleId",
|
|
3821
3822
|
"hoverTextStyleId",
|
|
3822
3823
|
"clickTextStyleId",
|
|
@@ -4044,6 +4045,7 @@ const validateLayoutElementData = ({
|
|
|
4044
4045
|
"clickImageId",
|
|
4045
4046
|
"hoverSoundId",
|
|
4046
4047
|
"clickSoundId",
|
|
4048
|
+
"revealSoundId",
|
|
4047
4049
|
"textStyleId",
|
|
4048
4050
|
"hoverTextStyleId",
|
|
4049
4051
|
"clickTextStyleId",
|
|
@@ -4562,6 +4564,7 @@ const validateLayoutElementItems = ({ items, path, errorFactory }) => {
|
|
|
4562
4564
|
"clickImageId",
|
|
4563
4565
|
"hoverSoundId",
|
|
4564
4566
|
"clickSoundId",
|
|
4567
|
+
"revealSoundId",
|
|
4565
4568
|
"textStyleId",
|
|
4566
4569
|
"hoverTextStyleId",
|
|
4567
4570
|
"clickTextStyleId",
|
|
@@ -8060,7 +8063,7 @@ export const assertInvariants = ({ state }) => {
|
|
|
8060
8063
|
}
|
|
8061
8064
|
}
|
|
8062
8065
|
|
|
8063
|
-
for (const field of ["hoverSoundId", "clickSoundId"]) {
|
|
8066
|
+
for (const field of ["hoverSoundId", "clickSoundId", "revealSoundId"]) {
|
|
8064
8067
|
if (element[field] !== undefined) {
|
|
8065
8068
|
const result = assertSoundReference({
|
|
8066
8069
|
ownerIdField,
|
|
@@ -12301,6 +12304,22 @@ const validateVisualElementReferenceTargets = ({
|
|
|
12301
12304
|
}
|
|
12302
12305
|
}
|
|
12303
12306
|
|
|
12307
|
+
if (data.revealSoundId !== undefined) {
|
|
12308
|
+
const sound = state.sounds.items[data.revealSoundId];
|
|
12309
|
+
if (!isPlainObject(sound) || sound.type === "folder") {
|
|
12310
|
+
return invalidFromErrorFactory(
|
|
12311
|
+
errorFactory,
|
|
12312
|
+
`${ownerLabel} element revealSoundId must reference an existing non-folder sound`,
|
|
12313
|
+
{
|
|
12314
|
+
[ownerIdField]: ownerId,
|
|
12315
|
+
elementId,
|
|
12316
|
+
field: "revealSoundId",
|
|
12317
|
+
targetId: data.revealSoundId,
|
|
12318
|
+
},
|
|
12319
|
+
);
|
|
12320
|
+
}
|
|
12321
|
+
}
|
|
12322
|
+
|
|
12304
12323
|
if (data.thumbImageId !== undefined) {
|
|
12305
12324
|
const image = state.images.items[data.thumbImageId];
|
|
12306
12325
|
if (!isPlainObject(image) || image.type === "folder") {
|