@routevn/creator-model 1.1.2 → 1.1.3

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 +15 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routevn/creator-model",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/model.js CHANGED
@@ -109,6 +109,7 @@ const VARIABLE_SCOPE_KEYS = ["context", "global-device", "global-account"];
109
109
  const VARIABLE_TYPE_KEYS = ["string", "number", "boolean"];
110
110
  const LAYOUT_TYPE_KEYS = ["normal", "dialogue", "nvl", "choice"];
111
111
  const LAYOUT_ELEMENT_TEXT_STYLE_ALIGN_KEYS = ["left", "center", "right"];
112
+ const LAYOUT_TEXT_REVEAL_EFFECT_KEYS = ["typewriter", "softWipe", "none"];
112
113
  const LAYOUT_ELEMENT_BASE_TYPES = [
113
114
  "folder",
114
115
  "container",
@@ -2095,11 +2096,7 @@ const validateCharacterSpriteItems = ({ items, path, errorFactory }) => {
2095
2096
  }
2096
2097
  };
2097
2098
 
2098
- const validateLayoutElementTextStyle = ({
2099
- textStyle,
2100
- path,
2101
- errorFactory,
2102
- }) => {
2099
+ const validateLayoutElementTextStyle = ({ textStyle, path, errorFactory }) => {
2103
2100
  {
2104
2101
  const result = validateAllowedKeys({
2105
2102
  value: textStyle,
@@ -2202,6 +2199,7 @@ const validateLayoutElementData = ({
2202
2199
  "text",
2203
2200
  "textStyle",
2204
2201
  "displaySpeed",
2202
+ "revealEffect",
2205
2203
  "imageId",
2206
2204
  "hoverImageId",
2207
2205
  "clickImageId",
@@ -2314,6 +2312,7 @@ const validateLayoutElementData = ({
2314
2312
  "clickTextStyleId",
2315
2313
  "containerType",
2316
2314
  "variableId",
2315
+ "revealEffect",
2317
2316
  "thumbImageId",
2318
2317
  "barImageId",
2319
2318
  "hoverThumbImageId",
@@ -2335,6 +2334,16 @@ const validateLayoutElementData = ({
2335
2334
  );
2336
2335
  }
2337
2336
 
2337
+ if (
2338
+ data.revealEffect !== undefined &&
2339
+ !LAYOUT_TEXT_REVEAL_EFFECT_KEYS.includes(data.revealEffect)
2340
+ ) {
2341
+ return invalidFromErrorFactory(
2342
+ errorFactory,
2343
+ `${path}.revealEffect must be one of ${LAYOUT_TEXT_REVEAL_EFFECT_KEYS.join(", ")} when provided`,
2344
+ );
2345
+ }
2346
+
2338
2347
  if (
2339
2348
  data.direction !== undefined &&
2340
2349
  data.direction !== "horizontal" &&
@@ -2444,6 +2453,7 @@ const validateLayoutElementItems = ({ items, path, errorFactory }) => {
2444
2453
  "text",
2445
2454
  "textStyle",
2446
2455
  "displaySpeed",
2456
+ "revealEffect",
2447
2457
  "imageId",
2448
2458
  "hoverImageId",
2449
2459
  "clickImageId",