denwa-web-shared 1.0.60 → 1.0.61
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/dist/client/index.cjs.js +198 -3337
- package/dist/client/index.es.js +198 -3348
- package/dist/denwa-web-shared.cjs.js +1 -1
- package/dist/denwa-web-shared.es.js +0 -1
- package/dist/server/denwa-web-shared.css +1 -0
- package/dist/server/index.cjs.js +1232 -7089
- package/dist/server/index.es.js +1208 -7130
- package/dist/server/lib/index.d.ts +1 -0
- package/dist/server/lib/openapi-axios/const/defaultOptions.d.ts +5 -0
- package/dist/server/lib/openapi-axios/const/methods.d.ts +18 -0
- package/dist/server/lib/openapi-axios/index.d.ts +80 -0
- package/dist/server/lib/openapi-axios/interpolate-params.d.ts +11 -0
- package/dist/server/lib/openapi-axios/types/options.d.ts +27 -0
- package/dist/server/lib/openapi-axios/types/requestParameters.d.ts +22 -0
- package/dist/server/lib/openapi-axios/types/response.d.ts +100 -0
- package/dist/server/lib/openapi-axios/types/schemeTypes.d.ts +69 -0
- package/dist/server/lib/openapi-axios/types/serializer.d.ts +21 -0
- package/dist/server/lib/openapi-axios/types/utils.d.ts +44 -0
- package/dist/server/lib/openapi-axios/utils/querySerializer.d.ts +3 -0
- package/dist/server/lib/openapi-axios/utils/response-converters/convertToAll.d.ts +5 -0
- package/dist/server/lib/openapi-axios/utils/response-converters/convertToAxios.d.ts +5 -0
- package/dist/server/lib/openapi-axios/utils/response-converters/convertToFetch.d.ts +5 -0
- package/dist/src/client/hooks/index.d.ts +4 -0
- package/dist/src/client/hooks/use-appear-animation.d.ts +17 -0
- package/dist/src/client/hooks/use-disable-scroll.d.ts +1 -0
- package/dist/src/client/hooks/use-is-client.d.ts +1 -0
- package/dist/src/client/hooks/use-view-port.d.ts +24 -0
- package/dist/src/client/index.d.ts +2 -0
- package/dist/src/client/ui/animated-div.d.ts +8 -0
- package/dist/src/client/ui/header-wrapper.d.ts +10 -0
- package/dist/src/client/ui/index.d.ts +2 -0
- package/dist/src/client/ui/infinity-list.d.ts +10 -0
- package/dist/src/server/constants/index.d.ts +45 -0
- package/dist/src/server/index.d.ts +5 -0
- package/dist/src/server/lib/css.d.ts +2 -0
- package/dist/src/server/lib/files.d.ts +82 -0
- package/dist/src/server/lib/index.d.ts +4 -0
- package/dist/src/server/lib/openapi-axios/const/defaultOptions.d.ts +5 -0
- package/dist/src/server/lib/openapi-axios/const/methods.d.ts +18 -0
- package/dist/src/server/lib/openapi-axios/index.d.ts +80 -0
- package/dist/src/server/lib/openapi-axios/interpolate-params.d.ts +11 -0
- package/dist/src/server/lib/openapi-axios/types/options.d.ts +27 -0
- package/dist/src/server/lib/openapi-axios/types/requestParameters.d.ts +22 -0
- package/dist/src/server/lib/openapi-axios/types/response.d.ts +100 -0
- package/dist/src/server/lib/openapi-axios/types/schemeTypes.d.ts +69 -0
- package/dist/src/server/lib/openapi-axios/types/serializer.d.ts +21 -0
- package/dist/src/server/lib/openapi-axios/types/utils.d.ts +44 -0
- package/dist/src/server/lib/openapi-axios/utils/querySerializer.d.ts +3 -0
- package/dist/src/server/lib/openapi-axios/utils/response-converters/convertToAll.d.ts +5 -0
- package/dist/src/server/lib/openapi-axios/utils/response-converters/convertToAxios.d.ts +5 -0
- package/dist/src/server/lib/openapi-axios/utils/response-converters/convertToFetch.d.ts +5 -0
- package/dist/src/server/lib/utils.d.ts +253 -0
- package/dist/src/server/schemas/index.d.ts +31 -0
- package/dist/src/server/types/index.d.ts +70 -0
- package/dist/src/server/types/picture-data.d.ts +14 -0
- package/dist/src/server/ui/container.d.ts +5 -0
- package/dist/src/server/ui/image.d.ts +25 -0
- package/dist/src/server/ui/index.d.ts +3 -0
- package/dist/src/server/ui/video.d.ts +2 -0
- package/package.json +31 -28
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { IPaginate, IPreparedServerImageWithAlt, PaginationResult } from '../types';
|
|
2
|
+
import { PictureData } from '../types/picture-data';
|
|
3
|
+
/**
|
|
4
|
+
* @description Хелпер для генерации путей к адаптивным статичным изображениям (PictureData)
|
|
5
|
+
* @param basePath - Базовый путь к директории (например, '/compressed/cta')
|
|
6
|
+
* @param filename - Имя файла без расширения (например, 'cta-arrow')
|
|
7
|
+
* @param ext - Расширение исходного fallback-файла (по умолчанию 'jpg')
|
|
8
|
+
* @return Объект PictureData со всеми нужными форматами
|
|
9
|
+
*/
|
|
10
|
+
export declare const getImageData: (basePath: string, filename: string, ext: "jpg" | "png" | "jpeg") => PictureData;
|
|
11
|
+
/**
|
|
12
|
+
* @description Получить Intl для нужного языка
|
|
13
|
+
* @param locale - Локаль
|
|
14
|
+
* @param options - Опции
|
|
15
|
+
*/
|
|
16
|
+
export declare const getNumberFormatter: (locale: string, options?: Intl.NumberFormatOptions) => Intl.NumberFormat;
|
|
17
|
+
/**
|
|
18
|
+
* @description Получить Intl даты для нужного языка
|
|
19
|
+
* @param locale - Локаль
|
|
20
|
+
* @param options - Опции
|
|
21
|
+
*/
|
|
22
|
+
export declare const getDateFormatter: (locale: string, options?: Intl.DateTimeFormatOptions) => Intl.DateTimeFormat;
|
|
23
|
+
/**
|
|
24
|
+
* @description Получить значение по ключу
|
|
25
|
+
* @param obj - Объект
|
|
26
|
+
* @param key - Ключ
|
|
27
|
+
*/
|
|
28
|
+
export declare const getByKey: <T extends object, K extends keyof T>(obj: T, key: K | string) => T[K] | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* @description Преобразует value у инпута в поле маски телефона
|
|
31
|
+
* @param eventValue - исходное значение инпута
|
|
32
|
+
* @response Возвращает либо обработанную строку, либо пустую строку
|
|
33
|
+
* @example
|
|
34
|
+
* 79881234567 -> +79881234567
|
|
35
|
+
* 89881234567 -> +79881234567
|
|
36
|
+
* 19881234567 -> +19881234567
|
|
37
|
+
* 8 (988) 505-42-19 -> +79885054219
|
|
38
|
+
*/
|
|
39
|
+
export declare const convertPhoneMask: (eventValue: string) => string;
|
|
40
|
+
/**
|
|
41
|
+
* @description Получить корректный поддомен из адреса хоста
|
|
42
|
+
* @param host - url хоста
|
|
43
|
+
* @param SUB_DOMAIN - Объект ключ-значение со списком поддоменов
|
|
44
|
+
*/
|
|
45
|
+
export declare const getSubdomain: (host: string, SUB_DOMAIN: Record<string, string>) => string;
|
|
46
|
+
/**
|
|
47
|
+
* @description Заменяет текст по маске {{}}
|
|
48
|
+
* @param text - Исходный текст
|
|
49
|
+
* @param subdomain - Значение города, которое подставится
|
|
50
|
+
* @param SUBDOMAIN_NAME - Объект ключ-значение со списком поддоменов
|
|
51
|
+
* @param SUBDOMAIN_MASK - Объект ключ-значение со списком масок поддоменов
|
|
52
|
+
* @return Обновленная строка
|
|
53
|
+
*/
|
|
54
|
+
export declare const updateTextByTemplate: ({ text, subdomain, SUBDOMAIN_NAME, SUBDOMAIN_MASK, }: {
|
|
55
|
+
text: string;
|
|
56
|
+
subdomain?: string;
|
|
57
|
+
SUBDOMAIN_NAME?: Record<string, {
|
|
58
|
+
name: string;
|
|
59
|
+
declination: string;
|
|
60
|
+
region: string;
|
|
61
|
+
regionDeclination: string;
|
|
62
|
+
}>;
|
|
63
|
+
SUBDOMAIN_MASK?: {
|
|
64
|
+
CITY: string;
|
|
65
|
+
CITY_DECL: string;
|
|
66
|
+
CITY_REGION: string;
|
|
67
|
+
CITY_REGION_DECL: string;
|
|
68
|
+
};
|
|
69
|
+
}) => string;
|
|
70
|
+
/**
|
|
71
|
+
* @description Заменят мета текст по маске, переданный напрямую
|
|
72
|
+
* @param subdomain - Поддомен
|
|
73
|
+
* @param metaData - Объект с title, descrption, keywords
|
|
74
|
+
* @param host - Хост сайта
|
|
75
|
+
* @param lang - Объект для локализации
|
|
76
|
+
* @param isSubdomain - Нужны ли поддомены в адресе хоста
|
|
77
|
+
* @param SUBDOMAIN_NAME - Объект ключ-значение со списком поддоменов
|
|
78
|
+
* @param SUBDOMAIN_MASK - Объект ключ-значение со списком масок поддоменов
|
|
79
|
+
* @param DEFAULT_SEO_TEXT - Объект ключ-значение со списком масок поддоменов
|
|
80
|
+
* @return Объект с мета тегами
|
|
81
|
+
*/
|
|
82
|
+
export declare const prepareLocalMetaData: <T extends object>({ subdomain, metaData, host, lang, isSubdomain, SUBDOMAIN_NAME, SUBDOMAIN_MASK, DEFAULT_SEO_TEXT, }: {
|
|
83
|
+
subdomain?: string;
|
|
84
|
+
metaData: {
|
|
85
|
+
title: string;
|
|
86
|
+
description: string;
|
|
87
|
+
keywords: string;
|
|
88
|
+
canonical?: string;
|
|
89
|
+
};
|
|
90
|
+
host: string;
|
|
91
|
+
lang?: {
|
|
92
|
+
locale: string;
|
|
93
|
+
locales: string[];
|
|
94
|
+
defaultLocale: string;
|
|
95
|
+
route: string;
|
|
96
|
+
city?: string;
|
|
97
|
+
};
|
|
98
|
+
isSubdomain?: boolean;
|
|
99
|
+
SUBDOMAIN_NAME?: Record<string, {
|
|
100
|
+
name: string;
|
|
101
|
+
declination: string;
|
|
102
|
+
region: string;
|
|
103
|
+
regionDeclination: string;
|
|
104
|
+
}>;
|
|
105
|
+
SUBDOMAIN_MASK?: {
|
|
106
|
+
CITY: string;
|
|
107
|
+
CITY_DECL: string;
|
|
108
|
+
CITY_REGION: string;
|
|
109
|
+
CITY_REGION_DECL: string;
|
|
110
|
+
};
|
|
111
|
+
DEFAULT_SEO_TEXT: {
|
|
112
|
+
title: string;
|
|
113
|
+
description: string;
|
|
114
|
+
keywords: string;
|
|
115
|
+
};
|
|
116
|
+
}) => T;
|
|
117
|
+
/**
|
|
118
|
+
* @description Превращает строку формата /catalog/price-from__1000--price-to__5000 в { price-from: '1000', price-to: '5000' }
|
|
119
|
+
* @param input - изначальная строка
|
|
120
|
+
* @return Объект с парами ключ-значение
|
|
121
|
+
*/
|
|
122
|
+
export declare const parseStringToKeyValue: <T extends object>(input: string) => T;
|
|
123
|
+
/**
|
|
124
|
+
* @description Конвентирует цвет из enum в строку
|
|
125
|
+
* @param color1 - цвет 1
|
|
126
|
+
* @param color2 - цвет 2
|
|
127
|
+
* @param notFoundText - текст при отсутствии цвета
|
|
128
|
+
* @param COLORS_NAMES - Объект ключ-значение со списком названий цветов
|
|
129
|
+
* @return Строка с названием цветов
|
|
130
|
+
*/
|
|
131
|
+
export declare const prepareColor: ({ color1, color2, notFoundText, COLORS_NAMES, }: {
|
|
132
|
+
color1: string;
|
|
133
|
+
color2?: string | null;
|
|
134
|
+
notFoundText: string;
|
|
135
|
+
COLORS_NAMES: Record<string, string>;
|
|
136
|
+
}) => string;
|
|
137
|
+
/**
|
|
138
|
+
* @description Подготавливает серверную пагинацию для клиента
|
|
139
|
+
* @param pagination - Серверная пагинация
|
|
140
|
+
* @param baseUrl - Url страницы
|
|
141
|
+
* @param initialParams - Параметры url
|
|
142
|
+
*/
|
|
143
|
+
export declare const generatePaginationArray: (pagination: IPaginate | null, baseUrl: string, initialParams: Record<string, string>) => PaginationResult;
|
|
144
|
+
/**
|
|
145
|
+
* @description Превращение массива в объект ключ-значение
|
|
146
|
+
* @param arr - Массив
|
|
147
|
+
*/
|
|
148
|
+
export declare const arrayToKeyValueObject: <T extends string>(arr: T[]) => Record<T, T>;
|
|
149
|
+
/**
|
|
150
|
+
* @description Подготовка номера страницы, полученной из query параметров
|
|
151
|
+
* @param page - Номер страницы
|
|
152
|
+
*/
|
|
153
|
+
export declare const preparePageParam: (page: string | number | undefined) => number;
|
|
154
|
+
/**
|
|
155
|
+
* @description Проверка html на пустоту
|
|
156
|
+
* @param html - Html разметка редактора
|
|
157
|
+
*/
|
|
158
|
+
export declare const isNotEmptyHtml: (html: string | null | undefined) => boolean;
|
|
159
|
+
/**
|
|
160
|
+
* @description Подстановка города в путь ссылки
|
|
161
|
+
* @param city - Город
|
|
162
|
+
* @param href - Ссылка
|
|
163
|
+
*/
|
|
164
|
+
export declare const createCityLink: (city: string, href: string) => string;
|
|
165
|
+
/**
|
|
166
|
+
* @description Получить текстовое поле по локали
|
|
167
|
+
* @param locale - Локаль. Пример ru
|
|
168
|
+
* @param field - Пример text1
|
|
169
|
+
* @param data - Объект с полями. К примеру text1RU и text1EN
|
|
170
|
+
* @result - Текст поля
|
|
171
|
+
*/
|
|
172
|
+
export declare const getLocaleField: ({ locale, field, data, }: {
|
|
173
|
+
locale: string;
|
|
174
|
+
field: string;
|
|
175
|
+
data?: object | null;
|
|
176
|
+
}) => string;
|
|
177
|
+
/**
|
|
178
|
+
* @description Проверка user agent на бота
|
|
179
|
+
* @param userAgent - user agent
|
|
180
|
+
* @result - boolean
|
|
181
|
+
*/
|
|
182
|
+
export declare const isBotUserAgent: (userAgent: string) => boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Генерирует приятный цвет для заглушек фотографий карточек
|
|
185
|
+
* @param seed - Необязательное число или строка для предсказуемой генерации цвета
|
|
186
|
+
* @returns Цвет в формате HEX (#RRGGBB)
|
|
187
|
+
*/
|
|
188
|
+
export declare const generatePlaceholderColor: (seed?: number | string) => string;
|
|
189
|
+
/**
|
|
190
|
+
* Конвертирует цвет из формата HSL в HEX
|
|
191
|
+
* @param h - Оттенок (0-360)
|
|
192
|
+
* @param s - Насыщенность (0-100)
|
|
193
|
+
* @param l - Яркость (0-100)
|
|
194
|
+
* @returns Цвет в формате HEX (#RRGGBB)
|
|
195
|
+
*/
|
|
196
|
+
export declare const hslToHex: (h: number, s: number, l: number) => string;
|
|
197
|
+
/**
|
|
198
|
+
* Преобразует UUID в короткий ID
|
|
199
|
+
* @param {string} uuid - UUID v4 строка (с дефисами или без)
|
|
200
|
+
* @param {number} length - нужная длина (по умолчанию 18)
|
|
201
|
+
* @returns {string} короткий ID без дефисов
|
|
202
|
+
*/
|
|
203
|
+
export declare const uuidToStringId: (uuid: string, length?: number) => string;
|
|
204
|
+
/**
|
|
205
|
+
* Преобразует UUID в числовой ID
|
|
206
|
+
* @param {string} uuid - UUID v4 строка (с дефисами или без)
|
|
207
|
+
* @param {number} maxDigits - максимальное количество цифр в результате (по умолчанию 18)
|
|
208
|
+
* @returns {string} числовой ID в виде строки
|
|
209
|
+
*/
|
|
210
|
+
export declare const uuidToNumericId: (uuid: string, maxDigits?: number) => string;
|
|
211
|
+
/**
|
|
212
|
+
* @description Экранирует XML-специальные символы в строке.
|
|
213
|
+
* @param str - Строка
|
|
214
|
+
*/
|
|
215
|
+
export declare const escapeXml: (str: string) => string;
|
|
216
|
+
/**
|
|
217
|
+
* @description Генерирует XML-фид для яндекс товаров.
|
|
218
|
+
* @param shopName - Название магазина
|
|
219
|
+
* @param shopCompany - Компания
|
|
220
|
+
* @param delivery - Доставка
|
|
221
|
+
* @param categoriesData - Категории
|
|
222
|
+
* @param offersData - Товары
|
|
223
|
+
* @param host - Хост
|
|
224
|
+
* @response Готовый xml фид товаров
|
|
225
|
+
*/
|
|
226
|
+
export declare const generateYandexFeedXML: ({ shopName, shopCompany, delivery, categoriesData, offersData, host, }: {
|
|
227
|
+
shopName: string;
|
|
228
|
+
shopCompany: string;
|
|
229
|
+
host: string;
|
|
230
|
+
delivery: boolean;
|
|
231
|
+
categoriesData: {
|
|
232
|
+
id: string | number;
|
|
233
|
+
name: string;
|
|
234
|
+
parentId?: string | number;
|
|
235
|
+
}[];
|
|
236
|
+
offersData: {
|
|
237
|
+
id: string | number;
|
|
238
|
+
categoryId: string | number;
|
|
239
|
+
name: string;
|
|
240
|
+
vendor: string;
|
|
241
|
+
vendorCode?: string | null;
|
|
242
|
+
description: string;
|
|
243
|
+
href: string;
|
|
244
|
+
images: IPreparedServerImageWithAlt[];
|
|
245
|
+
price: number;
|
|
246
|
+
pickup: boolean;
|
|
247
|
+
isPopular?: boolean;
|
|
248
|
+
params?: {
|
|
249
|
+
name: string;
|
|
250
|
+
value: string;
|
|
251
|
+
}[];
|
|
252
|
+
}[];
|
|
253
|
+
}) => string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const responseSchema: z.ZodObject<{
|
|
3
|
+
statusCode: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
5
|
+
messages: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
6
|
+
data: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
7
|
+
error: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
8
|
+
statusCode: z.ZodNumber;
|
|
9
|
+
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
messages: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
11
|
+
}, z.core.$strip>>>;
|
|
12
|
+
response: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const serverImageSchema: z.ZodObject<{
|
|
15
|
+
altRU: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
16
|
+
altEN: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
17
|
+
altAR: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
originalFileExtension: z.ZodString;
|
|
20
|
+
fileExtensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
prefixes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const serverFileSchema: z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
fullName: z.ZodString;
|
|
27
|
+
extension: z.ZodString;
|
|
28
|
+
entityId: z.ZodString;
|
|
29
|
+
fullPathExample: z.ZodString;
|
|
30
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export interface IServerImage {
|
|
2
|
+
altRU?: string;
|
|
3
|
+
altEN?: string;
|
|
4
|
+
altAR?: string;
|
|
5
|
+
name: string;
|
|
6
|
+
originalFileExtension: string;
|
|
7
|
+
entityId: string;
|
|
8
|
+
fullPathExample: string;
|
|
9
|
+
folder?: string;
|
|
10
|
+
prefixes?: string[];
|
|
11
|
+
fileExtensions?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface IServerFile {
|
|
14
|
+
name: string;
|
|
15
|
+
fullName: string;
|
|
16
|
+
extension: string;
|
|
17
|
+
entityId: string;
|
|
18
|
+
fullPathExample: string;
|
|
19
|
+
folder?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IPreparedServerImage {
|
|
22
|
+
image1x: string;
|
|
23
|
+
image2x: string;
|
|
24
|
+
image1xWebp: string;
|
|
25
|
+
image2xWebp: string;
|
|
26
|
+
image1xAvif: string;
|
|
27
|
+
image2xAvif: string;
|
|
28
|
+
mobileImage1x?: string;
|
|
29
|
+
mobileImage2x?: string;
|
|
30
|
+
mobileImage1xWebp?: string;
|
|
31
|
+
mobileImage2xWebp?: string;
|
|
32
|
+
mobileImage1xAvif?: string;
|
|
33
|
+
mobileImage2xAvif?: string;
|
|
34
|
+
altRU?: string;
|
|
35
|
+
altEN?: string;
|
|
36
|
+
altAR?: string;
|
|
37
|
+
type: ImageType;
|
|
38
|
+
}
|
|
39
|
+
export interface IPreparedServerImageWithAlt extends IPreparedServerImage {
|
|
40
|
+
alt?: string;
|
|
41
|
+
}
|
|
42
|
+
export type ImageType = 'image/png' | 'image/jpeg';
|
|
43
|
+
export interface IPaginate {
|
|
44
|
+
page: number;
|
|
45
|
+
pages: number;
|
|
46
|
+
previous?: number;
|
|
47
|
+
next?: number;
|
|
48
|
+
count: number;
|
|
49
|
+
limit: number;
|
|
50
|
+
}
|
|
51
|
+
export interface PaginationButton {
|
|
52
|
+
label: string;
|
|
53
|
+
href: string;
|
|
54
|
+
isActive: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface PaginationResult {
|
|
57
|
+
buttons: PaginationButton[];
|
|
58
|
+
firstPage?: PaginationButton;
|
|
59
|
+
lastPage?: PaginationButton;
|
|
60
|
+
}
|
|
61
|
+
export type GetErrorType = ({ error, message }: {
|
|
62
|
+
error?: unknown;
|
|
63
|
+
message?: string;
|
|
64
|
+
}) => void;
|
|
65
|
+
export type CityNamesType = Record<string, {
|
|
66
|
+
name: string;
|
|
67
|
+
declination: string;
|
|
68
|
+
region: string;
|
|
69
|
+
regionDeclination: string;
|
|
70
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface PictureData {
|
|
2
|
+
image1x: string;
|
|
3
|
+
image2x: string;
|
|
4
|
+
image1xWebp: string;
|
|
5
|
+
image2xWebp: string;
|
|
6
|
+
image1xAvif: string;
|
|
7
|
+
image2xAvif: string;
|
|
8
|
+
mobileImage1x: string;
|
|
9
|
+
mobileImage2x: string;
|
|
10
|
+
mobileImage1xWebp: string;
|
|
11
|
+
mobileImage2xWebp: string;
|
|
12
|
+
mobileImage1xAvif: string;
|
|
13
|
+
mobileImage2xAvif: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DetailedHTMLProps, FC, HTMLAttributes, ImgHTMLAttributes } from '../../../node_modules/react';
|
|
2
|
+
import { ImageType } from '../types';
|
|
3
|
+
export interface BasePictureProps extends DetailedHTMLProps<HTMLAttributes<HTMLPictureElement>, HTMLPictureElement> {
|
|
4
|
+
imgProps?: DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
|
|
5
|
+
data: PictureData | undefined;
|
|
6
|
+
type: ImageType | undefined;
|
|
7
|
+
alt: string;
|
|
8
|
+
mobileMaxWidth?: number;
|
|
9
|
+
loading?: 'eager' | 'lazy';
|
|
10
|
+
}
|
|
11
|
+
export interface PictureData {
|
|
12
|
+
image1x: string | undefined;
|
|
13
|
+
image2x?: string;
|
|
14
|
+
image1xWebp?: string;
|
|
15
|
+
image2xWebp?: string;
|
|
16
|
+
image1xAvif?: string;
|
|
17
|
+
image2xAvif?: string;
|
|
18
|
+
mobileImage1x?: string;
|
|
19
|
+
mobileImage2x?: string;
|
|
20
|
+
mobileImage1xWebp?: string;
|
|
21
|
+
mobileImage2xWebp?: string;
|
|
22
|
+
mobileImage1xAvif?: string;
|
|
23
|
+
mobileImage2xAvif?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const BasePicture: FC<BasePictureProps>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "denwa-web-shared",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.61",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Denwa",
|
|
7
7
|
"main": "dist/denwa-web-shared.cjs.js",
|
|
@@ -51,39 +51,42 @@
|
|
|
51
51
|
"react-dom": ">=17.0.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
+
"axios": "^1.16.1",
|
|
54
55
|
"clsx": "^2.1.1",
|
|
55
|
-
"motion": "^12.
|
|
56
|
+
"motion": "^12.40.0",
|
|
57
|
+
"openapi-typescript-helpers": "^0.1.0",
|
|
58
|
+
"query-string": "^9.4.0",
|
|
56
59
|
"react-use": "^17.6.0",
|
|
57
|
-
"tailwind-merge": "^3.
|
|
58
|
-
"zod": "^4.
|
|
60
|
+
"tailwind-merge": "^3.6.0",
|
|
61
|
+
"zod": "^4.4.3"
|
|
59
62
|
},
|
|
60
63
|
"devDependencies": {
|
|
61
|
-
"@eslint/eslintrc": "^3.3.
|
|
62
|
-
"@eslint/js": "^
|
|
63
|
-
"@tanstack/intent": "^0.0.
|
|
64
|
-
"@types/react": "^19.
|
|
65
|
-
"@types/react-dom": "^19.
|
|
66
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
67
|
-
"autoprefixer": "^10.
|
|
68
|
-
"eslint": "^
|
|
69
|
-
"eslint-config-prettier": "^10.1.
|
|
70
|
-
"eslint-plugin-prettier": "^5.
|
|
71
|
-
"eslint-plugin-react-hooks": "^
|
|
72
|
-
"eslint-plugin-react-refresh": "^0.
|
|
73
|
-
"globals": "^
|
|
74
|
-
"postcss": "^8.5.
|
|
64
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
65
|
+
"@eslint/js": "^10.0.1",
|
|
66
|
+
"@tanstack/intent": "^0.0.41",
|
|
67
|
+
"@types/react": "^19.2.15",
|
|
68
|
+
"@types/react-dom": "^19.2.3",
|
|
69
|
+
"@vitejs/plugin-react-swc": "^4.3.1",
|
|
70
|
+
"autoprefixer": "^10.5.0",
|
|
71
|
+
"eslint": "^10.4.1",
|
|
72
|
+
"eslint-config-prettier": "^10.1.8",
|
|
73
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
74
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
75
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
76
|
+
"globals": "^17.6.0",
|
|
77
|
+
"postcss": "^8.5.15",
|
|
75
78
|
"postcss-cli": "^11.0.1",
|
|
76
|
-
"postcss-custom-media": "^
|
|
77
|
-
"postcss-import": "^16.1.
|
|
78
|
-
"postcss-nesting": "^
|
|
79
|
-
"prettier": "^3.
|
|
80
|
-
"react": "^19.
|
|
81
|
-
"react-dom": "^19.
|
|
79
|
+
"postcss-custom-media": "^12.0.1",
|
|
80
|
+
"postcss-import": "^16.1.1",
|
|
81
|
+
"postcss-nesting": "^14.0.0",
|
|
82
|
+
"prettier": "^3.8.3",
|
|
83
|
+
"react": "^19.2.6",
|
|
84
|
+
"react-dom": "^19.2.6",
|
|
82
85
|
"standard-version": "^9.5.0",
|
|
83
|
-
"typescript": "~
|
|
84
|
-
"typescript-eslint": "^8.
|
|
85
|
-
"vite": "^
|
|
86
|
-
"vite-plugin-dts": "^
|
|
86
|
+
"typescript": "~6.0.3",
|
|
87
|
+
"typescript-eslint": "^8.60.0",
|
|
88
|
+
"vite": "^8.0.14",
|
|
89
|
+
"vite-plugin-dts": "^5.0.1"
|
|
87
90
|
},
|
|
88
91
|
"keywords": [
|
|
89
92
|
"tanstack-intent"
|
|
File without changes
|