hh-contracts 0.0.73 → 0.0.74
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.
- package/build/common/constants/{icon-keys.constant.js → icon.constants.js} +7 -1
- package/build/common/constants/index.js +1 -1
- package/build/common/constants/locales.constant.js +3 -3
- package/build/hotels/contracts/find-hotel.contract.js +2 -0
- package/build/hotels/contracts/index.js +1 -1
- package/build/hotels/hotel.model.js +1 -0
- package/build/hotels/hotels.api.js +3 -1
- package/build/hotels/index.js +2 -1
- package/build/hotels/sites/contracts/find-hotel-site-page-by-lang.contract.js +56 -0
- package/build/hotels/sites/contracts/index.js +17 -0
- package/build/hotels/sites/index.js +17 -0
- package/build/hotels/{contracts → themes/contracts}/find-hotel-theme.contract.js +3 -3
- package/build/hotels/themes/contracts/index.js +17 -0
- package/build/hotels/themes/index.js +1 -0
- package/build/index.js +1 -0
- package/build/pages/constants/block-type.constant.js +11 -0
- package/build/pages/constants/cta-actions.constant.js +7 -0
- package/build/pages/constants/hero.constants.js +15 -0
- package/build/pages/constants/image-loading.constant.js +8 -0
- package/build/pages/constants/index.js +21 -0
- package/build/pages/constants/media.constants.js +17 -0
- package/build/pages/index.js +18 -0
- package/build/pages/models/blocks/base-block.schema.js +44 -0
- package/build/pages/models/blocks/block.schemas.js +69 -0
- package/build/pages/models/blocks/cta.schema.js +80 -0
- package/build/pages/models/blocks/hero-block.schema.js +58 -0
- package/build/pages/models/blocks/html-block.schema.js +46 -0
- package/build/pages/models/blocks/index.js +22 -0
- package/build/pages/models/blocks/media.schemas.js +84 -0
- package/build/pages/models/index.js +18 -0
- package/build/pages/models/page.schema.js +62 -0
- package/common/constants/{icon-keys.constant.ts → icon.constants.ts} +8 -0
- package/common/constants/index.ts +1 -1
- package/common/constants/locales.constant.ts +1 -1
- package/hotels/contracts/find-hotel.contract.ts +1 -0
- package/hotels/contracts/index.ts +1 -1
- package/hotels/hotel.model.ts +1 -0
- package/hotels/hotels.api.ts +3 -1
- package/hotels/index.ts +2 -1
- package/hotels/sites/contracts/find-hotel-site-page-by-lang.contract.ts +26 -0
- package/hotels/sites/contracts/index.ts +1 -0
- package/hotels/sites/index.ts +1 -0
- package/hotels/{contracts → themes/contracts}/find-hotel-theme.contract.ts +3 -3
- package/hotels/themes/contracts/index.ts +1 -0
- package/hotels/themes/index.ts +1 -0
- package/index.ts +1 -0
- package/package.json +1 -1
- package/pages/constants/block-type.constant.ts +11 -0
- package/pages/constants/cta-actions.constant.ts +5 -0
- package/pages/constants/hero.constants.ts +18 -0
- package/pages/constants/image-loading.constant.ts +8 -0
- package/pages/constants/index.ts +5 -0
- package/pages/constants/media.constants.ts +20 -0
- package/pages/index.ts +2 -0
- package/pages/models/blocks/base-block.schema.ts +11 -0
- package/pages/models/blocks/block.schemas.ts +57 -0
- package/pages/models/blocks/cta.schema.ts +58 -0
- package/pages/models/blocks/hero-block.schema.ts +27 -0
- package/pages/models/blocks/html-block.schema.ts +14 -0
- package/pages/models/blocks/index.ts +6 -0
- package/pages/models/blocks/media.schemas.ts +66 -0
- package/pages/models/index.ts +2 -0
- package/pages/models/page.schema.ts +31 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ICON_KEY_VALUES = exports.ICON_KEYS = void 0;
|
|
3
|
+
exports.ICON_POSITION_VALUES = exports.ICON_POSITION = exports.ICON_KEY_VALUES = exports.ICON_KEYS = void 0;
|
|
4
4
|
exports.ICON_KEYS = {
|
|
5
5
|
// eye: 'eye',
|
|
6
6
|
// eyeSlash: 'eyeSlash',
|
|
@@ -23,6 +23,7 @@ exports.ICON_KEYS = {
|
|
|
23
23
|
search: 'search',
|
|
24
24
|
language: 'language',
|
|
25
25
|
magic: 'magic',
|
|
26
|
+
play: 'play',
|
|
26
27
|
// close: 'close',
|
|
27
28
|
// check: 'check',
|
|
28
29
|
// closeFilled: 'closeFilled',
|
|
@@ -31,3 +32,8 @@ exports.ICON_KEYS = {
|
|
|
31
32
|
flagRU: 'flagRU',
|
|
32
33
|
};
|
|
33
34
|
exports.ICON_KEY_VALUES = Object.values(exports.ICON_KEYS);
|
|
35
|
+
exports.ICON_POSITION = {
|
|
36
|
+
start: 'start',
|
|
37
|
+
end: 'end',
|
|
38
|
+
};
|
|
39
|
+
exports.ICON_POSITION_VALUES = Object.values(exports.ICON_POSITION);
|
|
@@ -20,7 +20,7 @@ __exportStar(require("./app-statuses.constant"), exports);
|
|
|
20
20
|
__exportStar(require("./default-pagination-config.constant"), exports);
|
|
21
21
|
__exportStar(require("./entity.constant"), exports);
|
|
22
22
|
__exportStar(require("./http-method.constant"), exports);
|
|
23
|
-
__exportStar(require("./icon
|
|
23
|
+
__exportStar(require("./icon.constants"), exports);
|
|
24
24
|
__exportStar(require("./kind-of-app.constant"), exports);
|
|
25
25
|
__exportStar(require("./locales.constant"), exports);
|
|
26
26
|
__exportStar(require("./navigation-item-type.constant"), exports);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LANGUAGE_KEYS = exports.LANGUAGES = void 0;
|
|
4
|
-
const
|
|
4
|
+
const icon_constants_1 = require("./icon.constants");
|
|
5
5
|
exports.LANGUAGES = {
|
|
6
6
|
en: {
|
|
7
7
|
value: 'en',
|
|
8
8
|
label: 'English',
|
|
9
|
-
flag:
|
|
9
|
+
flag: icon_constants_1.ICON_KEYS.flagGB,
|
|
10
10
|
locale: 'en-US',
|
|
11
11
|
postgressLocale: 'en_US',
|
|
12
12
|
},
|
|
13
13
|
ru: {
|
|
14
14
|
value: 'ru',
|
|
15
15
|
label: 'Русский',
|
|
16
|
-
flag:
|
|
16
|
+
flag: icon_constants_1.ICON_KEYS.flagRU,
|
|
17
17
|
locale: 'ru-RU',
|
|
18
18
|
postgressLocale: 'ru_RU',
|
|
19
19
|
},
|
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./find-hotel
|
|
17
|
+
__exportStar(require("./find-hotel.contract"), exports);
|
|
@@ -39,6 +39,7 @@ const common_1 = require("../common");
|
|
|
39
39
|
exports.HotelPersistedSchema = z
|
|
40
40
|
.object({
|
|
41
41
|
id: z.uuid(),
|
|
42
|
+
//убрать из модели так как у одного отеля может быть несколько юр лиц
|
|
42
43
|
companyId: z.uuid(),
|
|
43
44
|
slug: common_1.SlugSchema,
|
|
44
45
|
status: z.enum(common_1.AppStatuses.HOTEL_VALUES),
|
|
@@ -5,7 +5,9 @@ const utils_1 = require("../common/utils");
|
|
|
5
5
|
exports.HOTELS_CONTROLLER = {
|
|
6
6
|
prefix: 'hotels',
|
|
7
7
|
endpoints: {
|
|
8
|
-
findTheme: '
|
|
8
|
+
findTheme: 'by-slug/:hotelslug/theme',
|
|
9
|
+
findSitePageByLang: 'by-slug/:hotelslug/sites/pages/:slug',
|
|
10
|
+
findSitePage: 'by-slug/:hotelslug/sites/pages/:slug',
|
|
9
11
|
},
|
|
10
12
|
};
|
|
11
13
|
exports.HOTELS_API = (0, utils_1.createApi)(exports.HOTELS_CONTROLLER);
|
package/build/hotels/index.js
CHANGED
|
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./contracts"), exports);
|
|
18
|
+
__exportStar(require("./sites"), exports);
|
|
17
19
|
__exportStar(require("./themes"), exports);
|
|
18
20
|
__exportStar(require("./hotel.model"), exports);
|
|
19
21
|
__exportStar(require("./hotels.api"), exports);
|
|
20
|
-
__exportStar(require("./contracts"), exports);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.FindHotelSitePageByLangContract = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../../../common");
|
|
39
|
+
const hotels_api_1 = require("../../hotels.api");
|
|
40
|
+
const pages_1 = require("../../../pages");
|
|
41
|
+
const FindHotelSitePageByLangContractRequestSchema = z.object({
|
|
42
|
+
lang: common_1.LanguageKeysSchema,
|
|
43
|
+
});
|
|
44
|
+
const FindHotelSitePageByLangContractResponseSchema = pages_1.PageSchema.omit({
|
|
45
|
+
translations: true,
|
|
46
|
+
}).extend({
|
|
47
|
+
translation: pages_1.PageLangTranslationSchema,
|
|
48
|
+
});
|
|
49
|
+
var FindHotelSitePageByLangContract;
|
|
50
|
+
(function (FindHotelSitePageByLangContract) {
|
|
51
|
+
FindHotelSitePageByLangContract.getUrl = hotels_api_1.HOTELS_API.findSitePageByLang;
|
|
52
|
+
FindHotelSitePageByLangContract.endpoint = hotels_api_1.HOTELS_CONTROLLER.endpoints.findSitePageByLang;
|
|
53
|
+
FindHotelSitePageByLangContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
54
|
+
FindHotelSitePageByLangContract.RequestSchema = FindHotelSitePageByLangContractRequestSchema;
|
|
55
|
+
FindHotelSitePageByLangContract.ResponseSchema = FindHotelSitePageByLangContractResponseSchema;
|
|
56
|
+
})(FindHotelSitePageByLangContract || (exports.FindHotelSitePageByLangContract = FindHotelSitePageByLangContract = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./find-hotel-site-page-by-lang.contract"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./contracts"), exports);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FindHotelThemeContract = void 0;
|
|
4
|
-
const common_1 = require("
|
|
5
|
-
const theme_models_1 = require("../
|
|
6
|
-
const hotels_api_1 = require("
|
|
4
|
+
const common_1 = require("../../../common");
|
|
5
|
+
const theme_models_1 = require("../theme.models");
|
|
6
|
+
const hotels_api_1 = require("../../hotels.api");
|
|
7
7
|
var FindHotelThemeContract;
|
|
8
8
|
(function (FindHotelThemeContract) {
|
|
9
9
|
FindHotelThemeContract.getUrl = hotels_api_1.HOTELS_API.findTheme;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./find-hotel-theme.contract"), exports);
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./constants"), exports);
|
|
18
18
|
__exportStar(require("./theme.models"), exports);
|
|
19
|
+
__exportStar(require("./contracts"), exports);
|
package/build/index.js
CHANGED
|
@@ -18,6 +18,7 @@ __exportStar(require("./hotels"), exports);
|
|
|
18
18
|
__exportStar(require("./common"), exports);
|
|
19
19
|
__exportStar(require("./companies"), exports);
|
|
20
20
|
__exportStar(require("./app-menu"), exports);
|
|
21
|
+
__exportStar(require("./pages"), exports);
|
|
21
22
|
__exportStar(require("./permissions"), exports);
|
|
22
23
|
__exportStar(require("./roles"), exports);
|
|
23
24
|
__exportStar(require("./tenants"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BLOCK_TYPE_VALUES = exports.BLOCK_TYPES = void 0;
|
|
4
|
+
exports.BLOCK_TYPES = {
|
|
5
|
+
hero: 'hero',
|
|
6
|
+
html: 'html',
|
|
7
|
+
linkCta: 'link-cta',
|
|
8
|
+
buttonCta: 'button-cta',
|
|
9
|
+
container: 'container',
|
|
10
|
+
};
|
|
11
|
+
exports.BLOCK_TYPE_VALUES = Object.values(exports.BLOCK_TYPES);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HERO_HEIGHT_VALUES = exports.HERO_HEIGHT = exports.HERO_VARIANT_VALUES = exports.HERO_VARIANTS = void 0;
|
|
4
|
+
exports.HERO_VARIANTS = {
|
|
5
|
+
headerOnMedia: 'header-on-media',
|
|
6
|
+
};
|
|
7
|
+
exports.HERO_VARIANT_VALUES = Object.values(exports.HERO_VARIANTS);
|
|
8
|
+
exports.HERO_HEIGHT = {
|
|
9
|
+
screen50: '50dvh',
|
|
10
|
+
screen75: '75dvh',
|
|
11
|
+
screen80: '80dvh',
|
|
12
|
+
screen90: '90dvh',
|
|
13
|
+
screen100: '100dvh',
|
|
14
|
+
};
|
|
15
|
+
exports.HERO_HEIGHT_VALUES = Object.values(exports.HERO_HEIGHT);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMAGE_LOADING_VALUES = exports.IMAGE_LOADING = void 0;
|
|
4
|
+
exports.IMAGE_LOADING = {
|
|
5
|
+
lazy: 'lazy',
|
|
6
|
+
eager: 'eager',
|
|
7
|
+
};
|
|
8
|
+
exports.IMAGE_LOADING_VALUES = Object.values(exports.IMAGE_LOADING);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./block-type.constant"), exports);
|
|
18
|
+
__exportStar(require("./cta-actions.constant"), exports);
|
|
19
|
+
__exportStar(require("./hero.constants"), exports);
|
|
20
|
+
__exportStar(require("./image-loading.constant"), exports);
|
|
21
|
+
__exportStar(require("./media.constants"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MEDIA_PRIORITY_VALUES = exports.MEDIA_PRIORITIES = exports.MEDIA_TYPE_VALUES = exports.MEDIA_TYPES = void 0;
|
|
4
|
+
exports.MEDIA_TYPES = {
|
|
5
|
+
image: 'image',
|
|
6
|
+
video: 'video',
|
|
7
|
+
slider: 'slider',
|
|
8
|
+
};
|
|
9
|
+
exports.MEDIA_TYPE_VALUES = Object.values(exports.MEDIA_TYPES);
|
|
10
|
+
// Добавляем приоритеты для адаптивности
|
|
11
|
+
exports.MEDIA_PRIORITIES = {
|
|
12
|
+
desktop: 'desktop',
|
|
13
|
+
mobile: 'mobile',
|
|
14
|
+
tablet: 'tablet',
|
|
15
|
+
all: 'all', // универсальное медиа
|
|
16
|
+
};
|
|
17
|
+
exports.MEDIA_PRIORITY_VALUES = Object.values(exports.MEDIA_PRIORITIES);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./constants"), exports);
|
|
18
|
+
__exportStar(require("./models"), exports);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BaseBlockSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const constants_1 = require("../../constants");
|
|
39
|
+
exports.BaseBlockSchema = z.object({
|
|
40
|
+
id: z.uuid(),
|
|
41
|
+
key: z.string(),
|
|
42
|
+
order: z.number().int().nonnegative(),
|
|
43
|
+
type: z.enum(constants_1.BLOCK_TYPE_VALUES),
|
|
44
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BlocksTranslationSchema = exports.BlockTranslationSchema = exports.BlockSchema = exports.ContainerTranslationSchema = exports.ContainerBlockSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const hero_block_schema_1 = require("./hero-block.schema");
|
|
39
|
+
const html_block_schema_1 = require("./html-block.schema");
|
|
40
|
+
const cta_schema_1 = require("./cta.schema");
|
|
41
|
+
const constants_1 = require("../../constants");
|
|
42
|
+
const base_block_schema_1 = require("./base-block.schema");
|
|
43
|
+
exports.ContainerBlockSchema = base_block_schema_1.BaseBlockSchema.extend({
|
|
44
|
+
type: z.literal(constants_1.BLOCK_TYPES.container),
|
|
45
|
+
config: z.object({
|
|
46
|
+
gap: z.number().int().nonnegative().default(0),
|
|
47
|
+
}),
|
|
48
|
+
children: z.array(z.lazy(() => exports.BlockSchema)),
|
|
49
|
+
});
|
|
50
|
+
exports.ContainerTranslationSchema = z.object({
|
|
51
|
+
type: z.literal(constants_1.BLOCK_TYPES.container),
|
|
52
|
+
});
|
|
53
|
+
// Схема блока (union) с явной аннотацией и z.lazy
|
|
54
|
+
exports.BlockSchema = z.lazy(() => z.discriminatedUnion('type', [
|
|
55
|
+
hero_block_schema_1.HeroBlockSchema,
|
|
56
|
+
exports.ContainerBlockSchema,
|
|
57
|
+
html_block_schema_1.HtmlBlockSchema,
|
|
58
|
+
cta_schema_1.LinkCtaBlockSchema,
|
|
59
|
+
cta_schema_1.ButtonCtaBlockSchema,
|
|
60
|
+
]));
|
|
61
|
+
exports.BlockTranslationSchema = z.discriminatedUnion('type', [
|
|
62
|
+
hero_block_schema_1.HeroTranslationSchema,
|
|
63
|
+
exports.ContainerTranslationSchema,
|
|
64
|
+
html_block_schema_1.HtmlTranslationSchema,
|
|
65
|
+
cta_schema_1.LinkCtaTranslationSchema,
|
|
66
|
+
cta_schema_1.ButtonCtaTranslationSchema,
|
|
67
|
+
]);
|
|
68
|
+
// Переводы по ключу блока (контейнер не имеет собственных переводов)
|
|
69
|
+
exports.BlocksTranslationSchema = z.record(z.string(), exports.BlockTranslationSchema);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ButtonCtaTranslationSchema = exports.LinkCtaTranslationSchema = exports.CtaTranslationSchema = exports.CtaConfigSchema = exports.CtaBlockSchema = exports.ButtonCtaBlockSchema = exports.LinkCtaBlockSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const constants_1 = require("../../constants");
|
|
39
|
+
const common_1 = require("../../../common");
|
|
40
|
+
const base_block_schema_1 = require("./base-block.schema");
|
|
41
|
+
const BaseCtaConfigSchema = z.object({
|
|
42
|
+
key: z.string(),
|
|
43
|
+
iconKey: common_1.IconKeySchema.optional(),
|
|
44
|
+
iconPosition: z.enum(common_1.ICON_POSITION_VALUES).optional(),
|
|
45
|
+
});
|
|
46
|
+
const BaseCtaBlockSchema = base_block_schema_1.BaseBlockSchema.extend({
|
|
47
|
+
...BaseCtaConfigSchema.omit({ key: true }).shape,
|
|
48
|
+
});
|
|
49
|
+
const CtaLinkSchema = z.object({
|
|
50
|
+
type: z.literal(constants_1.BLOCK_TYPES.linkCta),
|
|
51
|
+
href: z.url(),
|
|
52
|
+
});
|
|
53
|
+
const LinkCtaConfigSchema = BaseCtaConfigSchema.extend(CtaLinkSchema.shape);
|
|
54
|
+
exports.LinkCtaBlockSchema = BaseCtaBlockSchema.extend(CtaLinkSchema.shape);
|
|
55
|
+
const CtaButtonSchema = z.object({
|
|
56
|
+
type: z.literal(constants_1.BLOCK_TYPES.buttonCta),
|
|
57
|
+
action: z.enum(constants_1.CTA_ACTIONS_VALUES).optional(),
|
|
58
|
+
});
|
|
59
|
+
const ButtonCtaConfigSchema = BaseCtaConfigSchema.extend(CtaButtonSchema.shape);
|
|
60
|
+
exports.ButtonCtaBlockSchema = BaseCtaBlockSchema.extend(CtaButtonSchema.shape);
|
|
61
|
+
exports.CtaBlockSchema = z.discriminatedUnion('type', [
|
|
62
|
+
exports.LinkCtaBlockSchema,
|
|
63
|
+
exports.ButtonCtaBlockSchema,
|
|
64
|
+
]);
|
|
65
|
+
exports.CtaConfigSchema = z.discriminatedUnion('type', [
|
|
66
|
+
LinkCtaConfigSchema,
|
|
67
|
+
ButtonCtaConfigSchema,
|
|
68
|
+
]);
|
|
69
|
+
exports.CtaTranslationSchema = z.object({
|
|
70
|
+
label: z.string().optional(),
|
|
71
|
+
iconAlt: z.string().optional(),
|
|
72
|
+
});
|
|
73
|
+
exports.LinkCtaTranslationSchema = z.object({
|
|
74
|
+
type: z.literal(constants_1.BLOCK_TYPES.linkCta),
|
|
75
|
+
...exports.CtaTranslationSchema.shape,
|
|
76
|
+
});
|
|
77
|
+
exports.ButtonCtaTranslationSchema = z.object({
|
|
78
|
+
type: z.literal(constants_1.BLOCK_TYPES.buttonCta),
|
|
79
|
+
...exports.CtaTranslationSchema.shape,
|
|
80
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.HeroTranslationSchema = exports.HeroBlockSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const constants_1 = require("../../constants");
|
|
39
|
+
const base_block_schema_1 = require("./base-block.schema");
|
|
40
|
+
const media_schemas_1 = require("./media.schemas");
|
|
41
|
+
const cta_schema_1 = require("./cta.schema");
|
|
42
|
+
exports.HeroBlockSchema = base_block_schema_1.BaseBlockSchema.extend({
|
|
43
|
+
type: z.literal(constants_1.BLOCK_TYPES.hero),
|
|
44
|
+
variant: z.enum(constants_1.HERO_VARIANT_VALUES),
|
|
45
|
+
config: z.object({
|
|
46
|
+
height: z.enum(constants_1.HERO_HEIGHT_VALUES),
|
|
47
|
+
media: z.array(media_schemas_1.MediaSchema),
|
|
48
|
+
ctas: z.array(cta_schema_1.CtaConfigSchema),
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
exports.HeroTranslationSchema = z.object({
|
|
52
|
+
type: z.literal(constants_1.BLOCK_TYPES.hero),
|
|
53
|
+
headline: z.string(),
|
|
54
|
+
subheadline: z.string().optional(),
|
|
55
|
+
description: z.string().optional(),
|
|
56
|
+
media: z.record(z.string(), z.object({ alt: z.string() })).optional(),
|
|
57
|
+
ctas: z.record(z.string(), cta_schema_1.CtaTranslationSchema).optional(),
|
|
58
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.HtmlTranslationSchema = exports.HtmlBlockSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const constants_1 = require("../../constants");
|
|
39
|
+
const base_block_schema_1 = require("./base-block.schema");
|
|
40
|
+
exports.HtmlBlockSchema = base_block_schema_1.BaseBlockSchema.extend({
|
|
41
|
+
type: z.literal(constants_1.BLOCK_TYPES.html),
|
|
42
|
+
});
|
|
43
|
+
exports.HtmlTranslationSchema = z.object({
|
|
44
|
+
type: z.literal(constants_1.BLOCK_TYPES.html),
|
|
45
|
+
content: z.string().optional(),
|
|
46
|
+
});
|