@redneckz/wildless-cms-uni-blocks 0.3.66 → 0.3.68
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/bundle/blocks.schema.json +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +4 -1
- package/dist/content-page-repository/ContentPageRepository.d.ts +2 -0
- package/dist/content-page-repository/ContentPageRepository.js +6 -1
- package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/dist/model/ButtonVersion.d.ts +1 -1
- package/dist/model/EmptyOptionType.d.ts +1 -1
- package/dist/model/IconVersion.d.ts +7 -0
- package/dist/types.d.ts +1 -1
- package/dist/ui-kit/Button/ButtonProps.d.ts +3 -0
- package/dist/ui-kit/InputRange/InputRangeProps.d.ts +2 -2
- package/dist/ui-kit/Tabs/TabsProps.d.ts +2 -2
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +4 -1
- package/lib/content-page-repository/ContentPageRepository.d.ts +2 -0
- package/lib/content-page-repository/ContentPageRepository.js +6 -1
- package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/lib/model/ButtonVersion.d.ts +1 -1
- package/lib/model/EmptyOptionType.d.ts +1 -1
- package/lib/model/IconVersion.d.ts +7 -0
- package/lib/types.d.ts +1 -1
- package/lib/ui-kit/Button/ButtonProps.d.ts +3 -0
- package/lib/ui-kit/InputRange/InputRangeProps.d.ts +2 -2
- package/lib/ui-kit/Tabs/TabsProps.d.ts +2 -2
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +4 -1
- package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +2 -0
- package/mobile/dist/content-page-repository/ContentPageRepository.js +6 -1
- package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/dist/model/ButtonVersion.d.ts +1 -1
- package/mobile/dist/model/EmptyOptionType.d.ts +1 -1
- package/mobile/dist/model/IconVersion.d.ts +7 -0
- package/mobile/dist/types.d.ts +1 -1
- package/mobile/dist/ui-kit/Button/ButtonProps.d.ts +3 -0
- package/mobile/dist/ui-kit/InputRange/InputRangeProps.d.ts +2 -2
- package/mobile/dist/ui-kit/Tabs/TabsProps.d.ts +2 -2
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +4 -1
- package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +2 -0
- package/mobile/lib/content-page-repository/ContentPageRepository.js +6 -1
- package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/lib/model/ButtonVersion.d.ts +1 -1
- package/mobile/lib/model/EmptyOptionType.d.ts +1 -1
- package/mobile/lib/model/IconVersion.d.ts +7 -0
- package/mobile/lib/types.d.ts +1 -1
- package/mobile/lib/ui-kit/Button/ButtonProps.d.ts +3 -0
- package/mobile/lib/ui-kit/InputRange/InputRangeProps.d.ts +2 -2
- package/mobile/lib/ui-kit/Tabs/TabsProps.d.ts +2 -2
- package/mobile/src/components/Calculator/Calculator.tsx +3 -3
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +4 -1
- package/mobile/src/content-page-repository/ContentPageRepository.ts +7 -1
- package/mobile/src/model/ButtonVersion.ts +1 -1
- package/mobile/src/model/EmptyOptionType.ts +1 -1
- package/mobile/src/model/IconVersion.ts +7 -0
- package/mobile/src/types.ts +1 -1
- package/mobile/src/ui-kit/Button/ButtonProps.ts +3 -0
- package/mobile/src/ui-kit/InputRange/InputRangeProps.ts +2 -2
- package/mobile/src/ui-kit/Tabs/TabsProps.ts +2 -2
- package/package.json +1 -1
- package/src/components/Calculator/Calculator.tsx +3 -3
- package/src/components/StepsBlock/StepsBlockContent.ts +4 -1
- package/src/content-page-repository/ContentPageRepository.ts +7 -1
- package/src/icons/IconName.ts +4 -254
- package/src/model/ButtonVersion.ts +1 -1
- package/src/model/EmptyOptionType.ts +1 -1
- package/src/model/IconVersion.ts +7 -0
- package/src/types.ts +1 -1
- package/src/ui-kit/Button/ButtonProps.ts +3 -0
- package/src/ui-kit/InputRange/InputRangeProps.ts +2 -2
- package/src/ui-kit/Tabs/TabsProps.ts +2 -2
package/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FuncReturnVoid } from '../../types';
|
|
2
2
|
export interface InputRangeProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
items?: string[];
|
|
@@ -7,5 +7,5 @@ export interface InputRangeProps {
|
|
|
7
7
|
step?: number;
|
|
8
8
|
value?: number;
|
|
9
9
|
title?: string;
|
|
10
|
-
onChange?:
|
|
10
|
+
onChange?: FuncReturnVoid<number>;
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Picture } from '../../model/Picture';
|
|
2
|
-
import {
|
|
2
|
+
import { FuncReturnVoid } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* @title Вкладка
|
|
5
5
|
*/
|
|
@@ -10,7 +10,7 @@ export interface Tab {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
icon?: Picture;
|
|
12
12
|
}
|
|
13
|
-
export declare type TabClickHandler =
|
|
13
|
+
export declare type TabClickHandler = FuncReturnVoid<number>;
|
|
14
14
|
export interface TabsProps {
|
|
15
15
|
tabs?: Tab[];
|
|
16
16
|
currentTabIndex: number;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ContentPageDef } from '../types';
|
|
2
2
|
import type { TransformationOptions } from './TransformationOptions';
|
|
3
3
|
export declare function ContentPageRepository({ contentDir, publicDir, }?: Partial<TransformationOptions>): {
|
|
4
|
+
listAllContentPages: () => Promise<string[]>;
|
|
4
5
|
getAllContentPagesMap: () => Promise<Record<string, ContentPageDef>>;
|
|
5
6
|
getAllContentPages: () => Promise<ContentPageDef[]>;
|
|
6
7
|
getContentPageBySlug: (slug: string) => Promise<ContentPageDef | undefined>;
|
|
7
8
|
getSecondaryContentPages: (customPageType?: string) => Promise<ContentPageDef[]>;
|
|
8
9
|
getIndexPage: () => Promise<ContentPageDef | undefined>;
|
|
10
|
+
readPage: (filePath: string) => Promise<ContentPageDef>;
|
|
9
11
|
};
|
|
@@ -12,8 +12,11 @@ const bySlug = (slug) => (content) => content.slug === slug;
|
|
|
12
12
|
const byCustomPageType = (type) => (content) => type ? content._customPageType === type : !content._customPageType;
|
|
13
13
|
const not = (predicate) => (_) => !predicate(_);
|
|
14
14
|
function ContentPageRepository({ contentDir = 'content', publicDir = 'public', } = {}) {
|
|
15
|
+
function listAllContentPages() {
|
|
16
|
+
return find(`${contentDir}/**/*.page.json`);
|
|
17
|
+
}
|
|
15
18
|
async function getAllContentPagesMap() {
|
|
16
|
-
const pagePaths = await
|
|
19
|
+
const pagePaths = await listAllContentPages();
|
|
17
20
|
const pages = await Promise.all(pagePaths.map(readPage));
|
|
18
21
|
return pagePaths.reduce((result, path, i) => ({
|
|
19
22
|
...result,
|
|
@@ -45,11 +48,13 @@ function ContentPageRepository({ contentDir = 'content', publicDir = 'public', }
|
|
|
45
48
|
return cache[filePath];
|
|
46
49
|
}
|
|
47
50
|
return {
|
|
51
|
+
listAllContentPages,
|
|
48
52
|
getAllContentPagesMap,
|
|
49
53
|
getAllContentPages,
|
|
50
54
|
getContentPageBySlug,
|
|
51
55
|
getSecondaryContentPages,
|
|
52
56
|
getIndexPage,
|
|
57
|
+
readPage,
|
|
53
58
|
};
|
|
54
59
|
}
|
|
55
60
|
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;AAGxB,iEAA8D;AAE9D,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,CAAC;AAElC,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,OAAuB,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;AACpF,MAAM,gBAAgB,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,CAAC,OAAuB,EAAE,EAAE,CACtE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;AAErE,MAAM,GAAG,GACP,CAAM,SAA8B,EAAE,EAAE,CACxC,CAAC,CAAM,EAAE,EAAE,CACT,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAElB,SAAgB,qBAAqB,CAAC,EACpC,UAAU,GAAG,SAAS,EACtB,SAAS,GAAG,QAAQ,MACc,EAAE;IACpC,KAAK,UAAU,qBAAqB;QAClC,MAAM,SAAS,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,gDAAwB;AAGxB,iEAA8D;AAE9D,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,IAAI,GAAG,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,CAAC;AAElC,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,OAAuB,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;AACpF,MAAM,gBAAgB,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,CAAC,OAAuB,EAAE,EAAE,CACtE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;AAErE,MAAM,GAAG,GACP,CAAM,SAA8B,EAAE,EAAE,CACxC,CAAC,CAAM,EAAE,EAAE,CACT,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAElB,SAAgB,qBAAqB,CAAC,EACpC,UAAU,GAAG,SAAS,EACtB,SAAS,GAAG,QAA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,EAAE;YACxB,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,IAAA,2CAAoB,EAAC,QAAQ,EAAE;gBACrD,UAAU;gBACV,SAAS;aACV,CAAC,CAAC;SACJ;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED,OAAO;QACL,mBAAmB;QACnB,qBAAqB;QACrB,kBAAkB;QAClB,oBAAoB;QACpB,wBAAwB;QACxB,YAAY;QACZ,QAAQ;KACT,CAAC;AACJ,CAAC;AA1DD,sDA0DC"}
|
package/mobile/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FuncReturnVoid } from '../../types';
|
|
2
2
|
export interface InputRangeProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
items?: string[];
|
|
@@ -7,5 +7,5 @@ export interface InputRangeProps {
|
|
|
7
7
|
step?: number;
|
|
8
8
|
value?: number;
|
|
9
9
|
title?: string;
|
|
10
|
-
onChange?:
|
|
10
|
+
onChange?: FuncReturnVoid<number>;
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Picture } from '../../model/Picture';
|
|
2
|
-
import {
|
|
2
|
+
import { FuncReturnVoid } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* @title Вкладка
|
|
5
5
|
*/
|
|
@@ -10,7 +10,7 @@ export interface Tab {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
icon?: Picture;
|
|
12
12
|
}
|
|
13
|
-
export declare type TabClickHandler =
|
|
13
|
+
export declare type TabClickHandler = FuncReturnVoid<number>;
|
|
14
14
|
export interface TabsProps {
|
|
15
15
|
tabs?: Tab[];
|
|
16
16
|
currentTabIndex: number;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ContentPageDef } from '../types';
|
|
2
2
|
import type { TransformationOptions } from './TransformationOptions';
|
|
3
3
|
export declare function ContentPageRepository({ contentDir, publicDir, }?: Partial<TransformationOptions>): {
|
|
4
|
+
listAllContentPages: () => Promise<string[]>;
|
|
4
5
|
getAllContentPagesMap: () => Promise<Record<string, ContentPageDef>>;
|
|
5
6
|
getAllContentPages: () => Promise<ContentPageDef[]>;
|
|
6
7
|
getContentPageBySlug: (slug: string) => Promise<ContentPageDef | undefined>;
|
|
7
8
|
getSecondaryContentPages: (customPageType?: string) => Promise<ContentPageDef[]>;
|
|
8
9
|
getIndexPage: () => Promise<ContentPageDef | undefined>;
|
|
10
|
+
readPage: (filePath: string) => Promise<ContentPageDef>;
|
|
9
11
|
};
|
|
@@ -7,8 +7,11 @@ const bySlug = (slug) => (content) => content.slug === slug;
|
|
|
7
7
|
const byCustomPageType = (type) => (content) => type ? content._customPageType === type : !content._customPageType;
|
|
8
8
|
const not = (predicate) => (_) => !predicate(_);
|
|
9
9
|
export function ContentPageRepository({ contentDir = 'content', publicDir = 'public', } = {}) {
|
|
10
|
+
function listAllContentPages() {
|
|
11
|
+
return find(`${contentDir}/**/*.page.json`);
|
|
12
|
+
}
|
|
10
13
|
async function getAllContentPagesMap() {
|
|
11
|
-
const pagePaths = await
|
|
14
|
+
const pagePaths = await listAllContentPages();
|
|
12
15
|
const pages = await Promise.all(pagePaths.map(readPage));
|
|
13
16
|
return pagePaths.reduce((result, path, i) => ({
|
|
14
17
|
...result,
|
|
@@ -40,11 +43,13 @@ export function ContentPageRepository({ contentDir = 'content', publicDir = 'pub
|
|
|
40
43
|
return cache[filePath];
|
|
41
44
|
}
|
|
42
45
|
return {
|
|
46
|
+
listAllContentPages,
|
|
43
47
|
getAllContentPagesMap,
|
|
44
48
|
getAllContentPages,
|
|
45
49
|
getContentPageBySlug,
|
|
46
50
|
getSecondaryContentPages,
|
|
47
51
|
getIndexPage,
|
|
52
|
+
readPage,
|
|
48
53
|
};
|
|
49
54
|
}
|
|
50
55
|
//# 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;AAGxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,OAAuB,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;AACpF,MAAM,gBAAgB,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,CAAC,OAAuB,EAAE,EAAE,CACtE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;AAErE,MAAM,GAAG,GACP,CAAM,SAA8B,EAAE,EAAE,CACxC,CAAC,CAAM,EAAE,EAAE,CACT,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAElB,MAAM,UAAU,qBAAqB,CAAC,EACpC,UAAU,GAAG,SAAS,EACtB,SAAS,GAAG,QAAQ,MACc,EAAE;IACpC,KAAK,UAAU,qBAAqB;QAClC,MAAM,SAAS,GAAG,MAAM,
|
|
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;AAGxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,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AC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED,KAAK,UAAU,oBAAoB,CAAC,IAAY;QAC9C,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,UAAU,YAAY;QACzB,OAAO,MAAM,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACrD,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,mBAAmB;QACnB,qBAAqB;QACrB,kBAAkB;QAClB,oBAAoB;QACpB,wBAAwB;QACxB,YAAY;QACZ,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/mobile/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FuncReturnVoid } from '../../types';
|
|
2
2
|
export interface InputRangeProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
items?: string[];
|
|
@@ -7,5 +7,5 @@ export interface InputRangeProps {
|
|
|
7
7
|
step?: number;
|
|
8
8
|
value?: number;
|
|
9
9
|
title?: string;
|
|
10
|
-
onChange?:
|
|
10
|
+
onChange?: FuncReturnVoid<number>;
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Picture } from '../../model/Picture';
|
|
2
|
-
import {
|
|
2
|
+
import { FuncReturnVoid } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* @title Вкладка
|
|
5
5
|
*/
|
|
@@ -10,7 +10,7 @@ export interface Tab {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
icon?: Picture;
|
|
12
12
|
}
|
|
13
|
-
export declare type TabClickHandler =
|
|
13
|
+
export declare type TabClickHandler = FuncReturnVoid<number>;
|
|
14
14
|
export interface TabsProps {
|
|
15
15
|
tabs?: Tab[];
|
|
16
16
|
currentTabIndex: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { UniBlockProps } from '../../types';
|
|
2
|
+
import type { FuncReturnVoid, UniBlockProps } from '../../types';
|
|
3
3
|
import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
5
|
import type { CalculatorBlockDef, CalculatorContent } from './CalculatorContent';
|
|
@@ -12,14 +12,14 @@ type TabsProps = {
|
|
|
12
12
|
tabsShift: number;
|
|
13
13
|
tabsNav: CalculatorNav[];
|
|
14
14
|
activeSlideIndex: number;
|
|
15
|
-
setActiveSlideIndex:
|
|
15
|
+
setActiveSlideIndex: FuncReturnVoid<number>;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
type NavButtonProps = {
|
|
19
19
|
tab: CalculatorNav;
|
|
20
20
|
i: number;
|
|
21
21
|
activeSlideIndex: number;
|
|
22
|
-
onClick:
|
|
22
|
+
onClick: FuncReturnVoid<MouseEvent>;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const arrowBtnStyle =
|
|
@@ -20,8 +20,12 @@ export function ContentPageRepository({
|
|
|
20
20
|
contentDir = 'content',
|
|
21
21
|
publicDir = 'public',
|
|
22
22
|
}: Partial<TransformationOptions> = {}) {
|
|
23
|
+
function listAllContentPages(): Promise<string[]> {
|
|
24
|
+
return find(`${contentDir}/**/*.page.json`);
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
async function getAllContentPagesMap(): Promise<Record<string, ContentPageDef>> {
|
|
24
|
-
const pagePaths = await
|
|
28
|
+
const pagePaths = await listAllContentPages();
|
|
25
29
|
const pages = await Promise.all(pagePaths.map(readPage));
|
|
26
30
|
return pagePaths.reduce(
|
|
27
31
|
(result, path, i) => ({
|
|
@@ -62,10 +66,12 @@ export function ContentPageRepository({
|
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
return {
|
|
69
|
+
listAllContentPages,
|
|
65
70
|
getAllContentPagesMap,
|
|
66
71
|
getAllContentPages,
|
|
67
72
|
getContentPageBySlug,
|
|
68
73
|
getSecondaryContentPages,
|
|
69
74
|
getIndexPage,
|
|
75
|
+
readPage,
|
|
70
76
|
};
|
|
71
77
|
}
|
package/mobile/src/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FuncReturnVoid } from '../../types';
|
|
2
2
|
|
|
3
3
|
export interface InputRangeProps {
|
|
4
4
|
className?: string;
|
|
@@ -8,5 +8,5 @@ export interface InputRangeProps {
|
|
|
8
8
|
step?: number;
|
|
9
9
|
value?: number;
|
|
10
10
|
title?: string;
|
|
11
|
-
onChange?:
|
|
11
|
+
onChange?: FuncReturnVoid<number>;
|
|
12
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Picture } from '../../model/Picture';
|
|
2
|
-
import {
|
|
2
|
+
import { FuncReturnVoid } from '../../types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @title Вкладка
|
|
@@ -12,7 +12,7 @@ export interface Tab {
|
|
|
12
12
|
icon?: Picture;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export type TabClickHandler =
|
|
15
|
+
export type TabClickHandler = FuncReturnVoid<number>;
|
|
16
16
|
|
|
17
17
|
export interface TabsProps {
|
|
18
18
|
tabs?: Tab[];
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { UniBlockProps } from '../../types';
|
|
2
|
+
import type { FuncReturnVoid, UniBlockProps } from '../../types';
|
|
3
3
|
import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
5
|
import type { CalculatorBlockDef, CalculatorContent } from './CalculatorContent';
|
|
@@ -12,14 +12,14 @@ type TabsProps = {
|
|
|
12
12
|
tabsShift: number;
|
|
13
13
|
tabsNav: CalculatorNav[];
|
|
14
14
|
activeSlideIndex: number;
|
|
15
|
-
setActiveSlideIndex:
|
|
15
|
+
setActiveSlideIndex: FuncReturnVoid<number>;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
type NavButtonProps = {
|
|
19
19
|
tab: CalculatorNav;
|
|
20
20
|
i: number;
|
|
21
21
|
activeSlideIndex: number;
|
|
22
|
-
onClick:
|
|
22
|
+
onClick: FuncReturnVoid<MouseEvent>;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const arrowBtnStyle =
|
|
@@ -20,8 +20,12 @@ export function ContentPageRepository({
|
|
|
20
20
|
contentDir = 'content',
|
|
21
21
|
publicDir = 'public',
|
|
22
22
|
}: Partial<TransformationOptions> = {}) {
|
|
23
|
+
function listAllContentPages(): Promise<string[]> {
|
|
24
|
+
return find(`${contentDir}/**/*.page.json`);
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
async function getAllContentPagesMap(): Promise<Record<string, ContentPageDef>> {
|
|
24
|
-
const pagePaths = await
|
|
28
|
+
const pagePaths = await listAllContentPages();
|
|
25
29
|
const pages = await Promise.all(pagePaths.map(readPage));
|
|
26
30
|
return pagePaths.reduce(
|
|
27
31
|
(result, path, i) => ({
|
|
@@ -62,10 +66,12 @@ export function ContentPageRepository({
|
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
return {
|
|
69
|
+
listAllContentPages,
|
|
65
70
|
getAllContentPagesMap,
|
|
66
71
|
getAllContentPages,
|
|
67
72
|
getContentPageBySlug,
|
|
68
73
|
getSecondaryContentPages,
|
|
69
74
|
getIndexPage,
|
|
75
|
+
readPage,
|
|
70
76
|
};
|
|
71
77
|
}
|