@routevn/creator-model 1.1.0 → 1.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/model.js +16 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routevn/creator-model",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/model.js CHANGED
@@ -2095,10 +2095,14 @@ const validateCharacterSpriteItems = ({ items, path, errorFactory }) => {
2095
2095
  }
2096
2096
  };
2097
2097
 
2098
- const validateLayoutElementStyle = ({ style, path, errorFactory }) => {
2098
+ const validateLayoutElementTextStyle = ({
2099
+ textStyle,
2100
+ path,
2101
+ errorFactory,
2102
+ }) => {
2099
2103
  {
2100
2104
  const result = validateAllowedKeys({
2101
- value: style,
2105
+ value: textStyle,
2102
2106
  allowedKeys: ["align", "wordWrapWidth"],
2103
2107
  path,
2104
2108
  errorFactory,
@@ -2109,8 +2113,8 @@ const validateLayoutElementStyle = ({ style, path, errorFactory }) => {
2109
2113
  }
2110
2114
 
2111
2115
  if (
2112
- style.align !== undefined &&
2113
- !LAYOUT_ELEMENT_TEXT_STYLE_ALIGN_KEYS.includes(style.align)
2116
+ textStyle.align !== undefined &&
2117
+ !LAYOUT_ELEMENT_TEXT_STYLE_ALIGN_KEYS.includes(textStyle.align)
2114
2118
  ) {
2115
2119
  return invalidFromErrorFactory(
2116
2120
  errorFactory,
@@ -2119,8 +2123,8 @@ const validateLayoutElementStyle = ({ style, path, errorFactory }) => {
2119
2123
  }
2120
2124
 
2121
2125
  if (
2122
- style.wordWrapWidth !== undefined &&
2123
- !isFiniteNumber(style.wordWrapWidth)
2126
+ textStyle.wordWrapWidth !== undefined &&
2127
+ !isFiniteNumber(textStyle.wordWrapWidth)
2124
2128
  ) {
2125
2129
  return invalidFromErrorFactory(
2126
2130
  errorFactory,
@@ -2196,7 +2200,7 @@ const validateLayoutElementData = ({
2196
2200
  "fill",
2197
2201
  "border",
2198
2202
  "text",
2199
- "style",
2203
+ "textStyle",
2200
2204
  "displaySpeed",
2201
2205
  "imageId",
2202
2206
  "hoverImageId",
@@ -2359,11 +2363,11 @@ const validateLayoutElementData = ({
2359
2363
  );
2360
2364
  }
2361
2365
 
2362
- if (data.style !== undefined) {
2366
+ if (data.textStyle !== undefined) {
2363
2367
  {
2364
- const result = validateLayoutElementStyle({
2365
- style: data.style,
2366
- path: `${path}.style`,
2368
+ const result = validateLayoutElementTextStyle({
2369
+ textStyle: data.textStyle,
2370
+ path: `${path}.textStyle`,
2367
2371
  errorFactory,
2368
2372
  });
2369
2373
  if (result?.valid === false) {
@@ -2438,7 +2442,7 @@ const validateLayoutElementItems = ({ items, path, errorFactory }) => {
2438
2442
  "fill",
2439
2443
  "border",
2440
2444
  "text",
2441
- "style",
2445
+ "textStyle",
2442
2446
  "displaySpeed",
2443
2447
  "imageId",
2444
2448
  "hoverImageId",