@redneckz/wildless-cms-uni-blocks 0.2.54 → 0.2.55
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/ContentPageContext.d.ts +2 -0
- package/dist/Header/Header.js +2 -2
- package/dist/Header/Header.js.map +1 -1
- package/dist/Header/HeaderContent.d.ts +1 -1
- package/dist/Header/HeaderSecondaryMenu.d.ts +5 -2
- package/dist/Header/HeaderSecondaryMenu.js +3 -2
- package/dist/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/api/DaDataAPI.d.ts +3 -0
- package/dist/api/DaDataAPI.js +33 -0
- package/dist/api/DaDataAPI.js.map +1 -0
- package/dist/api/LikeAPI.d.ts +1 -1
- package/dist/api/LikeAPI.js +2 -2
- package/dist/api/LikeAPI.js.map +1 -1
- package/dist/content-page-repository/ContentPageRepository.d.ts +1 -0
- package/dist/content-page-repository/ContentPageRepository.js +6 -0
- package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/dist/content-page-repository/toMobilePage.d.ts +2 -0
- package/dist/content-page-repository/toMobilePage.js +23 -0
- package/dist/content-page-repository/toMobilePage.js.map +1 -0
- package/dist/types.d.ts +14 -0
- package/dist/utils/getCurrentPosition.d.ts +1 -0
- package/dist/utils/getCurrentPosition.js +5 -0
- package/dist/utils/getCurrentPosition.js.map +1 -0
- package/lib/ContentPageContext.d.ts +2 -0
- package/lib/Header/Header.js +2 -2
- package/lib/Header/Header.js.map +1 -1
- package/lib/Header/HeaderContent.d.ts +1 -1
- package/lib/Header/HeaderSecondaryMenu.d.ts +5 -2
- package/lib/Header/HeaderSecondaryMenu.js +3 -2
- package/lib/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/api/DaDataAPI.d.ts +3 -0
- package/lib/api/DaDataAPI.js +30 -0
- package/lib/api/DaDataAPI.js.map +1 -0
- package/lib/api/LikeAPI.d.ts +1 -1
- package/lib/api/LikeAPI.js +2 -2
- package/lib/api/LikeAPI.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/content-page-repository/ContentPageRepository.d.ts +1 -0
- package/lib/content-page-repository/ContentPageRepository.js +6 -0
- package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/lib/content-page-repository/toMobilePage.d.ts +2 -0
- package/lib/content-page-repository/toMobilePage.js +20 -0
- package/lib/content-page-repository/toMobilePage.js.map +1 -0
- package/lib/types.d.ts +14 -0
- package/lib/utils/getCurrentPosition.d.ts +1 -0
- package/lib/utils/getCurrentPosition.js +2 -0
- package/lib/utils/getCurrentPosition.js.map +1 -0
- package/package.json +7 -4
- package/src/ContentPageContext.tsx +3 -0
- package/src/Header/Header.fixture.tsx +1 -1
- package/src/Header/Header.tsx +6 -2
- package/src/Header/HeaderContent.ts +1 -1
- package/src/Header/HeaderSecondaryMenu.tsx +48 -34
- package/src/api/DaDataAPI.ts +34 -0
- package/src/api/LikeAPI.ts +12 -9
- package/src/content-page-repository/ContentPageRepository.ts +7 -0
- package/src/content-page-repository/toMobilePage.ts +21 -0
- package/src/setup-fixture.ts +15 -0
- package/src/types.ts +17 -0
- package/src/utils/getCurrentPosition.ts +4 -0
|
@@ -19,10 +19,12 @@ export declare type AsyncDataHook = <Data, Error = any>(key: string, fetcher: ()
|
|
|
19
19
|
data?: Data;
|
|
20
20
|
error?: Error;
|
|
21
21
|
};
|
|
22
|
+
export declare type GeolocationHook = (defaultLocation: string) => [string, () => void];
|
|
22
23
|
export interface ContentPageContext {
|
|
23
24
|
useRouter: () => Router;
|
|
24
25
|
useState: <State>(initialState: State) => [State, (_: State) => void];
|
|
25
26
|
useAsyncData: AsyncDataHook;
|
|
27
|
+
useGeolocation: GeolocationHook;
|
|
26
28
|
useLikeService: () => LikeService;
|
|
27
29
|
useSearch: () => Search;
|
|
28
30
|
handlerDecorator?: HandlerDecorator;
|
package/dist/Header/Header.js
CHANGED
|
@@ -11,7 +11,7 @@ const useSitemap_1 = require("../useSitemap");
|
|
|
11
11
|
const HeaderSecondaryMenu_1 = require("./HeaderSecondaryMenu");
|
|
12
12
|
const isSubItemActive_1 = require("./isSubItemActive");
|
|
13
13
|
const isTopItemActive_1 = require("./isTopItemActive");
|
|
14
|
-
exports.Header = (0, uni_jsx_1.JSX)(({ className,
|
|
14
|
+
exports.Header = (0, uni_jsx_1.JSX)(({ className, defaultLocation, context, topItems }) => {
|
|
15
15
|
const router = context.useRouter();
|
|
16
16
|
const sitemap = (0, useSitemap_1.useSitemap)(context.useAsyncData);
|
|
17
17
|
const { handlerDecorator } = context;
|
|
@@ -21,6 +21,6 @@ exports.Header = (0, uni_jsx_1.JSX)(({ className, location, context, topItems })
|
|
|
21
21
|
const activeSubItem = subItems?.find((0, isSubItemActive_1.isSubItemActive)(router));
|
|
22
22
|
const topMenu = mergedItems.map((_, i) => ((0, jsx_runtime_1.jsx)(TopItem_1.TopItem, { active: _ === activeTopItem, ...(0, useLink_1.useLink)({ router, handlerDecorator }, _), ariaLabel: _.text }, String(i))));
|
|
23
23
|
const subMenu = subItems?.map((_) => ((0, jsx_runtime_1.jsx)(HeaderItem_1.HeaderItem, { className: "mr-8", active: _ === activeSubItem, ...(0, useLink_1.useLink)({ router, handlerDecorator }, _) }, _.href)));
|
|
24
|
-
return ((0, jsx_runtime_1.jsxs)("header", { className: `pt-5 pb-8 px-20 bg-white ${className || ''}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center", children: [(0, jsx_runtime_1.jsx)(Logo_1.Logo, { className: "mr-8" }), topMenu, (0, jsx_runtime_1.jsx)(HeaderSecondaryMenu_1.HeaderSecondaryMenu, {
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)("header", { className: `pt-5 pb-8 px-20 bg-white ${className || ''}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center", children: [(0, jsx_runtime_1.jsx)(Logo_1.Logo, { className: "mr-8" }), topMenu, (0, jsx_runtime_1.jsx)(HeaderSecondaryMenu_1.HeaderSecondaryMenu, { context: context, className: "ml-auto", defaultLocation: defaultLocation })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-5 h-[1px] bg-main-divider" }), (0, jsx_runtime_1.jsx)("nav", { className: "mt-5", children: subMenu })] }));
|
|
25
25
|
});
|
|
26
26
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/Header/Header.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,oDAAiD;AAEjD,qDAAkD;AAClD,yCAAsC;AACtC,+CAA4C;AAC5C,wCAAqC;AACrC,8CAA2C;AAE3C,+DAA4D;AAC5D,uDAAoD;AACpD,uDAAoD;AAIvC,QAAA,MAAM,GAAG,IAAA,aAAG,EAAc,CAAC,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/Header/Header.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,oDAAiD;AAEjD,qDAAkD;AAClD,yCAAsC;AACtC,+CAA4C;AAC5C,wCAAqC;AACrC,8CAA2C;AAE3C,+DAA4D;AAC5D,uDAAoD;AACpD,uDAAoD;AAIvC,QAAA,MAAM,GAAG,IAAA,aAAG,EAAc,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3F,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,IAAA,uBAAU,EAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACjD,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;IAErC,MAAM,WAAW,GAAG,IAAA,6BAAa,EAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9D,MAAM,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,IAAA,iCAAe,EAAC,MAAM,CAAC,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,aAAa,EAAE,KAAK,CA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: string;
|
|
3
4
|
className?: string;
|
|
4
5
|
}
|
|
6
|
+
export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent, UniBlockProps {
|
|
7
|
+
}
|
|
5
8
|
export declare const HeaderSecondaryMenu: (props: import("@redneckz/uni-jsx").PropsWithChildren<HeaderSecondaryMenuProps, any>, context?: any) => any;
|
|
6
9
|
export {};
|
|
@@ -5,7 +5,8 @@ const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
|
5
5
|
const index_1 = require("../Icons/index");
|
|
6
6
|
const TopItem_1 = require("../ui-kit/TopItem");
|
|
7
7
|
const HeaderSecondaryMenuButton_1 = require("./HeaderSecondaryMenuButton");
|
|
8
|
-
exports.HeaderSecondaryMenu = (0, uni_jsx_1.JSX)(({
|
|
9
|
-
|
|
8
|
+
exports.HeaderSecondaryMenu = (0, uni_jsx_1.JSX)(({ context, className, defaultLocation = '' }) => {
|
|
9
|
+
const [city, getCity] = context.useGeolocation(defaultLocation);
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `flex items-center ${className || ''}`, children: [(0, jsx_runtime_1.jsx)(TopItem_1.TopItem, { className: "mr-5", flat: true, href: "#", text: city, ariaLabel: "\u041C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", onClick: getCity }), (0, jsx_runtime_1.jsx)(TopItem_1.TopItem, { className: "mr-7", flat: true, href: "#", text: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B", ariaLabel: "\u0421\u043F\u0438\u0441\u043E\u043A \u0432\u0441\u0435\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043E\u0444\u0438\u0441\u043E\u0432 \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u043E\u0432" }), (0, jsx_runtime_1.jsx)(HeaderSecondaryMenuButton_1.HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443", children: (0, index_1.LoupeIcon)({ 'aria-hidden': true }) }), (0, jsx_runtime_1.jsx)(HeaderSecondaryMenuButton_1.HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u0440\u043E\u0444\u0438\u043B\u044C", children: (0, index_1.ProfileIcon)({ 'aria-hidden': true }) }), (0, jsx_runtime_1.jsx)(HeaderSecondaryMenuButton_1.HeaderSecondaryMenuButton, { className: "mr-5 text-secondary-light hover:text-secondary-active min-w-[32px] min-h-[32px]", ariaLabel: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0441\u044B\u043B\u043A\u0438", children: (0, index_1.GridIcon)({ 'aria-hidden': true }) })] }));
|
|
10
11
|
});
|
|
11
12
|
//# sourceMappingURL=HeaderSecondaryMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderSecondaryMenu.js","sourceRoot":"","sources":["../../src/Header/HeaderSecondaryMenu.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,0CAAkE;AAClE,+CAA4C;AAC5C,2EAAwE;
|
|
1
|
+
{"version":3,"file":"HeaderSecondaryMenu.js","sourceRoot":"","sources":["../../src/Header/HeaderSecondaryMenu.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,0CAAkE;AAClE,+CAA4C;AAC5C,2EAAwE;AAU3D,QAAA,mBAAmB,GAAG,IAAA,aAAG,EACpC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,GAAG,EAAE,EAAE,EAAE,EAAE;IAC/C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAEhE,OAAO,CACL,iCAAK,SAAS,EAAE,qBAAqB,SAAS,IAAI,EAAE,EAAE,aACpD,uBAAC,iBAAO,IACN,SAAS,EAAC,MAAM,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,GAAG,EACR,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,sFAAgB,EAC1B,OAAO,EAAE,OAAO,GAChB,EACF,uBAAC,iBAAO,IACN,SAAS,EAAC,MAAM,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,GAAG,EACR,IAAI,EAAC,8FAAmB,EACxB,SAAS,EAAC,+NAA2C,GACrD,EACF,uBAAC,qDAAyB,IACxB,SAAS,EAAC,gDAAgD,EAC1D,SAAS,EAAC,4EAAgB,YAEzB,IAAA,iBAAS,EAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,GACT,EAC5B,uBAAC,qDAAyB,IACxB,SAAS,EAAC,gDAAgD,EAC1D,SAAS,EAAC,4CAAS,YAElB,IAAA,mBAAW,EAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,GACX,EAC5B,uBAAC,qDAAyB,IACxB,SAAS,EAAC,iFAAiF,EAC3F,SAAS,EAAC,2HAAuB,YAEhC,IAAA,gBAAQ,EAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,GACR,IACxB,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.DaDataAPI = void 0;
|
|
3
|
+
const getCurrentPosition_1 = require("../utils/getCurrentPosition");
|
|
4
|
+
function DaDataAPI(baseURL = '') {
|
|
5
|
+
async function getFetcherAddress() {
|
|
6
|
+
if (!('geolocation' in navigator)) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
const coords = await (0, getCurrentPosition_1.getCurrentPosition)();
|
|
11
|
+
const response = await fetch(`${baseURL}/geolocate`, {
|
|
12
|
+
method: 'POST',
|
|
13
|
+
mode: 'cors',
|
|
14
|
+
body: JSON.stringify({
|
|
15
|
+
lat: coords.latitude,
|
|
16
|
+
lon: coords.longitude,
|
|
17
|
+
count: 1,
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
const data = (await response.json());
|
|
21
|
+
return data?.suggestions?.[0]?.data?.city;
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
console.error(e);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
getFetcherAddress,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
exports.DaDataAPI = DaDataAPI;
|
|
33
|
+
//# sourceMappingURL=DaDataAPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DaDataAPI.js","sourceRoot":"","sources":["../../src/api/DaDataAPI.ts"],"names":[],"mappings":";;AAAA,oEAAiE;AAIjE,SAAgB,SAAS,CAAC,OAAO,GAAG,EAAE;IACpC,KAAK,UAAU,iBAAiB;QAC9B,IAAI,CAAC,CAAC,aAAa,IAAI,SAAS,CAAC,EAAE;YACjC,OAAO,IAAI,CAAC;SACb;QAED,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,IAAA,uCAAkB,GAAE,CAAC;YAC1C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,OAAO,YAAY,EAAE;gBACnD,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,GAAG,EAAE,MAAM,CAAC,QAAQ;oBACpB,GAAG,EAAE,MAAM,CAAC,SAAS;oBACrB,KAAK,EAAE,CAAC;iBACT,CAAC;aACH,CAAC,CAAC;YAEH,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAiB,CAAC;YACrD,OAAO,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;SAC3C;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED,OAAO;QACL,iBAAiB;KAClB,CAAC;AACJ,CAAC;AA7BD,8BA6BC"}
|
package/dist/api/LikeAPI.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export interface LikeData {
|
|
|
2
2
|
node_id: string;
|
|
3
3
|
value: number;
|
|
4
4
|
}
|
|
5
|
-
export declare function LikeAPI(projectId: string, baseURL
|
|
5
|
+
export declare function LikeAPI(projectId: string, baseURL?: string): {
|
|
6
6
|
getLikeCount: (...nodeIds: string[]) => Promise<LikeData[]>;
|
|
7
7
|
like: (nodeId: string) => Promise<number>;
|
|
8
8
|
dislike: (nodeId: string) => Promise<number>;
|
package/dist/api/LikeAPI.js
CHANGED
|
@@ -2,14 +2,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.LikeAPI = void 0;
|
|
3
3
|
const AUTH_PREFIX = 'guest';
|
|
4
4
|
const STORAGE_KEY = 'likesToken';
|
|
5
|
-
function LikeAPI(projectId, baseURL) {
|
|
5
|
+
function LikeAPI(projectId, baseURL = '') {
|
|
6
6
|
async function getLikeCount(...nodeIds) {
|
|
7
7
|
if (!nodeIds.length) {
|
|
8
8
|
return [];
|
|
9
9
|
}
|
|
10
10
|
const { token: Authorization } = await auth();
|
|
11
11
|
try {
|
|
12
|
-
const response = await fetch(
|
|
12
|
+
const response = await fetch(`${baseURL}/assist/v1/public/projects/${projectId}/nodes/likes`, {
|
|
13
13
|
method: 'POST',
|
|
14
14
|
mode: 'cors',
|
|
15
15
|
headers: { 'Content-Type': 'application/json', Authorization },
|
package/dist/api/LikeAPI.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LikeAPI.js","sourceRoot":"","sources":["../../src/api/LikeAPI.ts"],"names":[],"mappings":";;AASA,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5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C,CAAC,CAAC;YACjB,OAAO,CAAC,CAAC;SACV;IACH,CAAC;IAED,KAAK,UAAU,IAAI;QACjB,IAAI;YACF,MAAM,QAAQ,GAAa,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;YAC1F,IAAI,QAAQ,EAAE,KAAK,EAAE;gBACnB,OAAO,QAAQ,CAAC;aACjB;SACF;QAAC,OAAO,CAAC,EAAE;YACV,aAAa;SACd;QAED,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,OAAO,wBAAwB,EAAE;gBAC/D,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,MAAM,EAAE,WAAW;iBACpB,CAAC;aACH,CAAC,CAAC;YAEH,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YAE9C,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAE9E,OAAO,EAAE,KAAK,EAAE,IAAI,EAAc,CAAC;SACpC;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,OAAO,EAAc,CAAC;SACvB;IACH,CAAC;IAED,OAAO;QACL,YAAY;QACZ,IAAI;QACJ,OAAO;KACR,CAAC;AACJ,CAAC;AAnID,0BAmIC"}
|
|
@@ -3,4 +3,5 @@ import type { TransformationOptions } from './TransformationOptions';
|
|
|
3
3
|
export declare function ContentPageRepository({ contentDir, publicDir, }?: Partial<TransformationOptions>): {
|
|
4
4
|
getAllContentPages: () => Promise<ContentPageDef[]>;
|
|
5
5
|
getContentPageBySlug: (slug: string) => Promise<ContentPageDef | undefined>;
|
|
6
|
+
getMobilePageBySlug: (slug: string) => Promise<ContentPageDef | undefined>;
|
|
6
7
|
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.ContentPageRepository = void 0;
|
|
6
6
|
const glob_1 = __importDefault(require("glob"));
|
|
7
7
|
const util_1 = __importDefault(require("util"));
|
|
8
|
+
const toMobilePage_1 = require("./toMobilePage");
|
|
8
9
|
const transformContentPage_1 = require("./transformContentPage");
|
|
9
10
|
const find = util_1.default.promisify(glob_1.default);
|
|
10
11
|
function ContentPageRepository({ contentDir = 'content', publicDir = 'public', } = {}) {
|
|
@@ -16,6 +17,10 @@ function ContentPageRepository({ contentDir = 'content', publicDir = 'public', }
|
|
|
16
17
|
const pages = await getAllContentPages();
|
|
17
18
|
return pages.find((content) => content.slug === slug);
|
|
18
19
|
}
|
|
20
|
+
async function getMobilePageBySlug(slug) {
|
|
21
|
+
const page = await getContentPageBySlug(slug);
|
|
22
|
+
return page && (0, toMobilePage_1.toMobilePage)(page);
|
|
23
|
+
}
|
|
19
24
|
const cache = {};
|
|
20
25
|
async function readPage(filePath) {
|
|
21
26
|
if (!(filePath in cache)) {
|
|
@@ -29,6 +34,7 @@ function ContentPageRepository({ contentDir = 'content', publicDir = 'public', }
|
|
|
29
34
|
return {
|
|
30
35
|
getAllContentPages,
|
|
31
36
|
getContentPageBySlug,
|
|
37
|
+
getMobilePageBySlug,
|
|
32
38
|
};
|
|
33
39
|
}
|
|
34
40
|
exports.ContentPageRepository = ContentPageRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,gDAAwB;
|
|
1
|
+
{"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/Cont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DAmCC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.toMobilePage = void 0;
|
|
3
|
+
function toMobilePage(contentPage) {
|
|
4
|
+
const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
|
5
|
+
return {
|
|
6
|
+
...contentPage,
|
|
7
|
+
blocks,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.toMobilePage = toMobilePage;
|
|
11
|
+
function toMobileBlock(block) {
|
|
12
|
+
const { mobile } = block;
|
|
13
|
+
if (mobile) {
|
|
14
|
+
return {
|
|
15
|
+
...block,
|
|
16
|
+
style: mobile.style?.length ? mobile.style : block.style,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return block;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=toMobilePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toMobilePage.js","sourceRoot":"","sources":["../../src/content-page-repository/toMobilePage.ts"],"names":[],"mappings":";;AAEA,SAAgB,YAAY,CAAC,WAA2B;IACtD,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9F,OAAO;QACL,GAAG,WAAW;QACd,MAAM;KACP,CAAC;AACJ,CAAC;AAND,oCAMC;AAED,SAAS,aAAa,CAAC,KAAe;IACpC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,MAAM,EAAE;QACV,OAAO;YACL,GAAG,KAAK;YACR,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;SACzD,CAAC;KACH;SAAM;QACL,OAAO,KAAK,CAAC;KACd;AACH,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export interface BlockDef {
|
|
|
9
9
|
version?: BlockVersion;
|
|
10
10
|
content?: BlockContent;
|
|
11
11
|
blocks?: BlockDef[];
|
|
12
|
+
mobile?: Pick<BlockDef, 'content' | 'style'> & {
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
};
|
|
12
15
|
}
|
|
13
16
|
export interface ContentPageMeta {
|
|
14
17
|
title: string;
|
|
@@ -61,3 +64,14 @@ export interface Benefit {
|
|
|
61
64
|
description?: string;
|
|
62
65
|
icon?: string;
|
|
63
66
|
}
|
|
67
|
+
export interface DaDataResult {
|
|
68
|
+
suggestions?: DaDataSuggestion<DaDataAddress>[];
|
|
69
|
+
}
|
|
70
|
+
export interface DaDataSuggestion<T> {
|
|
71
|
+
value?: string;
|
|
72
|
+
unrestricted_value?: string;
|
|
73
|
+
data?: T;
|
|
74
|
+
}
|
|
75
|
+
export interface DaDataAddress {
|
|
76
|
+
city?: string | null;
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getCurrentPosition: () => Promise<GeolocationCoordinates>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.getCurrentPosition = void 0;
|
|
3
|
+
const getCurrentPosition = async () => new Promise((resolve) => navigator.geolocation.getCurrentPosition(({ coords }) => resolve(coords)));
|
|
4
|
+
exports.getCurrentPosition = getCurrentPosition;
|
|
5
|
+
//# sourceMappingURL=getCurrentPosition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCurrentPosition.js","sourceRoot":"","sources":["../../src/utils/getCurrentPosition.ts"],"names":[],"mappings":";;AAAO,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE,CAC3C,IAAI,OAAO,CAAyB,CAAC,OAAO,EAAE,EAAE,CAC9C,SAAS,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAC1E,CAAC;AAHS,QAAA,kBAAkB,sBAG3B"}
|
|
@@ -19,10 +19,12 @@ export declare type AsyncDataHook = <Data, Error = any>(key: string, fetcher: ()
|
|
|
19
19
|
data?: Data;
|
|
20
20
|
error?: Error;
|
|
21
21
|
};
|
|
22
|
+
export declare type GeolocationHook = (defaultLocation: string) => [string, () => void];
|
|
22
23
|
export interface ContentPageContext {
|
|
23
24
|
useRouter: () => Router;
|
|
24
25
|
useState: <State>(initialState: State) => [State, (_: State) => void];
|
|
25
26
|
useAsyncData: AsyncDataHook;
|
|
27
|
+
useGeolocation: GeolocationHook;
|
|
26
28
|
useLikeService: () => LikeService;
|
|
27
29
|
useSearch: () => Search;
|
|
28
30
|
handlerDecorator?: HandlerDecorator;
|
package/lib/Header/Header.js
CHANGED
|
@@ -9,7 +9,7 @@ import { useSitemap } from '../useSitemap.js';
|
|
|
9
9
|
import { HeaderSecondaryMenu } from './HeaderSecondaryMenu.js';
|
|
10
10
|
import { isSubItemActive } from './isSubItemActive.js';
|
|
11
11
|
import { isTopItemActive } from './isTopItemActive.js';
|
|
12
|
-
export const Header = JSX(({ className,
|
|
12
|
+
export const Header = JSX(({ className, defaultLocation, context, topItems }) => {
|
|
13
13
|
const router = context.useRouter();
|
|
14
14
|
const sitemap = useSitemap(context.useAsyncData);
|
|
15
15
|
const { handlerDecorator } = context;
|
|
@@ -19,6 +19,6 @@ export const Header = JSX(({ className, location, context, topItems }) => {
|
|
|
19
19
|
const activeSubItem = subItems?.find(isSubItemActive(router));
|
|
20
20
|
const topMenu = mergedItems.map((_, i) => (_jsx(TopItem, { active: _ === activeTopItem, ...useLink({ router, handlerDecorator }, _), ariaLabel: _.text }, String(i))));
|
|
21
21
|
const subMenu = subItems?.map((_) => (_jsx(HeaderItem, { className: "mr-8", active: _ === activeSubItem, ...useLink({ router, handlerDecorator }, _) }, _.href)));
|
|
22
|
-
return (_jsxs("header", { className: `pt-5 pb-8 px-20 bg-white ${className || ''}`, children: [_jsxs("div", { className: "flex items-center", children: [_jsx(Logo, { className: "mr-8" }), topMenu, _jsx(HeaderSecondaryMenu, {
|
|
22
|
+
return (_jsxs("header", { className: `pt-5 pb-8 px-20 bg-white ${className || ''}`, children: [_jsxs("div", { className: "flex items-center", children: [_jsx(Logo, { className: "mr-8" }), topMenu, _jsx(HeaderSecondaryMenu, { context: context, className: "ml-auto", defaultLocation: defaultLocation })] }), _jsx("div", { className: "mt-5 h-[1px] bg-main-divider" }), _jsx("nav", { className: "mt-5", children: subMenu })] }));
|
|
23
23
|
});
|
|
24
24
|
//# sourceMappingURL=Header.js.map
|
package/lib/Header/Header.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/Header/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAc,CAAC,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"Header.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EAAE,CAAC,CACxC,KAAC,OAAO,IAEN,MAAM,EAAE,CAAC,KAAK,aAAa,KACvB,OAAO,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC,EAC5C,SAAS,EAAE,CAAC,CAAC,IAAI,IAHZ,MAAM,CAAC,CAAC,CAAC,CAId,CACH,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACnC,KAAC,UAAU,IAET,SAAS,EAAC,MAAM,EAChB,MAAM,EAAE,CAAC,KAAK,aAAa,KACvB,OAAO,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC,IAHvC,CAAC,CAAC,IAAI,CAIX,CACH,CAAC,CAAC;IAEH,OAAO,CACL,kBAAQ,SAAS,EAAE,4BAA4B,SAAS,IAAI,EAAE,EAAE,aAC9D,eAAK,SAAS,EAAC,mBAAmB,aAChC,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,GAAG,EACxB,OAAO,EACR,KAAC,mBAAmB,IAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,SAAS,EACnB,eAAe,EAAE,eAAe,GAChC,IACE,EACN,cAAK,SAAS,EAAC,8BAA8B,GAAG,EAChD,cAAK,SAAS,EAAC,MAAM,YAAE,OAAO,GAAO,IAC9B,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { UniBlockProps } from '../types';
|
|
2
|
+
interface HeaderSecondaryMenuContent {
|
|
3
|
+
defaultLocation?: string;
|
|
3
4
|
className?: string;
|
|
4
5
|
}
|
|
6
|
+
export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent, UniBlockProps {
|
|
7
|
+
}
|
|
5
8
|
export declare const HeaderSecondaryMenu: (props: import("@redneckz/uni-jsx").PropsWithChildren<HeaderSecondaryMenuProps, any>, context?: any) => any;
|
|
6
9
|
export {};
|
|
@@ -3,7 +3,8 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import { GridIcon, LoupeIcon, ProfileIcon } from '../Icons/index.js';
|
|
4
4
|
import { TopItem } from '../ui-kit/TopItem.js';
|
|
5
5
|
import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton.js';
|
|
6
|
-
export const HeaderSecondaryMenu = JSX(({
|
|
7
|
-
|
|
6
|
+
export const HeaderSecondaryMenu = JSX(({ context, className, defaultLocation = '' }) => {
|
|
7
|
+
const [city, getCity] = context.useGeolocation(defaultLocation);
|
|
8
|
+
return (_jsxs("div", { className: `flex items-center ${className || ''}`, children: [_jsx(TopItem, { className: "mr-5", flat: true, href: "#", text: city, ariaLabel: "\u041C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", onClick: getCity }), _jsx(TopItem, { className: "mr-7", flat: true, href: "#", text: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B", ariaLabel: "\u0421\u043F\u0438\u0441\u043E\u043A \u0432\u0441\u0435\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043E\u0444\u0438\u0441\u043E\u0432 \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u043E\u0432" }), _jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u0430\u0439\u0442\u0443", children: LoupeIcon({ 'aria-hidden': true }) }), _jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-primary-text hover:text-primary-main", ariaLabel: "\u041F\u0440\u043E\u0444\u0438\u043B\u044C", children: ProfileIcon({ 'aria-hidden': true }) }), _jsx(HeaderSecondaryMenuButton, { className: "mr-5 text-secondary-light hover:text-secondary-active min-w-[32px] min-h-[32px]", ariaLabel: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0441\u044B\u043B\u043A\u0438", children: GridIcon({ 'aria-hidden': true }) })] }));
|
|
8
9
|
});
|
|
9
10
|
//# sourceMappingURL=HeaderSecondaryMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderSecondaryMenu.js","sourceRoot":"","sources":["../../src/Header/HeaderSecondaryMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"HeaderSecondaryMenu.js","sourceRoot":"","sources":["../../src/Header/HeaderSecondaryMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAUxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CACpC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,GAAG,EAAE,EAAE,EAAE,EAAE;IAC/C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAEhE,OAAO,CACL,eAAK,SAAS,EAAE,qBAAqB,SAAS,IAAI,EAAE,EAAE,aACpD,KAAC,OAAO,IACN,SAAS,EAAC,MAAM,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,GAAG,EACR,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,sFAAgB,EAC1B,OAAO,EAAE,OAAO,GAChB,EACF,KAAC,OAAO,IACN,SAAS,EAAC,MAAM,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,GAAG,EACR,IAAI,EAAC,8FAAmB,EACxB,SAAS,EAAC,+NAA2C,GACrD,EACF,KAAC,yBAAyB,IACxB,SAAS,EAAC,gDAAgD,EAC1D,SAAS,EAAC,4EAAgB,YAEzB,SAAS,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,GACT,EAC5B,KAAC,yBAAyB,IACxB,SAAS,EAAC,gDAAgD,EAC1D,SAAS,EAAC,4CAAS,YAElB,WAAW,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,GACX,EAC5B,KAAC,yBAAyB,IACxB,SAAS,EAAC,iFAAiF,EAC3F,SAAS,EAAC,2HAAuB,YAEhC,QAAQ,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,GACR,IACxB,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getCurrentPosition } from '../utils/getCurrentPosition.js';
|
|
2
|
+
export function DaDataAPI(baseURL = '') {
|
|
3
|
+
async function getFetcherAddress() {
|
|
4
|
+
if (!('geolocation' in navigator)) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
try {
|
|
8
|
+
const coords = await getCurrentPosition();
|
|
9
|
+
const response = await fetch(`${baseURL}/geolocate`, {
|
|
10
|
+
method: 'POST',
|
|
11
|
+
mode: 'cors',
|
|
12
|
+
body: JSON.stringify({
|
|
13
|
+
lat: coords.latitude,
|
|
14
|
+
lon: coords.longitude,
|
|
15
|
+
count: 1,
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
const data = (await response.json());
|
|
19
|
+
return data?.suggestions?.[0]?.data?.city;
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
console.error(e);
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
getFetcherAddress,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=DaDataAPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DaDataAPI.js","sourceRoot":"","sources":["../../src/api/DaDataAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAIjE,MAAM,UAAU,SAAS,CAAC,OAAO,GAAG,EAAE;IACpC,KAAK,UAAU,iBAAiB;QAC9B,IAAI,CAAC,CAAC,aAAa,IAAI,SAAS,CAAC,EAAE;YACjC,OAAO,IAAI,CAAC;SACb;QAED,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,kBAAkB,EAAE,CAAC;YAC1C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,OAAO,YAAY,EAAE;gBACnD,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,GAAG,EAAE,MAAM,CAAC,QAAQ;oBACpB,GAAG,EAAE,MAAM,CAAC,SAAS;oBACrB,KAAK,EAAE,CAAC;iBACT,CAAC;aACH,CAAC,CAAC;YAEH,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAiB,CAAC;YACrD,OAAO,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;SAC3C;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED,OAAO;QACL,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
package/lib/api/LikeAPI.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export interface LikeData {
|
|
|
2
2
|
node_id: string;
|
|
3
3
|
value: number;
|
|
4
4
|
}
|
|
5
|
-
export declare function LikeAPI(projectId: string, baseURL
|
|
5
|
+
export declare function LikeAPI(projectId: string, baseURL?: string): {
|
|
6
6
|
getLikeCount: (...nodeIds: string[]) => Promise<LikeData[]>;
|
|
7
7
|
like: (nodeId: string) => Promise<number>;
|
|
8
8
|
dislike: (nodeId: string) => Promise<number>;
|
package/lib/api/LikeAPI.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const AUTH_PREFIX = 'guest';
|
|
2
2
|
const STORAGE_KEY = 'likesToken';
|
|
3
|
-
export function LikeAPI(projectId, baseURL) {
|
|
3
|
+
export function LikeAPI(projectId, baseURL = '') {
|
|
4
4
|
async function getLikeCount(...nodeIds) {
|
|
5
5
|
if (!nodeIds.length) {
|
|
6
6
|
return [];
|
|
7
7
|
}
|
|
8
8
|
const { token: Authorization } = await auth();
|
|
9
9
|
try {
|
|
10
|
-
const response = await fetch(
|
|
10
|
+
const response = await fetch(`${baseURL}/assist/v1/public/projects/${projectId}/nodes/likes`, {
|
|
11
11
|
method: 'POST',
|
|
12
12
|
mode: 'cors',
|
|
13
13
|
headers: { 'Content-Type': 'application/json', Authorization },
|
package/lib/api/LikeAPI.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LikeAPI.js","sourceRoot":"","sources":["../../src/api/LikeAPI.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,WAAW,GAAG,YAAY,CAAC;AAEjC,MAAM,UAAU,OAAO,CAAC,SAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"LikeAPI.js","sourceRoot":"","sources":["../../src/api/LikeAPI.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,WAAW,GAAG,YAAY,CAAC;AAEjC,MAAM,UAAU,OAAO,CAAC,S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O,QAAQ,CAAC;aACjB;SACF;QAAC,OAAO,CAAC,EAAE;YACV,aAAa;SACd;QAED,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,OAAO,wBAAwB,EAAE;gBAC/D,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,MAAM,EAAE,WAAW;iBACpB,CAAC;aACH,CAAC,CAAC;YAEH,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YAE9C,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAE9E,OAAO,EAAE,KAAK,EAAE,IAAI,EAAc,CAAC;SACpC;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,OAAO,EAAc,CAAC;SACvB;IACH,CAAC;IAED,OAAO;QACL,YAAY;QACZ,IAAI;QACJ,OAAO;KACR,CAAC;AACJ,CAAC"}
|
package/lib/common.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "../fonts/ubuntu/ubuntu.css";[data-theme=pc]{--color-primary-main:#42ab44;--color-primary-hover:#248341;--color-primary-active:#245f34;--color-secondary-hover:#c5e2c6;--color-secondary-active:#d8f2d9}[data-theme=bc]{--color-primary-main:#83b83e;--color-primary-hover:#5c921d;--color-primary-active:#3c5e10;--color-secondary-hover:#e8f4d9;--color-secondary-active:#d8e3ca}[data-theme=eo]{--color-primary-main:#ddb63d;--color-primary-hover:#bb9727;--color-primary-active:#7e630c;--color-secondary-hover:#f1ecdd;--color-secondary-active:#e5dec7}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.top-4{top:1rem}.right-4{right:1rem}.bottom-0{bottom:0}.right-0{right:0}.left-0{left:0}.-bottom-2{bottom:-.5rem}.top-0{top:0}.z-10{z-index:10}.col-span-12{grid-column:span 12/span 12}.col-span-8{grid-column:span 8/span 8}.col-span-4{grid-column:span 4/span 4}.col-span-6{grid-column:span 6/span 6}.m-0{margin:0}.-mx-20{margin-left:-5rem;margin-right:-5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.my-4{margin-bottom:1rem;margin-top:1rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mb-4{margin-bottom:1rem}.mt-4{margin-top:1rem}.mb-6{margin-bottom:1.5rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.mt-2\.5{margin-top:.625rem}.mt-2{margin-top:.5rem}.mt-9{margin-top:2.25rem}.mb-5{margin-bottom:1.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mb-12{margin-bottom:3rem}.mt-5{margin-top:1.25rem}.mb-10{margin-bottom:2.5rem}.mr-8{margin-right:2rem}.mb-2\.5{margin-bottom:.625rem}.mb-2{margin-bottom:.5rem}.ml-auto{margin-left:auto}.mr-5{margin-right:1.25rem}.mr-7{margin-right:1.75rem}.ml-2\.5{margin-left:.625rem}.box-border{box-sizing:border-box}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.h-full{height:100%}.h-\[70px\]{height:70px}.h-8{height:2rem}.h-\[90px\]{height:90px}.h-4{height:1rem}.h-\[50px\]{height:50px}.h-\[3px\]{height:3px}.h-0\.5{height:.125rem}.h-0{height:0}.h-\[100px\]{height:100px}.h-\[1px\]{height:1px}.h-\[8px\]{height:8px}.h-\[2px\]{height:2px}.h-\[24px\]{height:24px}.min-h-\[70px\]{min-height:70px}.min-h-\[90px\]{min-height:90px}.min-h-\[50px\]{min-height:50px}.min-h-\[100px\]{min-height:100px}.min-h-\[32px\]{min-height:32px}.min-h-\[8px\]{min-height:8px}.w-\[70px\]{width:70px}.w-full{width:100%}.w-8{width:2rem}.w-\[125px\]{width:125px}.w-\[90px\]{width:90px}.w-\[50px\]{width:50px}.w-\[100px\]{width:100px}.w-\[276px\]{width:276px}.w-\[280px\]{width:280px}.w-\[235px\]{width:235px}.w-\[24px\]{width:24px}.w-\[8px\]{width:8px}.w-\[36px\]{width:36px}.w-10{width:2.5rem}.min-w-\[70px\]{min-width:70px}.min-w-\[90px\]{min-width:90px}.min-w-\[600px\]{min-width:600px}.min-w-\[50px\]{min-width:50px}.min-w-\[100px\]{min-width:100px}.min-w-\[32px\]{min-width:32px}.min-w-\[8px\]{min-width:8px}.max-w-\[600px\]{max-width:600px}.max-w-\[47rem\]{max-width:47rem}.max-w-\[580px\]{max-width:580px}.max-w-min{max-width:-webkit-min-content;max-width:-moz-min-content;max-width:min-content}.max-w-\[292px\]{max-width:292px}.max-w-\[170px\]{max-width:170px}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.basis-0{flex-basis:0px}.-translate-x-full{--tw-translate-x:-100%}.-translate-x-full,.rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@-webkit-keyframes progress{0%{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes progress{0%{transform:translateX(-100%)}to{transform:translateX(0)}}.animate-slide{-webkit-animation:progress linear;animation:progress linear}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-1{gap:.25rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.gap-32{gap:8rem}.gap-11{gap:2.75rem}.gap-\[14px\]{gap:14px}.gap-2{gap:.5rem}.gap-3\.5{gap:.875rem}.gap-x-24{-moz-column-gap:6rem;column-gap:6rem}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.rounded-l-full{border-bottom-left-radius:9999px;border-top-left-radius:9999px}.rounded-r-full{border-bottom-right-radius:9999px;border-top-right-radius:9999px}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-bl-3xl{border-bottom-left-radius:1.5rem}.rounded-br-3xl{border-bottom-right-radius:1.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-0{border-width:0}.border-x-0{border-left-width:0;border-right-width:0}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.border-solid{border-style:solid}.border-none{border-style:none}.border-main{--tw-border-opacity:1;border-color:rgb(240 244 240/var(--tw-border-opacity))}.border-main-divider{--tw-border-opacity:1;border-color:rgb(235 237 240/var(--tw-border-opacity))}.border-primary-main{border-color:var(--color-primary-main)}.border-transparent{border-color:transparent}.border-y-main-divider{--tw-border-opacity:1;border-bottom-color:rgb(235 237 240/var(--tw-border-opacity));border-top-color:rgb(235 237 240/var(--tw-border-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-main{--tw-bg-opacity:1;background-color:rgb(240 244 240/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-secondary-light{--tw-bg-opacity:1;background-color:rgb(245 247 249/var(--tw-bg-opacity))}.bg-inherit{background-color:inherit}.bg-primary-main{background-color:var(--color-primary-main)}.bg-main-divider{--tw-bg-opacity:1;background-color:rgb(235 237 240/var(--tw-bg-opacity))}.bg-secondary-dark{--tw-bg-opacity:1;background-color:rgb(226 228 229/var(--tw-bg-opacity))}.p-12{padding:3rem}.p-10{padding:2.5rem}.p-20{padding:5rem}.p-2{padding:.5rem}.p-\[10px\]{padding:10px}.p-11{padding:2.75rem}.p-\[26px\]{padding:26px}.p-9{padding:2.25rem}.p-0{padding:0}.py-10{padding-bottom:2.5rem;padding-top:2.5rem}.px-0{padding-left:0;padding-right:0}.py-4{padding-bottom:1rem;padding-top:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-12{padding-left:3rem;padding-right:3rem}.py-12{padding-bottom:3rem;padding-top:3rem}.px-\[88px\]{padding-left:88px;padding-right:88px}.px-3{padding-left:.75rem;padding-right:.75rem}.px-9{padding-left:2.25rem;padding-right:2.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-\[5px\]{padding-bottom:5px;padding-top:5px}.px-20{padding-left:5rem;padding-right:5rem}.py-3\.5{padding-bottom:.875rem;padding-top:.875rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-4{padding-left:1rem;padding-right:1rem}.pb-2{padding-bottom:.5rem}.pt-0{padding-top:0}.pl-11{padding-left:2.75rem}.pt-4{padding-top:1rem}.pl-12{padding-left:3rem}.pr-\[7\.5rem\]{padding-right:7.5rem}.pt-1{padding-top:.25rem}.pr-28{padding-right:7rem}.pt-\[3px\]{padding-top:3px}.pt-\[5px\]{padding-top:5px}.pt-5{padding-top:1.25rem}.pb-8{padding-bottom:2rem}.pl-4{padding-left:1rem}.pl-\[170px\]{padding-left:170px}.text-left{text-align:left}.text-center{text-align:center}.font-sans{font-family:Ubuntu,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-base{font-size:1rem;line-height:1.5rem}.text-title-xs{font-size:1.5rem;line-height:1.875rem}.text-title-sm{font-size:1.75rem;line-height:2.5rem}.text-title{font-size:2rem;line-height:2.5rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.375rem}.text-xs{font-size:.75rem;line-height:1.125rem}.text-title-lg{font-size:2.5rem;line-height:3rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.text-primary-text{--tw-text-opacity:1;color:rgb(28 28 28/var(--tw-text-opacity))}.text-secondary-text{--tw-text-opacity:1;color:rgb(125 126 127/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-secondary-light{--tw-text-opacity:1;color:rgb(245 247 249/var(--tw-text-opacity))}.text-primary-main{color:var(--color-primary-main)}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.no-underline{-webkit-text-decoration-line:none;text-decoration-line:none}.shadow-\[0_8px_32px_0px_\#00000014\]{--tw-shadow:0 8px 32px 0px #00000014;--tw-shadow-colored:0 8px 32px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.duration-1000{transition-duration:1s}.rotate-180{transform:rotate(180deg)}.-translate-x-full{transform:translateX(-100%)}.visited\:text-secondary-text:visited{color:#7d7e7f}.hover\:bg-primary-hover:hover{background-color:var(--color-primary-hover)}.hover\:bg-secondary-hover:hover{background-color:var(--color-secondary-hover)}.hover\:text-primary-text:hover{--tw-text-opacity:1;color:rgb(28 28 28/var(--tw-text-opacity))}.hover\:text-primary-main:hover{color:var(--color-primary-main)}.hover\:text-secondary-active:hover{color:var(--color-secondary-active)}.hover\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.active\:bg-primary-active:active{background-color:var(--color-primary-active)}.active\:bg-secondary-active:active{background-color:var(--color-secondary-active)}.group:hover .group-hover\:text-primary-text{--tw-text-opacity:1;color:rgb(28 28 28/var(--tw-text-opacity))}@media (min-width:1280px) and (max-width:1535px){.xl\:w-\[220px\]{width:220px}.xl\:gap-8{gap:2rem}.xl\:gap-5{gap:1.25rem}}
|
|
1
|
+
@import "../fonts/ubuntu/ubuntu.css";[data-theme=pc]{--color-primary-main:#42ab44;--color-primary-hover:#248341;--color-primary-active:#245f34;--color-secondary-hover:#c5e2c6;--color-secondary-active:#d8f2d9}[data-theme=bc]{--color-primary-main:#83b83e;--color-primary-hover:#5c921d;--color-primary-active:#3c5e10;--color-secondary-hover:#e8f4d9;--color-secondary-active:#d8e3ca}[data-theme=eo]{--color-primary-main:#ddb63d;--color-primary-hover:#bb9727;--color-primary-active:#7e630c;--color-secondary-hover:#f1ecdd;--color-secondary-active:#e5dec7}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.top-4{top:1rem}.right-4{right:1rem}.bottom-0{bottom:0}.right-0{right:0}.left-0{left:0}.-bottom-2{bottom:-.5rem}.top-0{top:0}.z-10{z-index:10}.col-span-12{grid-column:span 12/span 12}.col-span-8{grid-column:span 8/span 8}.col-span-4{grid-column:span 4/span 4}.col-span-6{grid-column:span 6/span 6}.m-0{margin:0}.-mx-20{margin-left:-5rem;margin-right:-5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.my-4{margin-bottom:1rem;margin-top:1rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mb-4{margin-bottom:1rem}.mt-4{margin-top:1rem}.mb-6{margin-bottom:1.5rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.mt-2\.5{margin-top:.625rem}.mt-2{margin-top:.5rem}.mt-9{margin-top:2.25rem}.mb-5{margin-bottom:1.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mb-12{margin-bottom:3rem}.mt-5{margin-top:1.25rem}.mb-10{margin-bottom:2.5rem}.mr-8{margin-right:2rem}.mb-2\.5{margin-bottom:.625rem}.mb-2{margin-bottom:.5rem}.ml-auto{margin-left:auto}.mr-5{margin-right:1.25rem}.mr-7{margin-right:1.75rem}.ml-2\.5{margin-left:.625rem}.box-border{box-sizing:border-box}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-full{height:100%}.h-\[70px\]{height:70px}.h-8{height:2rem}.h-\[90px\]{height:90px}.h-4{height:1rem}.h-\[50px\]{height:50px}.h-\[3px\]{height:3px}.h-0\.5{height:.125rem}.h-0{height:0}.h-\[100px\]{height:100px}.h-\[1px\]{height:1px}.h-\[8px\]{height:8px}.h-\[2px\]{height:2px}.h-\[24px\]{height:24px}.min-h-\[70px\]{min-height:70px}.min-h-\[90px\]{min-height:90px}.min-h-\[50px\]{min-height:50px}.min-h-\[100px\]{min-height:100px}.min-h-\[32px\]{min-height:32px}.min-h-\[8px\]{min-height:8px}.w-\[70px\]{width:70px}.w-full{width:100%}.w-8{width:2rem}.w-\[125px\]{width:125px}.w-\[90px\]{width:90px}.w-\[50px\]{width:50px}.w-\[100px\]{width:100px}.w-\[276px\]{width:276px}.w-\[280px\]{width:280px}.w-\[235px\]{width:235px}.w-\[24px\]{width:24px}.w-\[8px\]{width:8px}.w-\[36px\]{width:36px}.w-10{width:2.5rem}.min-w-\[70px\]{min-width:70px}.min-w-\[90px\]{min-width:90px}.min-w-\[600px\]{min-width:600px}.min-w-\[50px\]{min-width:50px}.min-w-\[100px\]{min-width:100px}.min-w-\[32px\]{min-width:32px}.min-w-\[8px\]{min-width:8px}.max-w-\[600px\]{max-width:600px}.max-w-\[47rem\]{max-width:47rem}.max-w-\[580px\]{max-width:580px}.max-w-min{max-width:-webkit-min-content;max-width:-moz-min-content;max-width:min-content}.max-w-\[292px\]{max-width:292px}.max-w-\[170px\]{max-width:170px}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.basis-0{flex-basis:0px}.-translate-x-full{--tw-translate-x:-100%}.-translate-x-full,.rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@-webkit-keyframes progress{0%{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes progress{0%{transform:translateX(-100%)}to{transform:translateX(0)}}.animate-slide{-webkit-animation:progress linear;animation:progress linear}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-1{gap:.25rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.gap-32{gap:8rem}.gap-11{gap:2.75rem}.gap-\[14px\]{gap:14px}.gap-2{gap:.5rem}.gap-3\.5{gap:.875rem}.gap-x-24{-moz-column-gap:6rem;column-gap:6rem}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.rounded-l-full{border-bottom-left-radius:9999px;border-top-left-radius:9999px}.rounded-r-full{border-bottom-right-radius:9999px;border-top-right-radius:9999px}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-bl-3xl{border-bottom-left-radius:1.5rem}.rounded-br-3xl{border-bottom-right-radius:1.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-0{border-width:0}.border-x-0{border-left-width:0;border-right-width:0}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.border-solid{border-style:solid}.border-none{border-style:none}.border-main{--tw-border-opacity:1;border-color:rgb(240 244 240/var(--tw-border-opacity))}.border-main-divider{--tw-border-opacity:1;border-color:rgb(235 237 240/var(--tw-border-opacity))}.border-primary-main{border-color:var(--color-primary-main)}.border-transparent{border-color:transparent}.border-y-main-divider{--tw-border-opacity:1;border-bottom-color:rgb(235 237 240/var(--tw-border-opacity));border-top-color:rgb(235 237 240/var(--tw-border-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-main{--tw-bg-opacity:1;background-color:rgb(240 244 240/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-secondary-light{--tw-bg-opacity:1;background-color:rgb(245 247 249/var(--tw-bg-opacity))}.bg-inherit{background-color:inherit}.bg-primary-main{background-color:var(--color-primary-main)}.bg-main-divider{--tw-bg-opacity:1;background-color:rgb(235 237 240/var(--tw-bg-opacity))}.bg-secondary-dark{--tw-bg-opacity:1;background-color:rgb(226 228 229/var(--tw-bg-opacity))}.p-12{padding:3rem}.p-10{padding:2.5rem}.p-20{padding:5rem}.p-2{padding:.5rem}.p-\[10px\]{padding:10px}.p-11{padding:2.75rem}.p-\[26px\]{padding:26px}.p-9{padding:2.25rem}.p-0{padding:0}.py-10{padding-bottom:2.5rem;padding-top:2.5rem}.px-0{padding-left:0;padding-right:0}.py-4{padding-bottom:1rem;padding-top:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-12{padding-left:3rem;padding-right:3rem}.py-12{padding-bottom:3rem;padding-top:3rem}.px-\[88px\]{padding-left:88px;padding-right:88px}.px-3{padding-left:.75rem;padding-right:.75rem}.px-9{padding-left:2.25rem;padding-right:2.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-\[5px\]{padding-bottom:5px;padding-top:5px}.px-20{padding-left:5rem;padding-right:5rem}.py-3\.5{padding-bottom:.875rem;padding-top:.875rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-4{padding-left:1rem;padding-right:1rem}.pb-2{padding-bottom:.5rem}.pt-0{padding-top:0}.pl-11{padding-left:2.75rem}.pt-4{padding-top:1rem}.pl-12{padding-left:3rem}.pr-\[7\.5rem\]{padding-right:7.5rem}.pt-1{padding-top:.25rem}.pr-28{padding-right:7rem}.pt-\[3px\]{padding-top:3px}.pt-\[5px\]{padding-top:5px}.pt-5{padding-top:1.25rem}.pb-8{padding-bottom:2rem}.pl-4{padding-left:1rem}.pl-\[170px\]{padding-left:170px}.text-left{text-align:left}.text-center{text-align:center}.font-sans{font-family:Ubuntu,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.text-base{font-size:1rem;line-height:1.5rem}.text-title-xs{font-size:1.5rem;line-height:1.875rem}.text-title-sm{font-size:1.75rem;line-height:2.5rem}.text-title{font-size:2rem;line-height:2.5rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.375rem}.text-xs{font-size:.75rem;line-height:1.125rem}.text-title-lg{font-size:2.5rem;line-height:3rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.text-primary-text{--tw-text-opacity:1;color:rgb(28 28 28/var(--tw-text-opacity))}.text-secondary-text{--tw-text-opacity:1;color:rgb(125 126 127/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-secondary-light{--tw-text-opacity:1;color:rgb(245 247 249/var(--tw-text-opacity))}.text-primary-main{color:var(--color-primary-main)}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.no-underline{-webkit-text-decoration-line:none;text-decoration-line:none}.shadow-\[0_8px_32px_0px_\#00000014\]{--tw-shadow:0 8px 32px 0px #00000014;--tw-shadow-colored:0 8px 32px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.duration-1000{transition-duration:1s}.rotate-180{transform:rotate(180deg)}.-translate-x-full{transform:translateX(-100%)}.visited\:text-secondary-text:visited{color:#7d7e7f}.hover\:bg-primary-hover:hover{background-color:var(--color-primary-hover)}.hover\:bg-secondary-hover:hover{background-color:var(--color-secondary-hover)}.hover\:text-primary-text:hover{--tw-text-opacity:1;color:rgb(28 28 28/var(--tw-text-opacity))}.hover\:text-primary-main:hover{color:var(--color-primary-main)}.hover\:text-secondary-active:hover{color:var(--color-secondary-active)}.hover\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.active\:bg-primary-active:active{background-color:var(--color-primary-active)}.active\:bg-secondary-active:active{background-color:var(--color-secondary-active)}.group:hover .group-hover\:text-primary-text{--tw-text-opacity:1;color:rgb(28 28 28/var(--tw-text-opacity))}@media (min-width:1280px) and (max-width:1535px){.xl\:w-\[220px\]{width:220px}.xl\:gap-8{gap:2rem}.xl\:gap-5{gap:1.25rem}}
|
|
@@ -3,4 +3,5 @@ import type { TransformationOptions } from './TransformationOptions';
|
|
|
3
3
|
export declare function ContentPageRepository({ contentDir, publicDir, }?: Partial<TransformationOptions>): {
|
|
4
4
|
getAllContentPages: () => Promise<ContentPageDef[]>;
|
|
5
5
|
getContentPageBySlug: (slug: string) => Promise<ContentPageDef | undefined>;
|
|
6
|
+
getMobilePageBySlug: (slug: string) => Promise<ContentPageDef | undefined>;
|
|
6
7
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
2
|
import util from 'util';
|
|
3
|
+
import { toMobilePage } from './toMobilePage.js';
|
|
3
4
|
import { transformContentPage } from './transformContentPage.js';
|
|
4
5
|
const find = util.promisify(glob);
|
|
5
6
|
export function ContentPageRepository({ contentDir = 'content', publicDir = 'public', } = {}) {
|
|
@@ -11,6 +12,10 @@ export function ContentPageRepository({ contentDir = 'content', publicDir = 'pub
|
|
|
11
12
|
const pages = await getAllContentPages();
|
|
12
13
|
return pages.find((content) => content.slug === slug);
|
|
13
14
|
}
|
|
15
|
+
async function getMobilePageBySlug(slug) {
|
|
16
|
+
const page = await getContentPageBySlug(slug);
|
|
17
|
+
return page && toMobilePage(page);
|
|
18
|
+
}
|
|
14
19
|
const cache = {};
|
|
15
20
|
async function readPage(filePath) {
|
|
16
21
|
if (!(filePath in cache)) {
|
|
@@ -24,6 +29,7 @@ export function ContentPageRepository({ contentDir = 'content', publicDir = 'pub
|
|
|
24
29
|
return {
|
|
25
30
|
getAllContentPages,
|
|
26
31
|
getContentPageBySlug,
|
|
32
|
+
getMobilePageBySlug,
|
|
27
33
|
};
|
|
28
34
|
}
|
|
29
35
|
//# sourceMappingURL=ContentPageRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,UAAU,qBAAqB,CAAC,EACpC,UAAU,GAAG,SAAS,EACtB,SAAS,GAAG,QAAQ,MACc,EAAE;IACpC,KAAK,UAAU,kBAAkB;QAC/B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,UAAU,iBAAiB,CAAC,CAAC;QAC7D,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,UAAU,oBAAoB,CAAC,IAAY;QAC9C,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,UAAU,mBAAmB,CAAC,IAAY;QAC7C,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,KAAK,GAAmC,EAAE,CAAC;IACjD,KAAK,UAAU,QAAQ,CAAC,QAAgB;QACtC,IAAI,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE;YACxB,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,oBAAoB,CAAC,QAAQ,EAAE;gBACrD,UAAU;gBACV,SAAS;aACV,CAAC,CAAC;SACJ;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED,OAAO;QACL,kBAAkB;QAClB,oBAAoB;QACpB,mBAAmB;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function toMobilePage(contentPage) {
|
|
2
|
+
const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
|
3
|
+
return {
|
|
4
|
+
...contentPage,
|
|
5
|
+
blocks,
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function toMobileBlock(block) {
|
|
9
|
+
const { mobile } = block;
|
|
10
|
+
if (mobile) {
|
|
11
|
+
return {
|
|
12
|
+
...block,
|
|
13
|
+
style: mobile.style?.length ? mobile.style : block.style,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return block;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=toMobilePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toMobilePage.js","sourceRoot":"","sources":["../../src/content-page-repository/toMobilePage.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,WAA2B;IACtD,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9F,OAAO;QACL,GAAG,WAAW;QACd,MAAM;KACP,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAe;IACpC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,MAAM,EAAE;QACV,OAAO;YACL,GAAG,KAAK;YACR,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;SACzD,CAAC;KACH;SAAM;QACL,OAAO,KAAK,CAAC;KACd;AACH,CAAC"}
|
package/lib/types.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export interface BlockDef {
|
|
|
9
9
|
version?: BlockVersion;
|
|
10
10
|
content?: BlockContent;
|
|
11
11
|
blocks?: BlockDef[];
|
|
12
|
+
mobile?: Pick<BlockDef, 'content' | 'style'> & {
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
};
|
|
12
15
|
}
|
|
13
16
|
export interface ContentPageMeta {
|
|
14
17
|
title: string;
|
|
@@ -61,3 +64,14 @@ export interface Benefit {
|
|
|
61
64
|
description?: string;
|
|
62
65
|
icon?: string;
|
|
63
66
|
}
|
|
67
|
+
export interface DaDataResult {
|
|
68
|
+
suggestions?: DaDataSuggestion<DaDataAddress>[];
|
|
69
|
+
}
|
|
70
|
+
export interface DaDataSuggestion<T> {
|
|
71
|
+
value?: string;
|
|
72
|
+
unrestricted_value?: string;
|
|
73
|
+
data?: T;
|
|
74
|
+
}
|
|
75
|
+
export interface DaDataAddress {
|
|
76
|
+
city?: string | null;
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getCurrentPosition: () => Promise<GeolocationCoordinates>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCurrentPosition.js","sourceRoot":"","sources":["../../src/utils/getCurrentPosition.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE,CAC3C,IAAI,OAAO,CAAyB,CAAC,OAAO,EAAE,EAAE,CAC9C,SAAS,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAC1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.55",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -74,12 +74,11 @@
|
|
|
74
74
|
"url": "https://github.com/redneckz/wildless-cms-uni-blocks/issues"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
|
-
"build": "npm run build:lib && npm run build:
|
|
77
|
+
"build": "npm run build:lib && npm run build:commonjs && npm run build:style",
|
|
78
78
|
"build:lib": "rimraf ./lib && tsc --build --verbose",
|
|
79
79
|
"postbuild:lib": "replace-in-file --configFile=replace-config.lib.cjs --verbose",
|
|
80
|
-
"build:module": "rimraf ./module && tsc --outDir module",
|
|
81
|
-
"postbuild:module": "replace-in-file --configFile=replace-config.module.cjs --verbose",
|
|
82
80
|
"build:commonjs": "rimraf ./dist && tsc --module commonjs --noImplicitUseStrict --outDir dist",
|
|
81
|
+
"bundle": "rimraf ./bundle && rollup -c",
|
|
83
82
|
"build:style": "postcss './src/**/*.css' --env production --dir ./lib",
|
|
84
83
|
"postbuild:style": "npm run size",
|
|
85
84
|
"size": "size-limit",
|
|
@@ -109,6 +108,8 @@
|
|
|
109
108
|
"unified": "^10.1.2"
|
|
110
109
|
},
|
|
111
110
|
"devDependencies": {
|
|
111
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
112
|
+
"@rollup/plugin-typescript": "^8.3.3",
|
|
112
113
|
"@size-limit/file": "^7.0.8",
|
|
113
114
|
"@types/jest": "^28.1.1",
|
|
114
115
|
"autoprefixer": "^10.4.7",
|
|
@@ -125,6 +126,8 @@
|
|
|
125
126
|
"react-cosmos": "^5.7.2",
|
|
126
127
|
"replace-in-file": "^6.3.5",
|
|
127
128
|
"rimraf": "^3.0.2",
|
|
129
|
+
"rollup": "^2.75.6",
|
|
130
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
128
131
|
"size-limit": "^7.0.8",
|
|
129
132
|
"style-loader": "^3.3.1",
|
|
130
133
|
"tailwindcss": "^3.1.1",
|
|
@@ -24,10 +24,13 @@ export type AsyncDataHook = <Data, Error = any>(
|
|
|
24
24
|
fetcher: () => Promise<Data>,
|
|
25
25
|
) => { data?: Data; error?: Error };
|
|
26
26
|
|
|
27
|
+
export type GeolocationHook = (defaultLocation: string) => [string, () => void];
|
|
28
|
+
|
|
27
29
|
export interface ContentPageContext {
|
|
28
30
|
useRouter: () => Router;
|
|
29
31
|
useState: <State>(initialState: State) => [State, (_: State) => void];
|
|
30
32
|
useAsyncData: AsyncDataHook;
|
|
33
|
+
useGeolocation: GeolocationHook;
|
|
31
34
|
useLikeService: () => LikeService;
|
|
32
35
|
useSearch: () => Search;
|
|
33
36
|
handlerDecorator?: HandlerDecorator;
|
package/src/Header/Header.tsx
CHANGED
|
@@ -13,7 +13,7 @@ import { isTopItemActive } from './isTopItemActive';
|
|
|
13
13
|
|
|
14
14
|
export interface HeaderProps extends HeaderContent, UniBlockProps {}
|
|
15
15
|
|
|
16
|
-
export const Header = JSX<HeaderProps>(({ className,
|
|
16
|
+
export const Header = JSX<HeaderProps>(({ className, defaultLocation, context, topItems }) => {
|
|
17
17
|
const router = context.useRouter();
|
|
18
18
|
const sitemap = useSitemap(context.useAsyncData);
|
|
19
19
|
const { handlerDecorator } = context;
|
|
@@ -46,7 +46,11 @@ export const Header = JSX<HeaderProps>(({ className, location, context, topItems
|
|
|
46
46
|
<div className="flex items-center">
|
|
47
47
|
<Logo className="mr-8" />
|
|
48
48
|
{topMenu}
|
|
49
|
-
<HeaderSecondaryMenu
|
|
49
|
+
<HeaderSecondaryMenu
|
|
50
|
+
context={context}
|
|
51
|
+
className="ml-auto"
|
|
52
|
+
defaultLocation={defaultLocation}
|
|
53
|
+
/>
|
|
50
54
|
</div>
|
|
51
55
|
<div className="mt-5 h-[1px] bg-main-divider" />
|
|
52
56
|
<nav className="mt-5">{subMenu}</nav>
|
|
@@ -2,41 +2,55 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { GridIcon, LoupeIcon, ProfileIcon } from '../Icons/index';
|
|
3
3
|
import { TopItem } from '../ui-kit/TopItem';
|
|
4
4
|
import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton';
|
|
5
|
+
import type { UniBlockProps } from '../types';
|
|
5
6
|
|
|
6
|
-
interface
|
|
7
|
-
|
|
7
|
+
interface HeaderSecondaryMenuContent {
|
|
8
|
+
defaultLocation?: string;
|
|
8
9
|
className?: string;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
12
|
+
export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent, UniBlockProps {}
|
|
13
|
+
|
|
14
|
+
export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
15
|
+
({ context, className, defaultLocation = '' }) => {
|
|
16
|
+
const [city, getCity] = context.useGeolocation(defaultLocation);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className={`flex items-center ${className || ''}`}>
|
|
20
|
+
<TopItem
|
|
21
|
+
className="mr-5"
|
|
22
|
+
flat={true}
|
|
23
|
+
href="#"
|
|
24
|
+
text={city}
|
|
25
|
+
ariaLabel="Местоположение"
|
|
26
|
+
onClick={getCity}
|
|
27
|
+
/>
|
|
28
|
+
<TopItem
|
|
29
|
+
className="mr-7"
|
|
30
|
+
flat={true}
|
|
31
|
+
href="#"
|
|
32
|
+
text="Офисы и банкоматы"
|
|
33
|
+
ariaLabel="Список всех доступных офисов и банкоматов"
|
|
34
|
+
/>
|
|
35
|
+
<HeaderSecondaryMenuButton
|
|
36
|
+
className="mr-5 text-primary-text hover:text-primary-main"
|
|
37
|
+
ariaLabel="Поиск по сайту"
|
|
38
|
+
>
|
|
39
|
+
{LoupeIcon({ 'aria-hidden': true })}
|
|
40
|
+
</HeaderSecondaryMenuButton>
|
|
41
|
+
<HeaderSecondaryMenuButton
|
|
42
|
+
className="mr-5 text-primary-text hover:text-primary-main"
|
|
43
|
+
ariaLabel="Профиль"
|
|
44
|
+
>
|
|
45
|
+
{ProfileIcon({ 'aria-hidden': true })}
|
|
46
|
+
</HeaderSecondaryMenuButton>
|
|
47
|
+
<HeaderSecondaryMenuButton
|
|
48
|
+
className="mr-5 text-secondary-light hover:text-secondary-active min-w-[32px] min-h-[32px]"
|
|
49
|
+
ariaLabel="Дополнительные ссылки"
|
|
50
|
+
>
|
|
51
|
+
{GridIcon({ 'aria-hidden': true })}
|
|
52
|
+
</HeaderSecondaryMenuButton>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getCurrentPosition } from '../utils/getCurrentPosition';
|
|
2
|
+
|
|
3
|
+
import type { DaDataResult } from '../types';
|
|
4
|
+
|
|
5
|
+
export function DaDataAPI(baseURL = '') {
|
|
6
|
+
async function getFetcherAddress() {
|
|
7
|
+
if (!('geolocation' in navigator)) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
const coords = await getCurrentPosition();
|
|
13
|
+
const response = await fetch(`${baseURL}/geolocate`, {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
mode: 'cors',
|
|
16
|
+
body: JSON.stringify({
|
|
17
|
+
lat: coords.latitude,
|
|
18
|
+
lon: coords.longitude,
|
|
19
|
+
count: 1,
|
|
20
|
+
}),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const data = (await response.json()) as DaDataResult;
|
|
24
|
+
return data?.suggestions?.[0]?.data?.city;
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error(e);
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
getFetcherAddress,
|
|
33
|
+
};
|
|
34
|
+
}
|
package/src/api/LikeAPI.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface LikeData {
|
|
|
10
10
|
const AUTH_PREFIX = 'guest';
|
|
11
11
|
const STORAGE_KEY = 'likesToken';
|
|
12
12
|
|
|
13
|
-
export function LikeAPI(projectId: string, baseURL
|
|
13
|
+
export function LikeAPI(projectId: string, baseURL = '') {
|
|
14
14
|
async function getLikeCount(...nodeIds: string[]): Promise<LikeData[]> {
|
|
15
15
|
if (!nodeIds.length) {
|
|
16
16
|
return [];
|
|
@@ -19,14 +19,17 @@ export function LikeAPI(projectId: string, baseURL: string) {
|
|
|
19
19
|
const { token: Authorization } = await auth();
|
|
20
20
|
|
|
21
21
|
try {
|
|
22
|
-
const response = await fetch(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
const response = await fetch(
|
|
23
|
+
`${baseURL}/assist/v1/public/projects/${projectId}/nodes/likes`,
|
|
24
|
+
{
|
|
25
|
+
method: 'POST',
|
|
26
|
+
mode: 'cors',
|
|
27
|
+
headers: { 'Content-Type': 'application/json', Authorization },
|
|
28
|
+
body: JSON.stringify({
|
|
29
|
+
node_ids: nodeIds,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
);
|
|
30
33
|
|
|
31
34
|
const { likes } = await response.json();
|
|
32
35
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
2
|
import util from 'util';
|
|
3
3
|
import type { ContentPageDef } from '../types';
|
|
4
|
+
import { toMobilePage } from './toMobilePage';
|
|
4
5
|
import type { TransformationOptions } from './TransformationOptions';
|
|
5
6
|
import { transformContentPage } from './transformContentPage';
|
|
6
7
|
|
|
@@ -20,6 +21,11 @@ export function ContentPageRepository({
|
|
|
20
21
|
return pages.find((content) => content.slug === slug);
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
async function getMobilePageBySlug(slug: string): Promise<ContentPageDef | undefined> {
|
|
25
|
+
const page = await getContentPageBySlug(slug);
|
|
26
|
+
return page && toMobilePage(page);
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
const cache: Record<string, ContentPageDef> = {};
|
|
24
30
|
async function readPage(filePath: string): Promise<ContentPageDef> {
|
|
25
31
|
if (!(filePath in cache)) {
|
|
@@ -34,5 +40,6 @@ export function ContentPageRepository({
|
|
|
34
40
|
return {
|
|
35
41
|
getAllContentPages,
|
|
36
42
|
getContentPageBySlug,
|
|
43
|
+
getMobilePageBySlug,
|
|
37
44
|
};
|
|
38
45
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BlockDef, ContentPageDef } from '../types';
|
|
2
|
+
|
|
3
|
+
export function toMobilePage(contentPage: ContentPageDef): ContentPageDef {
|
|
4
|
+
const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
|
5
|
+
return {
|
|
6
|
+
...contentPage,
|
|
7
|
+
blocks,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function toMobileBlock(block: BlockDef): BlockDef {
|
|
12
|
+
const { mobile } = block;
|
|
13
|
+
if (mobile) {
|
|
14
|
+
return {
|
|
15
|
+
...block,
|
|
16
|
+
style: mobile.style?.length ? mobile.style : block.style,
|
|
17
|
+
};
|
|
18
|
+
} else {
|
|
19
|
+
return block;
|
|
20
|
+
}
|
|
21
|
+
}
|
package/src/setup-fixture.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { setup } from '@redneckz/uni-jsx';
|
|
2
|
+
|
|
2
3
|
import runtime from 'react/jsx-runtime';
|
|
3
4
|
import { useState, useEffect } from 'react';
|
|
5
|
+
import { DaDataAPI } from './api/DaDataAPI';
|
|
4
6
|
import type { ContentPageContext } from './ContentPageContext';
|
|
5
7
|
|
|
6
8
|
const { jsx, jsxs } = runtime as any;
|
|
@@ -8,6 +10,8 @@ setup(jsx, jsxs);
|
|
|
8
10
|
|
|
9
11
|
const TEST_ORIGIN = 'http://localhost:5001';
|
|
10
12
|
|
|
13
|
+
const DaData = DaDataAPI('https://10.80.4.9');
|
|
14
|
+
|
|
11
15
|
export const context: ContentPageContext = {
|
|
12
16
|
useState,
|
|
13
17
|
useRouter: () => ({
|
|
@@ -27,6 +31,17 @@ export const context: ContentPageContext = {
|
|
|
27
31
|
}, [key, fetcher]);
|
|
28
32
|
return { data };
|
|
29
33
|
},
|
|
34
|
+
useGeolocation: (defaultLocation) => {
|
|
35
|
+
const [city, setCity] = useState(defaultLocation);
|
|
36
|
+
|
|
37
|
+
const getCity = () => {
|
|
38
|
+
DaData.getFetcherAddress().then((_) => {
|
|
39
|
+
setCity(_ || defaultLocation);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return [city, getCity];
|
|
44
|
+
},
|
|
30
45
|
useLikeService: () => ({
|
|
31
46
|
likeCount: 0,
|
|
32
47
|
like: () => {
|
package/src/types.ts
CHANGED
|
@@ -22,6 +22,9 @@ export interface BlockDef {
|
|
|
22
22
|
version?: BlockVersion;
|
|
23
23
|
content?: BlockContent;
|
|
24
24
|
blocks?: BlockDef[];
|
|
25
|
+
mobile?: Pick<BlockDef, 'content' | 'style'> & {
|
|
26
|
+
hidden?: boolean;
|
|
27
|
+
};
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
export interface ContentPageMeta {
|
|
@@ -92,3 +95,17 @@ export interface Benefit {
|
|
|
92
95
|
description?: string;
|
|
93
96
|
icon?: string;
|
|
94
97
|
}
|
|
98
|
+
|
|
99
|
+
export interface DaDataResult {
|
|
100
|
+
suggestions?: DaDataSuggestion<DaDataAddress>[];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface DaDataSuggestion<T> {
|
|
104
|
+
value?: string;
|
|
105
|
+
unrestricted_value?: string;
|
|
106
|
+
data?: T;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface DaDataAddress {
|
|
110
|
+
city?: string | null;
|
|
111
|
+
}
|