@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.
Files changed (67) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/dist/components/StepsBlock/StepsBlockContent.d.ts +4 -1
  3. package/dist/content-page-repository/ContentPageRepository.d.ts +2 -0
  4. package/dist/content-page-repository/ContentPageRepository.js +6 -1
  5. package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
  6. package/dist/model/ButtonVersion.d.ts +1 -1
  7. package/dist/model/EmptyOptionType.d.ts +1 -1
  8. package/dist/model/IconVersion.d.ts +7 -0
  9. package/dist/types.d.ts +1 -1
  10. package/dist/ui-kit/Button/ButtonProps.d.ts +3 -0
  11. package/dist/ui-kit/InputRange/InputRangeProps.d.ts +2 -2
  12. package/dist/ui-kit/Tabs/TabsProps.d.ts +2 -2
  13. package/lib/components/StepsBlock/StepsBlockContent.d.ts +4 -1
  14. package/lib/content-page-repository/ContentPageRepository.d.ts +2 -0
  15. package/lib/content-page-repository/ContentPageRepository.js +6 -1
  16. package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
  17. package/lib/model/ButtonVersion.d.ts +1 -1
  18. package/lib/model/EmptyOptionType.d.ts +1 -1
  19. package/lib/model/IconVersion.d.ts +7 -0
  20. package/lib/types.d.ts +1 -1
  21. package/lib/ui-kit/Button/ButtonProps.d.ts +3 -0
  22. package/lib/ui-kit/InputRange/InputRangeProps.d.ts +2 -2
  23. package/lib/ui-kit/Tabs/TabsProps.d.ts +2 -2
  24. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +4 -1
  25. package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +2 -0
  26. package/mobile/dist/content-page-repository/ContentPageRepository.js +6 -1
  27. package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
  28. package/mobile/dist/model/ButtonVersion.d.ts +1 -1
  29. package/mobile/dist/model/EmptyOptionType.d.ts +1 -1
  30. package/mobile/dist/model/IconVersion.d.ts +7 -0
  31. package/mobile/dist/types.d.ts +1 -1
  32. package/mobile/dist/ui-kit/Button/ButtonProps.d.ts +3 -0
  33. package/mobile/dist/ui-kit/InputRange/InputRangeProps.d.ts +2 -2
  34. package/mobile/dist/ui-kit/Tabs/TabsProps.d.ts +2 -2
  35. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +4 -1
  36. package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +2 -0
  37. package/mobile/lib/content-page-repository/ContentPageRepository.js +6 -1
  38. package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
  39. package/mobile/lib/model/ButtonVersion.d.ts +1 -1
  40. package/mobile/lib/model/EmptyOptionType.d.ts +1 -1
  41. package/mobile/lib/model/IconVersion.d.ts +7 -0
  42. package/mobile/lib/types.d.ts +1 -1
  43. package/mobile/lib/ui-kit/Button/ButtonProps.d.ts +3 -0
  44. package/mobile/lib/ui-kit/InputRange/InputRangeProps.d.ts +2 -2
  45. package/mobile/lib/ui-kit/Tabs/TabsProps.d.ts +2 -2
  46. package/mobile/src/components/Calculator/Calculator.tsx +3 -3
  47. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +4 -1
  48. package/mobile/src/content-page-repository/ContentPageRepository.ts +7 -1
  49. package/mobile/src/model/ButtonVersion.ts +1 -1
  50. package/mobile/src/model/EmptyOptionType.ts +1 -1
  51. package/mobile/src/model/IconVersion.ts +7 -0
  52. package/mobile/src/types.ts +1 -1
  53. package/mobile/src/ui-kit/Button/ButtonProps.ts +3 -0
  54. package/mobile/src/ui-kit/InputRange/InputRangeProps.ts +2 -2
  55. package/mobile/src/ui-kit/Tabs/TabsProps.ts +2 -2
  56. package/package.json +1 -1
  57. package/src/components/Calculator/Calculator.tsx +3 -3
  58. package/src/components/StepsBlock/StepsBlockContent.ts +4 -1
  59. package/src/content-page-repository/ContentPageRepository.ts +7 -1
  60. package/src/icons/IconName.ts +4 -254
  61. package/src/model/ButtonVersion.ts +1 -1
  62. package/src/model/EmptyOptionType.ts +1 -1
  63. package/src/model/IconVersion.ts +7 -0
  64. package/src/types.ts +1 -1
  65. package/src/ui-kit/Button/ButtonProps.ts +3 -0
  66. package/src/ui-kit/InputRange/InputRangeProps.ts +2 -2
  67. package/src/ui-kit/Tabs/TabsProps.ts +2 -2
