@routevn/creator-model 1.2.4 → 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 +6 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routevn/creator-model",
3
- "version": "1.2.4",
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;
@@ -3751,7 +3733,7 @@ const validateLayoutItems = ({ items, path, errorFactory }) => {
3751
3733
  if (!LAYOUT_TYPE_KEYS.includes(item.layoutType)) {
3752
3734
  return invalidFromErrorFactory(
3753
3735
  errorFactory,
3754
- `${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'`,
3755
3737
  );
3756
3738
  }
3757
3739
 
@@ -8222,7 +8204,7 @@ const validateLayoutCreateData = ({ data, errorFactory }) => {
8222
8204
  if (!LAYOUT_TYPE_KEYS.includes(data.layoutType)) {
8223
8205
  return invalidFromErrorFactory(
8224
8206
  errorFactory,
8225
- "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'",
8226
8208
  );
8227
8209
  }
8228
8210
 
@@ -8304,7 +8286,7 @@ const validateLayoutUpdateData = ({ data, errorFactory }) => {
8304
8286
  ) {
8305
8287
  return invalidFromErrorFactory(
8306
8288
  errorFactory,
8307
- "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",
8308
8290
  );
8309
8291
  }
8310
8292