@routevn/creator-model 1.10.1 → 1.10.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/model.js +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routevn/creator-model",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/model.js CHANGED
@@ -353,6 +353,7 @@ const LAYOUT_TYPE_KEYS = [
353
353
  ];
354
354
  const LAYOUT_ELEMENT_TEXT_STYLE_ALIGN_KEYS = ["left", "center", "right"];
355
355
  const LAYOUT_TEXT_REVEAL_EFFECT_KEYS = ["typewriter", "softWipe", "none"];
356
+ const LAYOUT_TEXT_REVEAL_SOUND_STOP_TIMING_KEYS = ["loopEnd", "immediate"];
356
357
  const LAYOUT_ELEMENT_BLUR_KERNEL_SIZE_OPTIONS = [5, 7, 9, 11, 13, 15];
357
358
  const CONTROL_KEYBOARD_KEYS = [
358
359
  "enter",
@@ -3885,6 +3886,7 @@ const validateLayoutElementData = ({
3885
3886
  "hoverSoundId",
3886
3887
  "clickSoundId",
3887
3888
  "revealSoundId",
3889
+ "revealSoundStopTiming",
3888
3890
  "textStyleId",
3889
3891
  "hoverTextStyleId",
3890
3892
  "clickTextStyleId",
@@ -4120,6 +4122,7 @@ const validateLayoutElementData = ({
4120
4122
  "hoverSoundId",
4121
4123
  "clickSoundId",
4122
4124
  "revealSoundId",
4125
+ "revealSoundStopTiming",
4123
4126
  "textStyleId",
4124
4127
  "hoverTextStyleId",
4125
4128
  "clickTextStyleId",
@@ -4398,6 +4401,18 @@ const validateLayoutElementData = ({
4398
4401
  );
4399
4402
  }
4400
4403
 
4404
+ if (
4405
+ data.revealSoundStopTiming !== undefined &&
4406
+ !LAYOUT_TEXT_REVEAL_SOUND_STOP_TIMING_KEYS.includes(
4407
+ data.revealSoundStopTiming,
4408
+ )
4409
+ ) {
4410
+ return invalidFromErrorFactory(
4411
+ errorFactory,
4412
+ `${path}.revealSoundStopTiming must be one of ${LAYOUT_TEXT_REVEAL_SOUND_STOP_TIMING_KEYS.join(", ")} when provided`,
4413
+ );
4414
+ }
4415
+
4401
4416
  if (data.formRole !== undefined && data.formRole !== "submit") {
4402
4417
  return invalidFromErrorFactory(
4403
4418
  errorFactory,
@@ -4640,6 +4655,7 @@ const validateLayoutElementItems = ({ items, path, errorFactory }) => {
4640
4655
  "hoverSoundId",
4641
4656
  "clickSoundId",
4642
4657
  "revealSoundId",
4658
+ "revealSoundStopTiming",
4643
4659
  "textStyleId",
4644
4660
  "hoverTextStyleId",
4645
4661
  "clickTextStyleId",