@@ -1 +1,8 @@
1
+ /**
2
+ * @title Цвет иконки
3
+ * @enumNames [
4
+ * "Нормальный",
5
+ * "Белый"
6
+ * ]
7
+ */
1
8
  export declare type IconVersion = 'normal' | 'white';
package/lib/types.d.ts CHANGED
@@ -61,4 +61,4 @@ export interface DaDataSuggestion<T> {
61
61
  export interface DaDataAddress {
62
62
  city?: string | null;
63
63
  }
64
- export declare type FuncSetNumber = (value: number) => void;
64
+ export declare type FuncReturnVoid<Input = unknown> = (value: Input) => void;
@@ -11,6 +11,9 @@ export interface ButtonAdditionalProps {
11
11
  ariaLabel?: string;
12
12
  onClick?: (ev: MouseEvent) => any;
13
13
  }
14
+ /**
15
+ * @title Кнопка
16
+ */
14
17
  export interface ButtonProps extends ButtonAdditionalProps, LinkProps {
15
18
  /**
16
19
  * @title Текст
@@ -1,4 +1,4 @@
1
- import type { FuncSetNumber } from '../../types';
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?: FuncSetNumber;
10
+ onChange?: FuncReturnVoid<number>;
11
11
  }
@@ -1,5 +1,5 @@
1
1
  import type { Picture } from '../../model/Picture';
2
- import { FuncSetNumber } from '../../types';
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 = FuncSetNumber;
13
+ export declare type TabClickHandler = FuncReturnVoid<number>;
14
14
  export interface TabsProps {
15
15
  tabs?: Tab[];
16
16
  currentTabIndex: number;
@@ -21,7 +21,10 @@ export interface StepsBlockContent {
21
21
  title?: string;
22
22
  /** @title Описание */
23
23
  description?: string;
24
- /** @title Линии */
24
+ /**
25
+ * @title Линии
26
+ * @default true
27
+ */
25
28
  showLines?: boolean;
26
29
  /**
27
30
  * @title Шаги
@@ -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 find(`${contentDir}/**/*.page.json`);
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,IAAI,CAAC,GAAG,UAAU,iBAAiB,CAAC,CAAC;QAC7D,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;QACzD,OAAO,SAAS,CAAC,MAAM,CACrB,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YACpB,GAAG,MAAM;YACT,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;SACjB,CAAC,EACF,EAAE,CACH,CAAC;IACJ,CAAC;IAED,KAAK,UAAU,kBAAkB;QAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,qBAAqB,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,UAAU,wBAAwB,CAAC,cAAuB;QAC7D,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,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,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,qBAAqB;QACrB,kBAAkB;QAClB,oBAAoB;QACpB,wBAAwB;QACxB,YAAY;KACb,CAAC;AACJ,CAAC;AApDD,sDAoDC"}
1
+ {"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,gDAAwB;AAGx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AK,UAAU,wBAAwB,CAAC,cAAuB;QAC7D,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,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,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"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @title Цвет кнопки
3
3
  * @default primary
4
- * @enumNames ["Основная", "Второстепенная"]
4
+ * @enumNames ["Основная", "Второстепенная", "Ссылка"]
5
5
  */
6
6
  export declare type ButtonVersion = 'primary' | 'secondary' | 'link';
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Выберите блок
2
+ * @title Выберите блок
3
3
  */
4
4
  export declare type EmptyOption = null;
@@ -1 +1,8 @@
1
+ /**
2
+ * @title Цвет иконки
3
+ * @enumNames [
4
+ * "Нормальный",
5
+ * "Белый"
6
+ * ]
7
+ */
1
8
  export declare type IconVersion = 'normal' | 'white';
@@ -61,4 +61,4 @@ export interface DaDataSuggestion<T> {
61
61
  export interface DaDataAddress {
62
62
  city?: string | null;
63
63
  }
64
- export declare type FuncSetNumber = (value: number) => void;
64
+ export declare type FuncReturnVoid<Input = unknown> = (value: Input) => void;
@@ -11,6 +11,9 @@ export interface ButtonAdditionalProps {
11
11
  ariaLabel?: string;
12
12
  onClick?: (ev: MouseEvent) => any;
13
13
  }
14
+ /**
15
+ * @title Кнопка
16
+ */
14
17
  export interface ButtonProps extends ButtonAdditionalProps, LinkProps {
15
18
  /**
16
19
  * @title Текст
@@ -1,4 +1,4 @@
1
- import type { FuncSetNumber } from '../../types';
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?: FuncSetNumber;
10
+ onChange?: FuncReturnVoid<number>;
11
11
  }
@@ -1,5 +1,5 @@
1
1
  import type { Picture } from '../../model/Picture';
2
- import { FuncSetNumber } from '../../types';
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 = FuncSetNumber;
13
+ export declare type TabClickHandler = FuncReturnVoid<number>;
14
14
  export interface TabsProps {
15
15
  tabs?: Tab[];
16
16
  currentTabIndex: number;
@@ -21,7 +21,10 @@ export interface StepsBlockContent {
21
21
  title?: string;
22
22
  /** @title Описание */
23
23
  description?: string;
24
- /** @title Линии */
24
+ /**
25
+ * @title Линии
26
+ * @default true
27
+ */
25
28
  showLines?: boolean;
26
29
  /**
27
30
  * @title Шаги
@@ -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 find(`${contentDir}/**/*.page.json`);
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;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ACtD,CAAC;IAED,KAAK,UAAU,wBAAwB,CAAC,cAAuB;QAC7D,MAAM,KAAK,GAAG,MAAM,kBAAkB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,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,qBAAqB;QACrB,kBAAkB;QAClB,oBAAoB;QACpB,wBAAwB;QACxB,YAAY;KACb,CAAC;AACJ,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;AAGxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC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AAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,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"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @title Цвет кнопки
3
3
  * @default primary
4
- * @enumNames ["Основная", "Второстепенная"]
4
+ * @enumNames ["Основная", "Второстепенная", "Ссылка"]
5
5
  */
6
6
  export declare type ButtonVersion = 'primary' | 'secondary' | 'link';
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Выберите блок
2
+ * @title Выберите блок
3
3
  */
4
4
  export declare type EmptyOption = null;
@@ -1 +1,8 @@
1
+ /**
2
+ * @title Цвет иконки
3
+ * @enumNames [
4
+ * "Нормальный",
5
+ * "Белый"
6
+ * ]
7
+ */
1
8
  export declare type IconVersion = 'normal' | 'white';
@@ -61,4 +61,4 @@ export interface DaDataSuggestion<T> {
61
61
  export interface DaDataAddress {
62
62
  city?: string | null;
63
63
  }
64
- export declare type FuncSetNumber = (value: number) => void;
64
+ export declare type FuncReturnVoid<Input = unknown> = (value: Input) => void;
@@ -11,6 +11,9 @@ export interface ButtonAdditionalProps {
11
11
  ariaLabel?: string;
12
12
  onClick?: (ev: MouseEvent) => any;
13
13
  }
14
+ /**
15
+ * @title Кнопка
16
+ */
14
17
  export interface ButtonProps extends ButtonAdditionalProps, LinkProps {
15
18
  /**
16
19
  * @title Текст
@@ -1,4 +1,4 @@
1
- import type { FuncSetNumber } from '../../types';
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?: FuncSetNumber;
10
+ onChange?: FuncReturnVoid<number>;
11
11
  }
@@ -1,5 +1,5 @@
1
1
  import type { Picture } from '../../model/Picture';
2
- import { FuncSetNumber } from '../../types';
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 = FuncSetNumber;
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: (i: number) => void;
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: (ev: MouseEvent) => void;
22
+ onClick: FuncReturnVoid<MouseEvent>;
23
23
  };
24
24
 
25
25
  const arrowBtnStyle =
@@ -23,7 +23,10 @@ export interface StepsBlockContent {
23
23
  title?: string;
24
24
  /** @title Описание */
25
25
  description?: string; // TODO: mobile content
26
- /** @title Линии */
26
+ /**
27
+ * @title Линии
28
+ * @default true
29
+ */
27
30
  showLines?: boolean;
28
31
  /**
29
32
  * @title Шаги
@@ -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 find(`${contentDir}/**/*.page.json`);
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
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @title Цвет кнопки
3
3
  * @default primary
4
- * @enumNames ["Основная", "Второстепенная"]
4
+ * @enumNames ["Основная", "Второстепенная", "Ссылка"]
5
5
  */
6
6
  export type ButtonVersion = 'primary' | 'secondary' | 'link';
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Выберите блок
2
+ * @title Выберите блок
3
3
  */
4
4
  export type EmptyOption = null;
@@ -1 +1,8 @@
1
+ /**
2
+ * @title Цвет иконки
3
+ * @enumNames [
4
+ * "Нормальный",
5
+ * "Белый"
6
+ * ]
7
+ */
1
8
  export type IconVersion = 'normal' | 'white';
@@ -73,4 +73,4 @@ export interface DaDataAddress {
73
73
  city?: string | null;
74
74
  }
75
75
 
76
- export type FuncSetNumber = (value: number) => void;
76
+ export type FuncReturnVoid<Input = unknown> = (value: Input) => void;
@@ -13,6 +13,9 @@ export interface ButtonAdditionalProps {
13
13
  onClick?: (ev: MouseEvent) => any;
14
14
  }
15
15
 
16
+ /**
17
+ * @title Кнопка
18
+ */
16
19
  export interface ButtonProps extends ButtonAdditionalProps, LinkProps {
17
20
  /**
18
21
  * @title Текст
@@ -1,4 +1,4 @@
1
- import type { FuncSetNumber } from '../../types';
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?: FuncSetNumber;
11
+ onChange?: FuncReturnVoid<number>;
12
12
  }
@@ -1,5 +1,5 @@
1
1
  import type { Picture } from '../../model/Picture';
2
- import { FuncSetNumber } from '../../types';
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 = FuncSetNumber;
15
+ export type TabClickHandler = FuncReturnVoid<number>;
16
16
 
17
17
  export interface TabsProps {
18
18
  tabs?: Tab[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.3.66",
3
+ "version": "0.3.68",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -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: (i: number) => void;
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: (ev: MouseEvent) => void;
22
+ onClick: FuncReturnVoid<MouseEvent>;
23
23
  };
24
24
 
25
25
  const arrowBtnStyle =
@@ -23,7 +23,10 @@ export interface StepsBlockContent {
23
23
  title?: string;
24
24
  /** @title Описание */
25
25
  description?: string; // TODO: mobile content
26
- /** @title Линии */
26
+ /**
27
+ * @title Линии
28
+ * @default true
29
+ */
27
30
  showLines?: boolean;
28
31
  /**
29
32
  * @title Шаги
@@ -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 find(`${contentDir}/**/*.page.json`);
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
  }