@redneckz/wildless-cms-uni-blocks 0.2.54 → 0.2.57
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/ContentPage.d.ts +4 -1
- package/dist/ContentPage.js +3 -4
- package/dist/ContentPage.js.map +1 -1
- package/dist/ContentPageContext.d.ts +2 -0
- package/dist/Footer/Footer.mobile.d.ts +5 -0
- package/dist/Footer/Footer.mobile.js +7 -0
- package/dist/Footer/Footer.mobile.js.map +1 -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/MobileBlocks.d.ts +13 -0
- package/dist/MobileBlocks.js +27 -0
- package/dist/MobileBlocks.js.map +1 -0
- 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/index.d.ts +1 -0
- package/dist/content-page-repository/index.js +3 -1
- package/dist/content-page-repository/index.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/index.d.ts +5 -2
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- 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/ContentPage.d.ts +4 -1
- package/lib/ContentPage.js +3 -4
- package/lib/ContentPage.js.map +1 -1
- package/lib/ContentPageContext.d.ts +2 -0
- package/lib/Footer/Footer.mobile.d.ts +5 -0
- package/lib/Footer/Footer.mobile.js +5 -0
- package/lib/Footer/Footer.mobile.js.map +1 -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/MobileBlocks.d.ts +13 -0
- package/lib/MobileBlocks.js +25 -0
- package/lib/MobileBlocks.js.map +1 -0
- 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/index.d.ts +1 -0
- package/lib/content-page-repository/index.js +1 -0
- package/lib/content-page-repository/index.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/index.d.ts +5 -2
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- 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/ContentPage.fixture.tsx +23 -3
- package/src/ContentPage.page.json +43 -1
- package/src/ContentPage.tsx +10 -5
- package/src/ContentPageContext.tsx +3 -0
- package/src/Footer/Footer.mobile.tsx +12 -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/MobileBlocks.ts +25 -0
- 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/index.ts +1 -0
- package/src/content-page-repository/toMobilePage.ts +21 -0
- package/src/index.ts +14 -2
- package/src/setup-fixture.ts +15 -0
- package/src/types.ts +17 -0
- package/src/utils/getCurrentPosition.ts +4 -0
package/dist/ContentPage.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PropsWithChildren } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { BlockContent } from './Blocks';
|
|
1
3
|
import type { BlockDef, ContentPageDef, UniBlockProps } from './types';
|
|
2
4
|
interface BlockDecoratorProps<VNode> {
|
|
3
5
|
blockClassName: string;
|
|
@@ -9,8 +11,9 @@ interface BlockDecoratorProps<VNode> {
|
|
|
9
11
|
}
|
|
10
12
|
export declare type BlockDecorator<VNode = any> = (props: BlockDecoratorProps<VNode>, index?: number | string) => any;
|
|
11
13
|
export interface ContentPageProps extends UniBlockProps {
|
|
14
|
+
blocksRegistry: Record<string, (props: PropsWithChildren<UniBlockProps & BlockContent, any>, context?: any) => any>;
|
|
12
15
|
data: ContentPageDef;
|
|
13
16
|
blockDecorator?: BlockDecorator;
|
|
14
17
|
}
|
|
15
|
-
export declare const ContentPage: (props:
|
|
18
|
+
export declare const ContentPage: (props: PropsWithChildren<ContentPageProps, any>, context?: any) => any;
|
|
16
19
|
export {};
|
package/dist/ContentPage.js
CHANGED
|
@@ -2,18 +2,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.ContentPage = void 0;
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
const Blocks_1 = require("./Blocks"); // TODO Lazy load
|
|
6
5
|
const LikeControl_1 = require("./LikeControl");
|
|
7
6
|
const Placeholder_1 = require("./Placeholder");
|
|
8
7
|
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
9
|
-
exports.ContentPage = (0, uni_jsx_1.JSX)(({ className, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' },
|
|
8
|
+
exports.ContentPage = (0, uni_jsx_1.JSX)(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
10
9
|
return ((0, jsx_runtime_1.jsxs)("section", { className: "relative", "data-theme": colorPalette, children: [(0, jsx_runtime_1.jsx)("div", { className: `grid grid-cols-12 gap-1 ${style2className(pageStyle)} ${className}`, children: blocks?.length ? blocks.map(renderBlock) : null }), likeControl && ((0, jsx_runtime_1.jsx)("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: (0, jsx_runtime_1.jsx)(LikeControl_1.LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }) }))] }));
|
|
11
10
|
function renderBlock(block, i) {
|
|
12
11
|
const { type } = block;
|
|
13
|
-
if (!(type in
|
|
12
|
+
if (!(type in blocksRegistry)) {
|
|
14
13
|
console.warn(`No block with "${type}" is registered`);
|
|
15
14
|
}
|
|
16
|
-
const BlockComponent =
|
|
15
|
+
const BlockComponent = blocksRegistry[type] || Placeholder_1.Placeholder;
|
|
17
16
|
return blockDecorator({
|
|
18
17
|
blockClassName: style2className(block.style),
|
|
19
18
|
block,
|
package/dist/ContentPage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../src/ContentPage.tsx"],"names":[],"mapp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eAAe,CAAC,KAAK,CAAC,KAAK,CAAC;YAC5C,KAAK;YACL,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAChB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;gBACjD,OAAO,CACL,uBAAC,cAAc,IAEb,SAAS,EAAE,KAAK,CAAC,cAAc,EAC/B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,KACZ,OAAO,YAEV,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,IAN3C,GAAG,IAAI,IAAI,CAAC,EAAE,CAOJ,CAClB,CAAC;YACJ,CAAC;SACF,EACD,SAAS,CAAC,EAAE,CACb,CAAC;IACJ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,SAAS,eAAe,CAAC,KAAkC;IACzD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UniBlockProps } from '../types';
|
|
2
|
+
import type { FooterContent } from './Footer';
|
|
3
|
+
export interface FooterProps extends FooterContent, UniBlockProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const Footer: (props: import("@redneckz/uni-jsx").PropsWithChildren<FooterProps, any>, context?: any) => any;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.Footer = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const TextInformation_1 = require("./TextInformation");
|
|
6
|
+
exports.Footer = (0, uni_jsx_1.JSX)(({ className, context }) => ((0, jsx_runtime_1.jsx)("footer", { className: `${className} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`, children: (0, jsx_runtime_1.jsx)(TextInformation_1.TextInformation, { context: context }) })));
|
|
7
|
+
//# sourceMappingURL=Footer.mobile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.mobile.js","sourceRoot":"","sources":["../../src/Footer/Footer.mobile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAGxC,uDAAoD;AAIvC,QAAA,MAAM,GAAG,IAAA,aAAG,EAAc,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACjE,mCAAQ,SAAS,EAAE,GAAG,SAAS,mDAAmD,YAChF,uBAAC,iCAAe,IAAC,OAAO,EAAE,OAAO,GAAI,GAC9B,CACV,CAAC,CAAC"}
|
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,CAAC;IACtC,MAAM,aAAa,GAAG,QAAQ,EAAE,IAAI,CAAC,IAAA,iCAAe,EAAC,MAAM,CAAC,CAAC,CAAC;IAE9D,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACxC,uBAAC,iBAAO,IAEN,MAAM,EAAE,CAAC,KAAK,aAAa,KACvB,IAAA,iBAAO,EAAC,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,uBAAC,uBAAU,IAET,SAAS,EAAC,MAAM,EAChB,MAAM,EAAE,CAAC,KAAK,aAAa,KACvB,IAAA,iBAAO,EAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC,IAHvC,CAAC,CAAC,IAAI,CAIX,CACH,CAAC,CAAC;IAEH,OAAO,CACL,oCAAQ,SAAS,EAAE,4BAA4B,SAAS,IAAI,EAAE,EAAE,aAC9D,iCAAK,SAAS,EAAC,mBAAmB,aAChC,uBAAC,WAAI,IAAC,SAAS,EAAC,MAAM,GAAG,EACxB,OAAO,EACR,uBAAC,yCAAmB,IAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,SAAS,EACnB,eAAe,EAAE,eAAe,GAChC,IACE,EACN,gCAAK,SAAS,EAAC,8BAA8B,GAAG,EAChD,gCAAK,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 {};
|
|
@@ -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,13 @@
|
|
|
1
|
+
export declare const MobileBlocks: {
|
|
2
|
+
Header: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Header/Header").HeaderProps, any>, context?: any) => any;
|
|
3
|
+
Footer: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Footer/Footer.mobile").FooterProps, any>, context?: any) => any;
|
|
4
|
+
Placeholder: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Placeholder").PlaceholderProps, any>, context?: any) => any;
|
|
5
|
+
Tile: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Tile").TileProps, any>, context?: any) => any;
|
|
6
|
+
ProductTile: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./ProductTile").ProductTileProps, any>, context?: any) => any;
|
|
7
|
+
ProductBlock: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./ProductBlock").ProductBlockProps, any>, context?: any) => any;
|
|
8
|
+
StepsBlock: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./StepsBlock").StepsBlockProps, any>, context?: any) => any;
|
|
9
|
+
BenefitsBlock: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./BenefitsBlock").BenefitsBlockProps, any>, context?: any) => any;
|
|
10
|
+
ProductGallery: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./ProductGallery").ProductGalleryProps, any>, context?: any) => any;
|
|
11
|
+
ExchangeRateTile: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./ExchangeRateTile").ExchangeRateTileProps, any>, context?: any) => any;
|
|
12
|
+
MobileAppTile: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./MobileAppTile").MobileAppTileProps, any>, context?: any) => any;
|
|
13
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.MobileBlocks = void 0;
|
|
3
|
+
const BenefitsBlock_1 = require("./BenefitsBlock");
|
|
4
|
+
const ExchangeRateTile_1 = require("./ExchangeRateTile");
|
|
5
|
+
const Footer_mobile_1 = require("./Footer/Footer.mobile");
|
|
6
|
+
const index_1 = require("./Header/index");
|
|
7
|
+
const MobileAppTile_1 = require("./MobileAppTile");
|
|
8
|
+
const Placeholder_1 = require("./Placeholder");
|
|
9
|
+
const ProductBlock_1 = require("./ProductBlock");
|
|
10
|
+
const ProductGallery_1 = require("./ProductGallery");
|
|
11
|
+
const ProductTile_1 = require("./ProductTile");
|
|
12
|
+
const StepsBlock_1 = require("./StepsBlock");
|
|
13
|
+
const Tile_1 = require("./Tile");
|
|
14
|
+
exports.MobileBlocks = {
|
|
15
|
+
Header: index_1.Header,
|
|
16
|
+
Footer: Footer_mobile_1.Footer,
|
|
17
|
+
Placeholder: Placeholder_1.Placeholder,
|
|
18
|
+
Tile: Tile_1.Tile,
|
|
19
|
+
ProductTile: ProductTile_1.ProductTile,
|
|
20
|
+
ProductBlock: ProductBlock_1.ProductBlock,
|
|
21
|
+
StepsBlock: StepsBlock_1.StepsBlock,
|
|
22
|
+
BenefitsBlock: BenefitsBlock_1.BenefitsBlock,
|
|
23
|
+
ProductGallery: ProductGallery_1.ProductGallery,
|
|
24
|
+
ExchangeRateTile: ExchangeRateTile_1.ExchangeRateTile,
|
|
25
|
+
MobileAppTile: MobileAppTile_1.MobileAppTile,
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=MobileBlocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileBlocks.js","sourceRoot":"","sources":["../src/MobileBlocks.ts"],"names":[],"mappings":";;AAAA,mDAAgD;AAChD,yDAAsD;AACtD,0DAAgD;AAChD,0CAAwC;AACxC,mDAAgD;AAChD,+CAA4C;AAC5C,iDAA8C;AAC9C,qDAAkD;AAClD,+CAA4C;AAC5C,6CAA0C;AAC1C,iCAA8B;AAEjB,QAAA,YAAY,GAAG;IAC1B,MAAM,EAAN,cAAM;IACN,MAAM,EAAN,sBAAM;IACN,WAAW,EAAX,yBAAW;IACX,IAAI,EAAJ,WAAI;IACJ,WAAW,EAAX,yBAAW;IACX,YAAY,EAAZ,2BAAY;IACZ,UAAU,EAAV,uBAAU;IACV,aAAa,EAAb,6BAAa;IACb,cAAc,EAAd,+BAAc;IACd,gBAAgB,EAAhB,mCAAgB;IAChB,aAAa,EAAb,6BAAa;CACd,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,CAA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AC,CAAC,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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AnCD,sDAmCC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.ContentPageRepository = void 0;
|
|
2
|
+
exports.toMobilePage = exports.ContentPageRepository = void 0;
|
|
3
3
|
var ContentPageRepository_1 = require("./ContentPageRepository");
|
|
4
4
|
Object.defineProperty(exports, "ContentPageRepository", { enumerable: true, get: function () { return ContentPageRepository_1.ContentPageRepository; } });
|
|
5
|
+
var toMobilePage_1 = require("./toMobilePage");
|
|
6
|
+
Object.defineProperty(exports, "toMobilePage", { enumerable: true, get: function () { return toMobilePage_1.toMobilePage; } });
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/content-page-repository/index.ts"],"names":[],"mappings":";;AAAA,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/content-page-repository/index.ts"],"names":[],"mappings":";;AAAA,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,+CAA8C;AAArC,4GAAA,YAAY,OAAA"}
|
|
@@ -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/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export type { ProjectSettings } from './ProjectSettings';
|
|
2
2
|
export { projectSettings } from './ProjectSettings';
|
|
3
|
-
export
|
|
3
|
+
export { LikeAPI } from './api/LikeAPI';
|
|
4
|
+
export { DaDataAPI } from './api/DaDataAPI';
|
|
5
|
+
export type { BlockDef, UniBlockProps, ContentPageMeta, ContentPageDef, Img, ImgSource, Picture, } from './types';
|
|
4
6
|
export type { ContentPageContext, Router, LikeService, Search, HandlerDecorator, } from './ContentPageContext';
|
|
5
7
|
export { ContentPageHead } from './ContentPageHead';
|
|
6
8
|
export { ContentPage } from './ContentPage';
|
|
7
9
|
export { Blocks } from './Blocks';
|
|
8
|
-
export {
|
|
10
|
+
export type { BlockContent } from './Blocks';
|
|
11
|
+
export { MobileBlocks } from './MobileBlocks';
|
|
9
12
|
export * as url from './utils/url';
|
|
10
13
|
export { joinList } from './utils/joinList';
|
package/dist/index.js
CHANGED
|
@@ -22,17 +22,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
return result;
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.joinList = exports.url = exports.
|
|
25
|
+
exports.joinList = exports.url = exports.MobileBlocks = exports.Blocks = exports.ContentPage = exports.ContentPageHead = exports.DaDataAPI = exports.LikeAPI = exports.projectSettings = void 0;
|
|
26
26
|
var ProjectSettings_1 = require("./ProjectSettings");
|
|
27
27
|
Object.defineProperty(exports, "projectSettings", { enumerable: true, get: function () { return ProjectSettings_1.projectSettings; } });
|
|
28
|
+
var LikeAPI_1 = require("./api/LikeAPI");
|
|
29
|
+
Object.defineProperty(exports, "LikeAPI", { enumerable: true, get: function () { return LikeAPI_1.LikeAPI; } });
|
|
30
|
+
var DaDataAPI_1 = require("./api/DaDataAPI");
|
|
31
|
+
Object.defineProperty(exports, "DaDataAPI", { enumerable: true, get: function () { return DaDataAPI_1.DaDataAPI; } });
|
|
28
32
|
var ContentPageHead_1 = require("./ContentPageHead");
|
|
29
33
|
Object.defineProperty(exports, "ContentPageHead", { enumerable: true, get: function () { return ContentPageHead_1.ContentPageHead; } });
|
|
30
34
|
var ContentPage_1 = require("./ContentPage");
|
|
31
35
|
Object.defineProperty(exports, "ContentPage", { enumerable: true, get: function () { return ContentPage_1.ContentPage; } });
|
|
32
36
|
var Blocks_1 = require("./Blocks");
|
|
33
37
|
Object.defineProperty(exports, "Blocks", { enumerable: true, get: function () { return Blocks_1.Blocks; } });
|
|
34
|
-
var
|
|
35
|
-
Object.defineProperty(exports, "
|
|
38
|
+
var MobileBlocks_1 = require("./MobileBlocks");
|
|
39
|
+
Object.defineProperty(exports, "MobileBlocks", { enumerable: true, get: function () { return MobileBlocks_1.MobileBlocks; } });
|
|
36
40
|
exports.url = __importStar(require("./utils/url"));
|
|
37
41
|
var joinList_1 = require("./utils/joinList");
|
|
38
42
|
Object.defineProperty(exports, "joinList", { enumerable: true, get: function () { return joinList_1.joinList; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AAExB,yCAAwC;AAA/B,kGAAA,OAAO,OAAA;AAChB,6CAA4C;AAAnC,sGAAA,SAAS,OAAA;AAmBlB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AAEpB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AAEf,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAErB,mDAAmC;AACnC,6CAA4C;AAAnC,oGAAA,QAAQ,OAAA"}
|
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"}
|
package/lib/ContentPage.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PropsWithChildren } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { BlockContent } from './Blocks';
|
|
1
3
|
import type { BlockDef, ContentPageDef, UniBlockProps } from './types';
|
|
2
4
|
interface BlockDecoratorProps<VNode> {
|
|
3
5
|
blockClassName: string;
|
|
@@ -9,8 +11,9 @@ interface BlockDecoratorProps<VNode> {
|
|
|
9
11
|
}
|
|
10
12
|
export declare type BlockDecorator<VNode = any> = (props: BlockDecoratorProps<VNode>, index?: number | string) => any;
|
|
11
13
|
export interface ContentPageProps extends UniBlockProps {
|
|
14
|
+
blocksRegistry: Record<string, (props: PropsWithChildren<UniBlockProps & BlockContent, any>, context?: any) => any>;
|
|
12
15
|
data: ContentPageDef;
|
|
13
16
|
blockDecorator?: BlockDecorator;
|
|
14
17
|
}
|
|
15
|
-
export declare const ContentPage: (props:
|
|
18
|
+
export declare const ContentPage: (props: PropsWithChildren<ContentPageProps, any>, context?: any) => any;
|
|
16
19
|
export {};
|
package/lib/ContentPage.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
import { Blocks } from './Blocks.js'; // TODO Lazy load
|
|
4
3
|
import { LikeControl } from './LikeControl.js';
|
|
5
4
|
import { Placeholder } from './Placeholder.js';
|
|
6
5
|
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
7
|
-
export const ContentPage = JSX(({ className, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' },
|
|
6
|
+
export const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
|
|
8
7
|
return (_jsxs("section", { className: "relative", "data-theme": colorPalette, children: [_jsx("div", { className: `grid grid-cols-12 gap-1 ${style2className(pageStyle)} ${className}`, children: blocks?.length ? blocks.map(renderBlock) : null }), likeControl && (_jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: _jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }) }))] }));
|
|
9
8
|
function renderBlock(block, i) {
|
|
10
9
|
const { type } = block;
|
|
11
|
-
if (!(type in
|
|
10
|
+
if (!(type in blocksRegistry)) {
|
|
12
11
|
console.warn(`No block with "${type}" is registered`);
|
|
13
12
|
}
|
|
14
|
-
const BlockComponent =
|
|
13
|
+
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
15
14
|
return blockDecorator({
|
|
16
15
|
blockClassName: style2className(block.style),
|
|
17
16
|
block,
|
package/lib/ContentPage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../src/ContentPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../src/ContentPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAuB5C,MAAM,qBAAqB,GAAmB,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAClF,MAAM,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAC5B,CAAC,EACC,SAAS,EACT,OAAO,EACP,cAAc,EACd,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI,EAAE,EACpE,cAAc,GAAG,qBAAqB,GACvC,EAAE,EAAE;IACH,OAAO,CACL,mBAAS,SAAS,EAAC,UAAU,gBAAa,YAAY,aACpD,cAAK,SAAS,EAAE,2BAA2B,eAAe,CAAC,SAAS,CAAC,IAAI,SAAS,EAAE,YACjF,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,GAC5C,EACL,WAAW,IAAI,CACd,cAAK,SAAS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
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UniBlockProps } from '../types';
|
|
2
|
+
import type { FooterContent } from './Footer';
|
|
3
|
+
export interface FooterProps extends FooterContent, UniBlockProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const Footer: (props: import("@redneckz/uni-jsx").PropsWithChildren<FooterProps, any>, context?: any) => any;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { TextInformation } from './TextInformation.js';
|
|
4
|
+
export const Footer = JSX(({ className, context }) => (_jsx("footer", { className: `${className} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`, children: _jsx(TextInformation, { context: context }) })));
|
|
5
|
+
//# sourceMappingURL=Footer.mobile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.mobile.js","sourceRoot":"","sources":["../../src/Footer/Footer.mobile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAc,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACjE,iBAAQ,SAAS,EAAE,GAAG,SAAS,mDAAmD,YAChF,KAAC,eAAe,IAAC,OAAO,EAAE,OAAO,GAAI,GAC9B,CACV,CAAC,CAAC"}
|
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
|