@routevn/creator-model 1.2.3 → 1.2.5

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 +12 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routevn/creator-model",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/model.js CHANGED
@@ -123,11 +123,11 @@ const ANIMATION_EASING_KEYS = [
123
123
  const VARIABLE_SCOPE_KEYS = ["context", "device", "account"];
124
124
  const VARIABLE_TYPE_KEYS = ["string", "number", "boolean"];
125
125
  const LAYOUT_TYPE_KEYS = [
126
- "normal",
126
+ "general",
127
127
  "save-load",
128
128
  "confirmDialog",
129
- "dialogue",
130
- "nvl",
129
+ "dialogue-adv",
130
+ "dialogue-nvl",
131
131
  "choice",
132
132
  "history",
133
133
  ];
@@ -1506,13 +1506,6 @@ const validateTweenDefinition = ({
1506
1506
  return invalidFromErrorFactory(errorFactory, `${path} must be an object`);
1507
1507
  }
1508
1508
 
1509
- if (Object.keys(tween).length === 0) {
1510
- return invalidFromErrorFactory(
1511
- errorFactory,
1512
- `${path} must include at least one tween property`,
1513
- );
1514
- }
1515
-
1516
1509
  for (const [propertyName, config] of Object.entries(tween)) {
1517
1510
  const propertyPath = `${path}.${propertyName}`;
1518
1511
 
@@ -1866,17 +1859,6 @@ const validateAnimationDefinition = ({ animation, path, errorFactory }) => {
1866
1859
  );
1867
1860
  }
1868
1861
 
1869
- if (
1870
- animation.prev === undefined &&
1871
- animation.next === undefined &&
1872
- animation.mask === undefined
1873
- ) {
1874
- return invalidFromErrorFactory(
1875
- errorFactory,
1876
- `${path} must define at least one of prev, next, or mask when ${path}.type is 'transition'`,
1877
- );
1878
- }
1879
-
1880
1862
  for (const side of ["prev", "next"]) {
1881
1863
  if (animation[side] === undefined) {
1882
1864
  continue;
@@ -2933,7 +2915,8 @@ const validateLayoutElementData = ({
2933
2915
  "clickTextStyleId",
2934
2916
  "conditionalOverrides",
2935
2917
  "direction",
2936
- "gap",
2918
+ "gapX",
2919
+ "gapY",
2937
2920
  "containerType",
2938
2921
  "scroll",
2939
2922
  "hover",
@@ -2999,7 +2982,8 @@ const validateLayoutElementData = ({
2999
2982
  "scaleY",
3000
2983
  "rotation",
3001
2984
  "displaySpeed",
3002
- "gap",
2985
+ "gapX",
2986
+ "gapY",
3003
2987
  "min",
3004
2988
  "max",
3005
2989
  "step",
@@ -3470,7 +3454,8 @@ const validateLayoutElementItems = ({ items, path, errorFactory }) => {
3470
3454
  "clickTextStyleId",
3471
3455
  "conditionalOverrides",
3472
3456
  "direction",
3473
- "gap",
3457
+ "gapX",
3458
+ "gapY",
3474
3459
  "containerType",
3475
3460
  "scroll",
3476
3461
  "hover",
@@ -3748,7 +3733,7 @@ const validateLayoutItems = ({ items, path, errorFactory }) => {
3748
3733
  if (!LAYOUT_TYPE_KEYS.includes(item.layoutType)) {
3749
3734
  return invalidFromErrorFactory(
3750
3735
  errorFactory,
3751
- `${itemPath}.layoutType must be 'normal', 'save-load', 'confirmDialog', 'dialogue', 'nvl', 'choice', or 'history'`,
3736
+ `${itemPath}.layoutType must be 'general', 'save-load', 'confirmDialog', 'dialogue-adv', 'dialogue-nvl', 'choice', or 'history'`,
3752
3737
  );
3753
3738
  }
3754
3739
 
@@ -8219,7 +8204,7 @@ const validateLayoutCreateData = ({ data, errorFactory }) => {
8219
8204
  if (!LAYOUT_TYPE_KEYS.includes(data.layoutType)) {
8220
8205
  return invalidFromErrorFactory(
8221
8206
  errorFactory,
8222
- "payload.data.layoutType must be 'normal', 'save-load', 'confirmDialog', 'dialogue', 'nvl', 'choice', or 'history'",
8207
+ "payload.data.layoutType must be 'general', 'save-load', 'confirmDialog', 'dialogue-adv', 'dialogue-nvl', 'choice', or 'history'",
8223
8208
  );
8224
8209
  }
8225
8210
 
@@ -8301,7 +8286,7 @@ const validateLayoutUpdateData = ({ data, errorFactory }) => {
8301
8286
  ) {
8302
8287
  return invalidFromErrorFactory(
8303
8288
  errorFactory,
8304
- "payload.data.layoutType must be 'normal', 'save-load', 'confirmDialog', 'dialogue', 'nvl', 'choice', or 'history' when provided",
8289
+ "payload.data.layoutType must be 'general', 'save-load', 'confirmDialog', 'dialogue-adv', 'dialogue-nvl', 'choice', or 'history' when provided",
8305
8290
  );
8306
8291
  }
8307
8292