@redneckz/wildless-cms-uni-blocks 0.12.7 → 0.12.8
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/bin/migration-scripts/0.12.8.js +45 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +21 -11
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Header/HeaderContent.d.ts +1 -13
- package/bundle/components/Header/HeaderTop.d.ts +1 -3
- package/bundle/components/LinkDocs/LinkDocItem.d.ts +6 -0
- package/bundle/components/LinkDocs/LinkDocsContent.d.ts +30 -6
- package/bundle/components/LinkDocs/linkIconStyle.d.ts +1 -0
- package/bundle/components/LinkDocs/linkIconStyle.mobile.d.ts +1 -0
- package/bundle/content-page-repository/transformDocument.d.ts +3 -0
- package/bundle/hooks/useRouter.d.ts +1 -0
- package/bundle/icons/IconName.d.ts +2 -2
- package/bundle/model/Attachment.d.ts +4 -0
- package/dist/components/Header/Header.mobile.js +2 -2
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/Header/HeaderContent.d.ts +1 -13
- package/dist/components/Header/HeaderTop.d.ts +1 -3
- package/dist/components/Header/HeaderTop.js +10 -5
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocItem.d.ts +6 -0
- package/dist/components/LinkDocs/LinkDocItem.js +20 -0
- package/dist/components/LinkDocs/LinkDocItem.js.map +1 -0
- package/dist/components/LinkDocs/LinkDocs.js +16 -4
- package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +30 -6
- package/dist/components/LinkDocs/linkDocsContentExample.js +20 -8
- package/dist/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/dist/components/LinkDocs/linkIconStyle.d.ts +1 -0
- package/dist/components/LinkDocs/linkIconStyle.js +4 -0
- package/dist/components/LinkDocs/linkIconStyle.js.map +1 -0
- package/dist/components/LinkDocs/linkIconStyle.mobile.d.ts +1 -0
- package/dist/components/LinkDocs/linkIconStyle.mobile.js +4 -0
- package/dist/components/LinkDocs/linkIconStyle.mobile.js.map +1 -0
- package/dist/content-page-repository/transformContentPage.js +15 -5
- package/dist/content-page-repository/transformContentPage.js.map +1 -1
- package/dist/content-page-repository/transformDocument.d.ts +3 -0
- package/{mobile/dist/content-page-repository/transformDocumentLink.js → dist/content-page-repository/transformDocument.js} +11 -11
- package/dist/content-page-repository/transformDocument.js.map +1 -0
- package/dist/hooks/useRouter.d.ts +1 -0
- package/dist/hooks/useRouter.js +3 -0
- package/dist/hooks/useRouter.js.map +1 -1
- package/dist/icons/IconName.d.ts +2 -2
- package/dist/icons/IconName.js +1 -1
- package/dist/icons/IconName.js.map +1 -1
- package/dist/model/Attachment.d.ts +4 -0
- package/dist/model/Attachment.js +2 -0
- package/dist/model/Attachment.js.map +1 -0
- package/dist/setup-fixture.js +4 -1
- package/dist/setup-fixture.js.map +1 -1
- package/dist/ui-kit/Logo/Logo.js +2 -3
- package/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/dist/ui-kit/TopItem/TopItem.js +1 -0
- package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Header/Header.fixture.mobile.d.ts +0 -2
- package/lib/components/Header/Header.mobile.js +2 -2
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/Header/HeaderContent.d.ts +1 -13
- package/lib/components/Header/HeaderTop.d.ts +1 -3
- package/lib/components/Header/HeaderTop.js +10 -5
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocItem.d.ts +6 -0
- package/{mobile/lib/components/LinkDocs/LinkDocsListItem.js → lib/components/LinkDocs/LinkDocItem.js} +2 -5
- package/lib/components/LinkDocs/LinkDocItem.js.map +1 -0
- package/lib/components/LinkDocs/LinkDocs.js +16 -4
- package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +30 -6
- package/lib/components/LinkDocs/linkDocsContentExample.js +20 -8
- package/lib/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/lib/components/LinkDocs/linkIconStyle.d.ts +1 -0
- package/lib/components/LinkDocs/linkIconStyle.js +2 -0
- package/lib/components/LinkDocs/linkIconStyle.js.map +1 -0
- package/lib/components/LinkDocs/linkIconStyle.mobile.d.ts +1 -0
- package/lib/components/LinkDocs/linkIconStyle.mobile.js +2 -0
- package/lib/components/LinkDocs/linkIconStyle.mobile.js.map +1 -0
- package/lib/content-page-repository/transformContentPage.js +15 -5
- package/lib/content-page-repository/transformContentPage.js.map +1 -1
- package/lib/content-page-repository/transformDocument.d.ts +3 -0
- package/{mobile/lib/content-page-repository/transformDocumentLink.js → lib/content-page-repository/transformDocument.js} +9 -9
- package/lib/content-page-repository/transformDocument.js.map +1 -0
- package/lib/hooks/useRouter.d.ts +1 -0
- package/lib/hooks/useRouter.js +3 -0
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/icons/IconName.d.ts +2 -2
- package/lib/icons/IconName.js +1 -1
- package/lib/icons/IconName.js.map +1 -1
- package/lib/model/Attachment.d.ts +4 -0
- package/lib/model/Attachment.js +2 -0
- package/lib/model/Attachment.js.map +1 -0
- package/lib/setup-fixture.js +4 -1
- package/lib/setup-fixture.js.map +1 -1
- package/lib/ui-kit/Logo/Logo.js +2 -3
- package/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/lib/ui-kit/TopItem/TopItem.js +1 -0
- package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +31 -13
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Header/HeaderContent.d.ts +1 -13
- package/mobile/bundle/components/Header/HeaderTop.d.ts +1 -3
- package/mobile/bundle/components/LinkDocs/LinkDocItem.d.ts +6 -0
- package/mobile/bundle/components/LinkDocs/LinkDocsContent.d.ts +30 -6
- package/mobile/bundle/components/LinkDocs/linkIconStyle.d.ts +1 -0
- package/mobile/bundle/content-page-repository/transformDocument.d.ts +3 -0
- package/mobile/bundle/hooks/useRouter.d.ts +1 -0
- package/mobile/bundle/icons/IconName.d.ts +2 -2
- package/mobile/bundle/model/Attachment.d.ts +4 -0
- package/mobile/dist/components/Header/Header.js +2 -2
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/Header/HeaderContent.d.ts +1 -13
- package/mobile/dist/components/Header/HeaderTop.d.ts +1 -3
- package/mobile/dist/components/Header/HeaderTop.js +10 -5
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocItem.d.ts +6 -0
- package/mobile/dist/components/LinkDocs/LinkDocItem.js +20 -0
- package/mobile/dist/components/LinkDocs/LinkDocItem.js.map +1 -0
- package/mobile/dist/components/LinkDocs/LinkDocs.js +19 -2
- package/mobile/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +30 -6
- package/mobile/dist/components/LinkDocs/linkDocsContentExample.js +20 -8
- package/mobile/dist/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/mobile/dist/components/LinkDocs/linkIconStyle.d.ts +1 -0
- package/mobile/dist/components/LinkDocs/linkIconStyle.js +4 -0
- package/mobile/dist/components/LinkDocs/linkIconStyle.js.map +1 -0
- package/mobile/dist/content-page-repository/transformContentPage.js +15 -5
- package/mobile/dist/content-page-repository/transformContentPage.js.map +1 -1
- package/mobile/dist/content-page-repository/transformDocument.d.ts +3 -0
- package/{dist/content-page-repository/transformDocumentLink.js → mobile/dist/content-page-repository/transformDocument.js} +11 -11
- package/mobile/dist/content-page-repository/transformDocument.js.map +1 -0
- package/mobile/dist/hooks/useRouter.d.ts +1 -0
- package/mobile/dist/hooks/useRouter.js +3 -0
- package/mobile/dist/hooks/useRouter.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +2 -2
- package/mobile/dist/icons/IconName.js +1 -1
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/model/Attachment.d.ts +4 -0
- package/mobile/dist/model/Attachment.js +2 -0
- package/mobile/dist/model/Attachment.js.map +1 -0
- package/mobile/dist/setup-fixture.js +4 -1
- package/mobile/dist/setup-fixture.js.map +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js +1 -0
- package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Header/Header.js +2 -2
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/Header/HeaderContent.d.ts +1 -13
- package/mobile/lib/components/Header/HeaderTop.d.ts +1 -3
- package/mobile/lib/components/Header/HeaderTop.js +10 -5
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocItem.d.ts +6 -0
- package/{lib/components/LinkDocs/LinkDocsListItem.js → mobile/lib/components/LinkDocs/LinkDocItem.js} +2 -5
- package/mobile/lib/components/LinkDocs/LinkDocItem.js.map +1 -0
- package/mobile/lib/components/LinkDocs/LinkDocs.js +19 -2
- package/mobile/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +30 -6
- package/mobile/lib/components/LinkDocs/linkDocsContentExample.js +20 -8
- package/mobile/lib/components/LinkDocs/linkDocsContentExample.js.map +1 -1
- package/mobile/lib/components/LinkDocs/linkIconStyle.d.ts +1 -0
- package/mobile/lib/components/LinkDocs/linkIconStyle.js +2 -0
- package/mobile/lib/components/LinkDocs/linkIconStyle.js.map +1 -0
- package/mobile/lib/content-page-repository/transformContentPage.js +15 -5
- package/mobile/lib/content-page-repository/transformContentPage.js.map +1 -1
- package/mobile/lib/content-page-repository/transformDocument.d.ts +3 -0
- package/{lib/content-page-repository/transformDocumentLink.js → mobile/lib/content-page-repository/transformDocument.js} +9 -9
- package/mobile/lib/content-page-repository/transformDocument.js.map +1 -0
- package/mobile/lib/hooks/useRouter.d.ts +1 -0
- package/mobile/lib/hooks/useRouter.js +3 -0
- package/mobile/lib/hooks/useRouter.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +2 -2
- package/mobile/lib/icons/IconName.js +1 -1
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/model/Attachment.d.ts +4 -0
- package/mobile/lib/model/Attachment.js +2 -0
- package/mobile/lib/model/Attachment.js.map +1 -0
- package/mobile/lib/setup-fixture.js +4 -1
- package/mobile/lib/setup-fixture.js.map +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js +1 -0
- package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/src/components/Header/Header.tsx +1 -7
- package/mobile/src/components/Header/HeaderContent.ts +1 -15
- package/mobile/src/components/Header/HeaderTop.tsx +41 -50
- package/mobile/src/components/LinkDocs/LinkDocItem.tsx +44 -0
- package/mobile/src/components/LinkDocs/LinkDocs.example.json +4 -0
- package/mobile/src/components/LinkDocs/LinkDocs.tsx +65 -36
- package/mobile/src/components/LinkDocs/LinkDocs.ui.json +8 -1
- package/mobile/src/components/LinkDocs/LinkDocsContent.ts +34 -6
- package/mobile/src/components/LinkDocs/linkDocsContentExample.ts +20 -8
- package/mobile/src/components/LinkDocs/linkIconStyle.ts +1 -0
- package/mobile/src/content-page-repository/transformContentPage.ts +17 -7
- package/{src/content-page-repository/transformDocumentLink.ts → mobile/src/content-page-repository/transformDocument.ts} +11 -11
- package/mobile/src/hooks/useRouter.ts +4 -0
- package/mobile/src/icons/ChevronLeft.svg +1 -1
- package/mobile/src/icons/IconName.ts +2 -2
- package/mobile/src/model/Attachment.ts +4 -0
- package/mobile/src/setup-fixture.ts +4 -1
- package/mobile/src/ui-kit/TopItem/TopItem.tsx +1 -0
- package/package.json +1 -1
- package/src/components/Header/Header.fixture.mobile.tsx +0 -5
- package/src/components/Header/Header.mobile.tsx +1 -7
- package/src/components/Header/HeaderContent.ts +1 -15
- package/src/components/Header/HeaderTop.tsx +41 -50
- package/src/components/HorizontalLayout/HorizontalLayout.fixture.tsx +3 -3
- package/src/components/LinkDocs/LinkDocItem.tsx +44 -0
- package/src/components/LinkDocs/LinkDocs.example.json +4 -0
- package/src/components/LinkDocs/LinkDocs.tsx +58 -36
- package/src/components/LinkDocs/LinkDocs.ui.json +8 -1
- package/src/components/LinkDocs/LinkDocsContent.ts +34 -6
- package/src/components/LinkDocs/linkDocsContentExample.ts +20 -8
- package/src/components/LinkDocs/linkIconStyle.mobile.ts +1 -0
- package/src/components/LinkDocs/linkIconStyle.ts +1 -0
- package/src/components/VerticalLayout/VerticalLayout.fixture.mobile.tsx +4 -4
- package/src/components/VerticalLayout/VerticalLayout.fixture.tsx +3 -3
- package/src/content-page-repository/transformContentPage.ts +17 -7
- package/{mobile/src/content-page-repository/transformDocumentLink.ts → src/content-page-repository/transformDocument.ts} +11 -11
- package/src/hooks/useRouter.ts +4 -0
- package/src/icons/ChevronLeft.svg +1 -1
- package/src/icons/IconName.ts +386 -6
- package/src/model/Attachment.ts +4 -0
- package/src/setup-fixture.ts +4 -1
- package/src/ui-kit/Logo/Logo.tsx +13 -14
- package/src/ui-kit/TopItem/TopItem.tsx +1 -0
- package/tailwind.config.cjs +1 -1
- package/bundle/components/LinkDocs/LinkDocs.mobile.d.ts +0 -5
- package/bundle/components/LinkDocs/LinkDocsListItem.d.ts +0 -7
- package/bundle/content-page-repository/transformDocumentLink.d.ts +0 -3
- package/dist/components/LinkDocs/LinkDocs.mobile.d.ts +0 -5
- package/dist/components/LinkDocs/LinkDocs.mobile.js +0 -10
- package/dist/components/LinkDocs/LinkDocs.mobile.js.map +0 -1
- package/dist/components/LinkDocs/LinkDocsListItem.d.ts +0 -7
- package/dist/components/LinkDocs/LinkDocsListItem.js +0 -23
- package/dist/components/LinkDocs/LinkDocsListItem.js.map +0 -1
- package/dist/content-page-repository/transformDocumentLink.d.ts +0 -3
- package/dist/content-page-repository/transformDocumentLink.js.map +0 -1
- package/lib/components/LinkDocs/LinkDocs.mobile.d.ts +0 -5
- package/lib/components/LinkDocs/LinkDocs.mobile.js +0 -8
- package/lib/components/LinkDocs/LinkDocs.mobile.js.map +0 -1
- package/lib/components/LinkDocs/LinkDocsListItem.d.ts +0 -7
- package/lib/components/LinkDocs/LinkDocsListItem.js.map +0 -1
- package/lib/content-page-repository/transformDocumentLink.d.ts +0 -3
- package/lib/content-page-repository/transformDocumentLink.js.map +0 -1
- package/mobile/bundle/components/LinkDocs/LinkDocsListItem.d.ts +0 -7
- package/mobile/bundle/content-page-repository/transformDocumentLink.d.ts +0 -3
- package/mobile/dist/components/LinkDocs/LinkDocsListItem.d.ts +0 -7
- package/mobile/dist/components/LinkDocs/LinkDocsListItem.js +0 -23
- package/mobile/dist/components/LinkDocs/LinkDocsListItem.js.map +0 -1
- package/mobile/dist/content-page-repository/transformDocumentLink.d.ts +0 -3
- package/mobile/dist/content-page-repository/transformDocumentLink.js.map +0 -1
- package/mobile/lib/components/LinkDocs/LinkDocsListItem.d.ts +0 -7
- package/mobile/lib/components/LinkDocs/LinkDocsListItem.js.map +0 -1
- package/mobile/lib/content-page-repository/transformDocumentLink.d.ts +0 -3
- package/mobile/lib/content-page-repository/transformDocumentLink.js.map +0 -1
- package/mobile/src/components/LinkDocs/LinkDocsListItem.tsx +0 -49
- package/src/components/LinkDocs/LinkDocs.mobile.tsx +0 -52
- package/src/components/LinkDocs/LinkDocsListItem.tsx +0 -49
|
@@ -21,22 +21,10 @@ export declare type Logo = ImageContent & {
|
|
|
21
21
|
/** @title Текст логотипа */
|
|
22
22
|
title?: string;
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
25
|
-
* @title Мобильный тип шапки
|
|
26
|
-
* @enumNames ["Не выбрано", "Название", "Кнопка возврата"]
|
|
27
|
-
*/
|
|
28
|
-
export declare type MobileHeaderType = 'none' | 'withTitle' | 'backwardButton';
|
|
29
|
-
export interface MobileHeaderProps {
|
|
30
|
-
mobileHeaderType?: MobileHeaderType;
|
|
31
|
-
/** @title Название (мобильная версия) */
|
|
32
|
-
mobileTitle?: string;
|
|
33
|
-
/** @title Кнопка возврата (мобильная версия) */
|
|
34
|
-
mobileBackwardButtonTitle?: string;
|
|
35
|
-
}
|
|
36
24
|
/**
|
|
37
25
|
* @title Шапка (для мобильных горизонтальная прокрутка shift+mouseScroll)
|
|
38
26
|
*/
|
|
39
|
-
export interface HeaderContent
|
|
27
|
+
export interface HeaderContent {
|
|
40
28
|
/** @hidden */
|
|
41
29
|
showSubMenu?: boolean;
|
|
42
30
|
/** @hidden */
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
2
2
|
import type { LogoType } from '../../model/LogoType';
|
|
3
3
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
4
|
-
|
|
5
|
-
export interface HeaderTopProps extends MobileHeaderProps {
|
|
4
|
+
export interface HeaderTopProps {
|
|
6
5
|
bgColor?: BgColorVersion;
|
|
7
6
|
logo?: LogoType;
|
|
8
7
|
internetBankUrl?: string;
|
|
9
8
|
version?: BlockVersion;
|
|
10
|
-
mobileHeaderType?: MobileHeaderType;
|
|
11
9
|
}
|
|
12
10
|
export declare const HeaderTop: import("@redneckz/uni-jsx").UNIComponent<HeaderTopProps, any, any>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VNode } from '../../model/VNode';
|
|
2
|
+
import type { LinkDoc } from './LinkDocsContent';
|
|
3
|
+
export interface LinkDocItemProps extends LinkDoc {
|
|
4
|
+
icon?: VNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const LinkDocItem: import("@redneckz/uni-jsx").UNIComponent<LinkDocItemProps, any, any>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Attachment } from '../../model/Attachment';
|
|
2
|
+
import { EmptyOption } from '../../model/EmptyOptionType';
|
|
1
3
|
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
2
4
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
3
|
-
import type { LinkProps } from '../../model/LinkProps';
|
|
5
|
+
import type { LinkProps, Target } from '../../model/LinkProps';
|
|
4
6
|
import type { IconProps } from '../../model/Picture';
|
|
5
7
|
import type { TextAlign } from '../../ui-kit/Text/TextProps';
|
|
6
8
|
/**
|
|
@@ -11,19 +13,41 @@ import type { TextAlign } from '../../ui-kit/Text/TextProps';
|
|
|
11
13
|
* ]
|
|
12
14
|
*/
|
|
13
15
|
export declare type LinkColumnsMode = 'single' | 'double';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
export interface LinkDoc extends LinkProps {
|
|
17
|
+
/** @title размер файла */
|
|
18
|
+
fileSize?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface AttachmentDoc {
|
|
21
|
+
/** @title Текст */
|
|
22
|
+
text?: string;
|
|
23
|
+
/** @title */
|
|
24
|
+
attachment?: Attachment;
|
|
18
25
|
/** @title размер файла */
|
|
19
26
|
fileSize?: string;
|
|
27
|
+
/** @default "" */
|
|
28
|
+
target?: Target;
|
|
20
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* @title Ссылка на документ
|
|
32
|
+
* @default {"docType": "Link"}
|
|
33
|
+
*/
|
|
34
|
+
export declare type LinkDocDef = LinkDoc & {
|
|
35
|
+
docType: 'Link';
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @title Файл
|
|
39
|
+
* @default {"docType": "Attachment"}
|
|
40
|
+
*/
|
|
41
|
+
export declare type AttachmentDocDef = AttachmentDoc & {
|
|
42
|
+
docType: 'Attachment';
|
|
43
|
+
};
|
|
44
|
+
export declare type DocBlockDef = EmptyOption | LinkDocDef | AttachmentDocDef;
|
|
21
45
|
/**
|
|
22
46
|
* @title Список документов
|
|
23
47
|
*/
|
|
24
48
|
export declare type LinkDocsContent = UniBlockContent & HeadlineCommonProps & IconProps & {
|
|
25
49
|
/** @title Список */
|
|
26
|
-
documents?:
|
|
50
|
+
documents?: DocBlockDef[];
|
|
27
51
|
columnsMode?: LinkColumnsMode;
|
|
28
52
|
/** @title Выравнивание */
|
|
29
53
|
align?: TextAlign;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const linkIconStyle = "min-w-6 min-h-6";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const linkIconStyle = "min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md";
|
|
@@ -8,6 +8,7 @@ export interface Router {
|
|
|
8
8
|
basePath?: string;
|
|
9
9
|
push: (url: string, as?: string, options?: RouterOptions) => void;
|
|
10
10
|
replace: (url: string, as?: string, options?: RouterOptions) => void;
|
|
11
|
+
back: () => void;
|
|
11
12
|
}
|
|
12
13
|
export declare function useRouter(): Router;
|
|
13
14
|
export declare namespace useRouter {
|
|
@@ -142,7 +142,7 @@ export declare enum IconTitleMap {
|
|
|
142
142
|
CardWithGemIcon = "\u041A\u0430\u0440\u0442\u0430 \u0441 \u0434\u0440\u0430\u0433\u043E\u0446\u0435\u043D\u043D\u043E\u0441\u0442\u044F\u043C\u0438",
|
|
143
143
|
CarIcon = "\u041C\u0430\u0448\u0438\u043D\u0430",
|
|
144
144
|
ChartSquareIcon = "\u0414\u0435\u043D\u044C\u0433\u0438 \u0432\u043D\u0443\u0442\u0440\u0438 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430",
|
|
145
|
-
ChevronLeft = "\u0421\u0442\u0440\u0435\u043B\u043A\u0430 '\u0412\
|
|
145
|
+
ChevronLeft = "\u0421\u0442\u0440\u0435\u043B\u043A\u0430 '\u0412\u043B\u0435\u0432\u043E'",
|
|
146
146
|
CinemaIcon = "\u041A\u0438\u043D\u043E\u0442\u0435\u0430\u0442\u0440",
|
|
147
147
|
ClientIcon = "\u041A\u043B\u0438\u0435\u043D\u0442",
|
|
148
148
|
ClockIcon = "\u0427\u0430\u0441\u044B",
|
|
@@ -232,7 +232,7 @@ export declare enum IconTitleMap {
|
|
|
232
232
|
* @title Иконка
|
|
233
233
|
* @enumNames [
|
|
234
234
|
* "",
|
|
235
|
-
* 'Деньги', 'Самолёт', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка сплошная \'Вниз\'', 'Стрелка \'Влево\'', 'Стрелка \'Вправо\'', 'Стрелка \'Вверх-право\'', 'Стрелка \'Вверх\'', 'Стрелка сплошная \'Вверх\'', 'Банкомат', 'Сумка', 'Банк', 'Белорусский флаг', 'BriefcaseIcon', 'Здание с деревом', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Машина2', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Деньги внутри кошелька', 'Стрелка \'
|
|
235
|
+
* 'Деньги', 'Самолёт', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка сплошная \'Вниз\'', 'Стрелка \'Влево\'', 'Стрелка \'Вправо\'', 'Стрелка \'Вверх-право\'', 'Стрелка \'Вверх\'', 'Стрелка сплошная \'Вверх\'', 'Банкомат', 'Сумка', 'Банк', 'Белорусский флаг', 'BriefcaseIcon', 'Здание с деревом', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Машина2', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Деньги внутри кошелька', 'Стрелка \'Влево\'', 'Кинотеатр', 'Клиент', 'Часы', 'Крестик', 'Кресло', 'Кредитные карты', 'Скидка', 'Скачать документ', 'Документ', 'Документ (одноцветный)', 'Документы', 'Документы-2', 'Документ с текстом', 'Доллар', 'Зелёная \'галочка\' в круге', 'Зелёная \'галочка\'', 'Земля', 'Пустой кошелёк с возвратом', 'Пустой кошелёк', 'Евро', 'FullScreenIcon', 'Геолокация', 'Зеркало', 'Глобус', 'Gps', 'Сетка (белая)', 'HeadphonesIcon', 'Сердце', 'Лого «Huawei»', 'Диаграмма роста', 'Скидка', 'JCB', 'Logo', 'Лупа', 'E-mail', 'Маркер карты', 'Маркер карты РСХБ', 'MasterCard', 'Лого Метро', 'Минус', 'МИР', 'Деньги', 'Денежное страхование', 'Купюры', 'Монитор и мобильный', 'Новый документ', 'Офис', 'Лого «Одноклассники»', 'Пачка бумаги А4', 'Бизнес', 'Проценты (круг.)', 'Проценты', 'PercentIcon', 'Персональная карта', 'Телефон', 'Лого «PlayMarket»', 'Плюс', 'Щит', 'Профиль, 2 персоны', 'Профиль', 'Тыква', 'Ошибка', 'Ок', 'Рубль (круг.)', 'Сейф', 'Безопасность', 'Подписанные документы', 'Маленькие часы', 'Звук', 'Ящик с замочной скважиной', 'Лого «Telegram»', 'UnionPay', 'UserGeoLocationIcon', 'Пользователь в рамке', 'Пользователь', 'Visa', 'Лого «VK»', 'Пополнение карты', 'Кошелёк с плюсом', 'Кошелёк', 'Кошелёк с деньгами', 'Добавить продукт', 'Лого «Youtube»'
|
|
236
236
|
* ]
|
|
237
237
|
*/
|
|
238
238
|
export declare type IconName = '' | 'ActualBalanceIcon' | 'AirPlaneIcon' | 'AppleIcon' | 'ArrowDownIcon' | 'ArrowDownSolidIcon' | 'ArrowLeftIcon' | 'ArrowRightIcon' | 'ArrowTopRightIcon' | 'ArrowUpIcon' | 'ArrowUpSolidIcon' | 'AtmIcon' | 'BagIcon' | 'BankIcon' | 'BelarusianFlag' | 'BriefcaseIcon' | 'BuildingIcon' | 'BurgerIcon' | 'Calendar2Icon' | 'CalendarCircleIcon' | 'CalendarIcon' | 'CalendarTickIcon' | 'Car2Icon' | 'CardIcon' | 'CardPosIcon' | 'CardTickIcon' | 'CardWithGemIcon' | 'CarIcon' | 'ChartSquareIcon' | 'ChevronLeft' | 'CinemaIcon' | 'ClientIcon' | 'ClockIcon' | 'CloseIcon' | 'ComfortableCompIcon' | 'CreditCardsIcon' | 'DiscountShapeIcon' | 'DocDownloadIcon' | 'DocIcon' | 'DocIconMonoColor' | 'DocsIcon' | 'DocumentText2Icon' | 'DocumentTextIcon' | 'DollarIcon' | 'DoneIcon' | 'DoneSimpleIcon' | 'EarthIcon' | 'EmptyWalletChangeIcon' | 'EmptyWalletIcon' | 'EuroIcon' | 'FullScreenIcon' | 'GeolocationIcon' | 'GlassIcon' | 'GlobalIcon' | 'GpsIcon' | 'GridIcon' | 'HeadphonesIcon' | 'HeartIcon' | 'HuaweiIcon' | 'InterestGrowthIcon' | 'InterestIcon' | 'JCBIcon' | 'LogoIcon' | 'LoupeIcon' | 'MailIcon' | 'MapMarkerClusterIcon' | 'MapMarkerSingleIcon' | 'MasterCardIcon' | 'MetroIcon' | 'MinusIcon' | 'MirIcon' | 'MoneyIcon' | 'MoneyInsuranceIcon' | 'MoneysIcon' | 'MonitorMobileIcon' | 'NewDocIcon' | 'OfficeIcon' | 'OkIcon' | 'PackA4Icon' | 'PassSendIcon' | 'PercentageRoundIcon' | 'PercentageSquareIcon' | 'PercentIcon' | 'PersonalCardIcon' | 'PhoneIcon' | 'PlayMarketIcon' | 'PlusIcon' | 'PowerIcon' | 'Profile2UserIcon' | 'ProfileIcon' | 'PumpkinIcon' | 'ResponceFailIcon' | 'ResponceOKIcon' | 'RoundRubleIcon' | 'SafeIcon' | 'ShieldTickIcon' | 'SignDocsIcon' | 'SmallClockIcon' | 'SoundIcon' | 'StrongBoxIcon' | 'TelegramIcon' | 'UnionPayIcon' | 'UserGeoLocationIcon' | 'UserSquareIcon' | 'UserTickIcon' | 'VisaIcon' | 'VKIcon' | 'WalletAdd2Icon' | 'WalletAddIcon' | 'WalletIcon' | 'WalletWithMoneyIcon' | 'WateringCanIcon' | 'YoutubeIcon';
|
|
@@ -10,9 +10,9 @@ const BG_COLOR_TO_BLOCK_VERSION = {
|
|
|
10
10
|
'bg-white': 'primary',
|
|
11
11
|
transparent: 'transparent',
|
|
12
12
|
};
|
|
13
|
-
exports.Header = (0, uni_jsx_1.JSX)(({ bgColor = 'bg-white', version = BG_COLOR_TO_BLOCK_VERSION[bgColor],
|
|
13
|
+
exports.Header = (0, uni_jsx_1.JSX)(({ bgColor = 'bg-white', version = BG_COLOR_TO_BLOCK_VERSION[bgColor], ...rest }) => {
|
|
14
14
|
const fallback = rest.options?.page?.fallback;
|
|
15
15
|
const { logo, internetBankUrl } = (0, useSWRResource_1.useSWRResource)(ProjectSettings_1.projectSettings.SITEMAP || 'sitemap', fallback);
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { tag: "header", defaultPadding: "", version: version, ...rest, children: (0, jsx_runtime_1.jsx)("div", { className: "container px-4 py-1 box-border", children: (0, jsx_runtime_1.jsx)(HeaderTop_1.HeaderTop, { bgColor: bgColor, logo: logo, internetBankUrl: internetBankUrl, version: version,
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { tag: "header", defaultPadding: "", version: version, ...rest, children: (0, jsx_runtime_1.jsx)("div", { className: "container px-4 py-1 box-border", children: (0, jsx_runtime_1.jsx)(HeaderTop_1.HeaderTop, { bgColor: bgColor, logo: logo, internetBankUrl: internetBankUrl, version: version, ...rest }) }) }));
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=Header.mobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.mobile.js","sourceRoot":"","sources":["../../../src/components/Header/Header.mobile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,+DAA4D;AAK5D,2DAAwD;AAExD,4DAAyD;AAEzD,2CAAwC;AAIxC,MAAM,yBAAyB,GAAyC;IACtE,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,aAAa;CAC3B,CAAC;AAEW,QAAA,MAAM,GAAG,IAAA,aAAG,EACvB,CAAC,
|
|
1
|
+
{"version":3,"file":"Header.mobile.js","sourceRoot":"","sources":["../../../src/components/Header/Header.mobile.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,+DAA4D;AAK5D,2DAAwD;AAExD,4DAAyD;AAEzD,2CAAwC;AAIxC,MAAM,yBAAyB,GAAyC;IACtE,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,aAAa;CAC3B,CAAC;AAEW,QAAA,MAAM,GAAG,IAAA,aAAG,EACvB,CAAC,EAAE,OAAO,GAAG,UAAU,EAAE,OAAO,GAAG,yBAAyB,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IAClF,MAAM,QAAQ,GAAyB,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC;IACpE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,IAAA,+BAAc,EAC9C,iCAAe,CAAC,OAAO,IAAI,SAAS,EACpC,QAAQ,CACT,CAAC;IAEF,OAAO,CACL,uBAAC,2BAAY,IAAC,GAAG,EAAC,QAAQ,EAAC,cAAc,EAAC,EAAE,EAAC,OAAO,EAAE,OAAO,KAAM,IAAI,YACrE,gCAAK,SAAS,EAAC,gCAAgC,YAC7C,uBAAC,qBAAS,IACR,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,OAAO,KACZ,IAAI,GACR,GACE,GACO,CAChB,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -21,22 +21,10 @@ export declare type Logo = ImageContent & {
|
|
|
21
21
|
/** @title Текст логотипа */
|
|
22
22
|
title?: string;
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
25
|
-
* @title Мобильный тип шапки
|
|
26
|
-
* @enumNames ["Не выбрано", "Название", "Кнопка возврата"]
|
|
27
|
-
*/
|
|
28
|
-
export declare type MobileHeaderType = 'none' | 'withTitle' | 'backwardButton';
|
|
29
|
-
export interface MobileHeaderProps {
|
|
30
|
-
mobileHeaderType?: MobileHeaderType;
|
|
31
|
-
/** @title Название (мобильная версия) */
|
|
32
|
-
mobileTitle?: string;
|
|
33
|
-
/** @title Кнопка возврата (мобильная версия) */
|
|
34
|
-
mobileBackwardButtonTitle?: string;
|
|
35
|
-
}
|
|
36
24
|
/**
|
|
37
25
|
* @title Шапка (для мобильных горизонтальная прокрутка shift+mouseScroll)
|
|
38
26
|
*/
|
|
39
|
-
export interface HeaderContent
|
|
27
|
+
export interface HeaderContent {
|
|
40
28
|
/** @hidden */
|
|
41
29
|
showSubMenu?: boolean;
|
|
42
30
|
/** @hidden */
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
2
2
|
import type { LogoType } from '../../model/LogoType';
|
|
3
3
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
4
|
-
|
|
5
|
-
export interface HeaderTopProps extends MobileHeaderProps {
|
|
4
|
+
export interface HeaderTopProps {
|
|
6
5
|
bgColor?: BgColorVersion;
|
|
7
6
|
logo?: LogoType;
|
|
8
7
|
internetBankUrl?: string;
|
|
9
8
|
version?: BlockVersion;
|
|
10
|
-
mobileHeaderType?: MobileHeaderType;
|
|
11
9
|
}
|
|
12
10
|
export declare const HeaderTop: import("@redneckz/uni-jsx").UNIComponent<HeaderTopProps, any, any>;
|
|
@@ -6,16 +6,21 @@ const Logo_1 = require("../../ui-kit/Logo/Logo");
|
|
|
6
6
|
const Button_1 = require("../../ui-kit/Button/Button");
|
|
7
7
|
const style_1 = require("../../utils/style");
|
|
8
8
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
9
|
+
const useRouter_1 = require("../../hooks/useRouter");
|
|
10
|
+
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
9
11
|
const BUTTON_STYLE = {
|
|
10
12
|
default: 'px-5 bg-main-divider rounded hover:text-primary-main',
|
|
11
13
|
transparent: 'text-white hover:text-primary-hover',
|
|
12
14
|
};
|
|
13
|
-
exports.HeaderTop = (0, uni_jsx_1.JSX)(({ bgColor, logo, internetBankUrl, version
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
exports.HeaderTop = (0, uni_jsx_1.JSX)(({ bgColor, logo, internetBankUrl, version }) => {
|
|
16
|
+
const router = (0, useRouter_1.useRouter)();
|
|
17
|
+
const isRootLocation = router.pathname === '/';
|
|
18
|
+
const onClick = (0, hooks_1.useCallback)(() => {
|
|
19
|
+
router.back();
|
|
20
|
+
}, []);
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between w-full", children: [isRootLocation ? ((0, jsx_runtime_1.jsx)(Logo_1.Logo, { bgColor: bgColor, logo: logo })) : ((0, jsx_runtime_1.jsxs)(Button_1.Button, { className: "flex items-center text-l", ariaLabel: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430\u0437\u0430\u0434", onClick: onClick, children: [(0, jsx_runtime_1.jsx)(Img_1.Img, { className: "w-6 h-6", image: {
|
|
17
22
|
icon: 'ChevronLeft',
|
|
18
23
|
iconVersion: 'black',
|
|
19
|
-
} }),
|
|
24
|
+
} }), "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430\u0437\u0430\u0434"] })), internetBankUrl ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { href: internetBankUrl, ariaLabel: "\u0412\u043E\u0439\u0442\u0438", target: "_blank", className: (0, style_1.style)('p-3 my-1 text-s whitespace-nowrap text-primary-main hover:text-primary-hover', BUTTON_STYLE[version === 'transparent' ? 'transparent' : 'default']), children: "\u0412\u043E\u0439\u0442\u0438" })) : null] }));
|
|
20
25
|
});
|
|
21
26
|
//# sourceMappingURL=HeaderTop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderTop.js","sourceRoot":"","sources":["../../../src/components/Header/HeaderTop.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAGxC,iDAA8C;AAC9C,uDAAoD;AACpD,6CAA0C;
|
|
1
|
+
{"version":3,"file":"HeaderTop.js","sourceRoot":"","sources":["../../../src/components/Header/HeaderTop.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAGxC,iDAA8C;AAC9C,uDAAoD;AACpD,6CAA0C;AAE1C,8CAA2C;AAC3C,qDAAkD;AAClD,uDAA0D;AAS1D,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,sDAAsD;IAC/D,WAAW,EAAE,qCAAqC;CACnD,CAAC;AAEW,QAAA,SAAS,GAAG,IAAA,aAAG,EAAiB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,EAAE,EAAE;IAC3F,MAAM,MAAM,GAAG,IAAA,qBAAS,GAAE,CAAC;IAC3B,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,KAAK,GAAG,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC/B,MAAM,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,iCAAK,SAAS,EAAC,0CAA0C,aACtD,cAAc,CAAC,CAAC,CAAC,CAChB,uBAAC,WAAI,IAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAI,CACvC,CAAC,CAAC,CAAC,CACF,wBAAC,eAAM,IAAC,SAAS,EAAC,0BAA0B,EAAC,SAAS,EAAC,uFAAiB,EAAC,OAAO,EAAE,OAAO,aACvF,uBAAC,SAAG,IACF,SAAS,EAAC,SAAS,EACnB,KAAK,EAAE;4BACL,IAAI,EAAE,aAAa;4BACnB,WAAW,EAAE,OAAO;yBACrB,GACD,6FAEK,CACV,EACA,eAAe,CAAC,CAAC,CAAC,CACjB,uBAAC,eAAM,IACL,IAAI,EAAE,eAAe,EACrB,SAAS,EAAC,gCAAO,EACjB,MAAM,EAAC,QAAQ,EACf,SAAS,EAAE,IAAA,aAAK,EACd,8EAA8E,EAC9E,YAAY,CAAC,OAAO,KAAK,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CACpE,+CAGM,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VNode } from '../../model/VNode';
|
|
2
|
+
import type { LinkDoc } from './LinkDocsContent';
|
|
3
|
+
export interface LinkDocItemProps extends LinkDoc {
|
|
4
|
+
icon?: VNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const LinkDocItem: import("@redneckz/uni-jsx").UNIComponent<LinkDocItemProps, any, any>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.LinkDocItem = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const Text_1 = require("../../ui-kit/Text/Text");
|
|
6
|
+
exports.LinkDocItem = (0, uni_jsx_1.JSX)(({ icon, text, fileSize, ...linkProps }) => ((0, jsx_runtime_1.jsxs)("a", { className: "flex box-border gap-3 group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", role: "link", ...linkProps, children: [icon, text ? ((0, jsx_runtime_1.jsxs)(Text_1.Text, { size: "text-l", font: "font-light", children: [text, (0, jsx_runtime_1.jsx)(Text_1.Text, { color: "text-secondary-text", children: linkProps?.href && formatSuffix(getExtFromHref(linkProps.href), fileSize) })] })) : null] })));
|
|
7
|
+
const formatSuffix = (ext, fileSize) => {
|
|
8
|
+
const prefix = ext || fileSize ? ',' : '';
|
|
9
|
+
const extension = ext ? ` ${ext}` : '';
|
|
10
|
+
const size = fileSize ? ` (${fileSize})` : '';
|
|
11
|
+
return prefix + extension + size;
|
|
12
|
+
};
|
|
13
|
+
const getExtFromHref = (href) => {
|
|
14
|
+
if (!href) {
|
|
15
|
+
return '';
|
|
16
|
+
}
|
|
17
|
+
const index = href.lastIndexOf('.');
|
|
18
|
+
return index !== -1 ? href.substring(index + 1) : '';
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=LinkDocItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkDocItem.js","sourceRoot":"","sources":["../../../src/components/LinkDocs/LinkDocItem.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,iDAA8C;AAOjC,QAAA,WAAW,GAAG,IAAA,aAAG,EAAmB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE,CAAC,CAC3F,+BACE,SAAS,EAAC,qGAAqG,EAC/G,IAAI,EAAC,MAAM,KACP,SAAS,aAEZ,IAAI,EACJ,IAAI,CAAC,CAAC,CAAC,CACN,wBAAC,WAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,YAAY,aAClC,IAAI,EACL,uBAAC,WAAI,IAAC,KAAK,EAAC,qBAAqB,YAC9B,SAAS,EAAE,IAAI,IAAI,YAAY,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,GACrE,IACF,CACR,CAAC,CAAC,CAAC,IAAI,IACN,CACL,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,GAAY,EAAE,QAAiB,EAAE,EAAE;IACvD,MAAM,MAAM,GAAG,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACvC,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAE9C,OAAO,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAE;IACtC,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,EAAE,CAAC;KACX;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAEpC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvD,CAAC,CAAC"}
|
|
@@ -2,14 +2,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.LinkDocs = 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 useRouter_1 = require("../../hooks/useRouter");
|
|
5
6
|
const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
6
7
|
const Img_1 = require("../../ui-kit/Img/Img");
|
|
8
|
+
const adjustHref_1 = require("../../utils/adjustHref");
|
|
7
9
|
const style_1 = require("../../utils/style");
|
|
8
10
|
const Headline_1 = require("../Headline/Headline");
|
|
9
|
-
const
|
|
11
|
+
const LinkDocItem_1 = require("./LinkDocItem");
|
|
12
|
+
const linkIconStyle_1 = require("./linkIconStyle");
|
|
10
13
|
const linkColumnsModeStyleMap = {
|
|
11
|
-
double: 'flex-wrap',
|
|
12
|
-
single: 'flex-col',
|
|
14
|
+
double: 'sm:flex-wrap sm:flex-row',
|
|
15
|
+
single: 'sm:flex-col',
|
|
16
|
+
};
|
|
17
|
+
exports.LinkDocs = (0, uni_jsx_1.JSX)(({ className = '', title, description, align = 'text-center', documents, icon = { icon: 'DocIcon' }, columnsMode = 'double', ...rest }) => {
|
|
18
|
+
const router = (0, useRouter_1.useRouter)();
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: className, defaultPadding: "p-default", ...rest, children: [(0, jsx_runtime_1.jsx)(Headline_1.Headline, { className: "!p-0", title: title, description: description, align: align, headlineVersion: "M", as: "h2" }), documents?.length ? ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.style)('mt-5 sm:mt-8 flex flex-col gap-6', linkColumnsModeStyleMap[columnsMode]), role: "list", children: documents.map(renderLinkDocItem(router, columnsMode, icon)) })) : null] }));
|
|
20
|
+
});
|
|
21
|
+
const renderLinkDocItem = (router, columnsMode, icon) => (docBlockDef, i) => {
|
|
22
|
+
const href = docBlockDef?.docType === 'Attachment'
|
|
23
|
+
? (0, adjustHref_1.adjustHref)(router)(docBlockDef?.attachment?.src)
|
|
24
|
+
: docBlockDef?.href;
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: columnsMode === 'double' ? 'basis-[calc(50%-20px)]' : '', role: "listitem", children: (0, jsx_runtime_1.jsx)(LinkDocItem_1.LinkDocItem, { ...docBlockDef, href: href, icon: icon ? (0, jsx_runtime_1.jsx)(Img_1.Img, { className: linkIconStyle_1.linkIconStyle, image: icon, width: "24", height: "24" }) : null }) }, String(i)));
|
|
13
26
|
};
|
|
14
|
-
exports.LinkDocs = (0, uni_jsx_1.JSX)(({ className = '', title, description, align = 'text-center', documents, icon = { icon: 'DocIcon' }, columnsMode = 'double', ...rest }) => ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: className, defaultPadding: "p-default", ...rest, children: [(0, jsx_runtime_1.jsx)(Headline_1.Headline, { className: "!p-0", title: title, description: description, align: align, headlineVersion: "M", as: "h2" }), documents?.length ? ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.style)('mt-8 flex gap-6', linkColumnsModeStyleMap[columnsMode]), role: "list", children: documents.map((doc, i) => ((0, jsx_runtime_1.jsx)("div", { className: columnsMode === 'double' ? 'basis-[calc(50%-20px)]' : '', role: "listitem", children: (0, jsx_runtime_1.jsx)(LinkDocsListItem_1.LinkDocsListItem, { doc: doc, icon: icon ? ((0, jsx_runtime_1.jsx)(Img_1.Img, { className: "min-w-6 min-h-6", image: icon, width: "24", height: "24" })) : null }) }, String(i)))) })) : null] })));
|
|
15
27
|
//# sourceMappingURL=LinkDocs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkDocs.js","sourceRoot":"","sources":["../../../src/components/LinkDocs/LinkDocs.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;
|
|
1
|
+
{"version":3,"file":"LinkDocs.js","sourceRoot":"","sources":["../../../src/components/LinkDocs/LinkDocs.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,qDAA0D;AAG1D,4DAAyD;AACzD,8CAA2C;AAC3C,uDAAoD;AACpD,6CAA0C;AAC1C,mDAAgD;AAChD,+CAA4C;AAE5C,mDAAgD;AAEhD,MAAM,uBAAuB,GAAoC;IAC/D,MAAM,EAAE,0BAA0B;IAClC,MAAM,EAAE,aAAa;CACtB,CAAC;AAIW,QAAA,QAAQ,GAAG,IAAA,aAAG,EACzB,CAAC,EACC,SAAS,GAAG,EAAE,EACd,KAAK,EACL,WAAW,EACX,KAAK,GAAG,aAAa,EACrB,SAAS,EACT,IAAI,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,EAC1B,WAAW,GAAG,QAAQ,EACtB,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,IAAA,qBAAS,GAAE,CAAC;IAE3B,OAAO,CACL,wBAAC,2BAAY,IAAC,SAAS,EAAE,SAAS,EAAE,cAAc,EAAC,WAAW,KAAK,IAAI,aACrE,uBAAC,mBAAQ,IACP,SAAS,EAAC,MAAM,EAChB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,eAAe,EAAC,GAAG,EACnB,EAAE,EAAC,IAAI,GACP,EACD,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CACnB,gCACE,SAAS,EAAE,IAAA,aAAK,EACd,kCAAkC,EAClC,uBAAuB,CAAC,WAAW,CAAC,CACrC,EACD,IAAI,EAAC,MAAM,YAEV,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,GACxD,CACP,CAAC,CAAC,CAAC,IAAI,IACK,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,iBAAiB,GACrB,CAAC,MAAc,EAAE,WAA4B,EAAE,IAAa,EAAE,EAAE,CAChE,CAAC,WAAwB,EAAE,CAAS,EAAE,EAAE;IACtC,MAAM,IAAI,GACR,WAAW,EAAE,OAAO,KAAK,YAAY;QACnC,CAAC,CAAC,IAAA,uBAAU,EAAC,MAAM,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,CAAC;QAClD,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC;IAExB,OAAO,CACL,gCAEE,SAAS,EAAE,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,EACnE,IAAI,EAAC,UAAU,YAEf,uBAAC,yBAAW,OACN,WAAW,EACf,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,uBAAC,SAAG,IAAC,SAAS,EAAE,6BAAa,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,GACzF,IARG,MAAM,CAAC,CAAC,CAAC,CASV,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Attachment } from '../../model/Attachment';
|
|
2
|
+
import { EmptyOption } from '../../model/EmptyOptionType';
|
|
1
3
|
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
2
4
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
3
|
-
import type { LinkProps } from '../../model/LinkProps';
|
|
5
|
+
import type { LinkProps, Target } from '../../model/LinkProps';
|
|
4
6
|
import type { IconProps } from '../../model/Picture';
|
|
5
7
|
import type { TextAlign } from '../../ui-kit/Text/TextProps';
|
|
6
8
|
/**
|
|
@@ -11,19 +13,41 @@ import type { TextAlign } from '../../ui-kit/Text/TextProps';
|
|
|
11
13
|
* ]
|
|
12
14
|
*/
|
|
13
15
|
export declare type LinkColumnsMode = 'single' | 'double';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
export interface LinkDoc extends LinkProps {
|
|
17
|
+
/** @title размер файла */
|
|
18
|
+
fileSize?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface AttachmentDoc {
|
|
21
|
+
/** @title Текст */
|
|
22
|
+
text?: string;
|
|
23
|
+
/** @title */
|
|
24
|
+
attachment?: Attachment;
|
|
18
25
|
/** @title размер файла */
|
|
19
26
|
fileSize?: string;
|
|
27
|
+
/** @default "" */
|
|
28
|
+
target?: Target;
|
|
20
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* @title Ссылка на документ
|
|
32
|
+
* @default {"docType": "Link"}
|
|
33
|
+
*/
|
|
34
|
+
export declare type LinkDocDef = LinkDoc & {
|
|
35
|
+
docType: 'Link';
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @title Файл
|
|
39
|
+
* @default {"docType": "Attachment"}
|
|
40
|
+
*/
|
|
41
|
+
export declare type AttachmentDocDef = AttachmentDoc & {
|
|
42
|
+
docType: 'Attachment';
|
|
43
|
+
};
|
|
44
|
+
export declare type DocBlockDef = EmptyOption | LinkDocDef | AttachmentDocDef;
|
|
21
45
|
/**
|
|
22
46
|
* @title Список документов
|
|
23
47
|
*/
|
|
24
48
|
export declare type LinkDocsContent = UniBlockContent & HeadlineCommonProps & IconProps & {
|
|
25
49
|
/** @title Список */
|
|
26
|
-
documents?:
|
|
50
|
+
documents?: DocBlockDef[];
|
|
27
51
|
columnsMode?: LinkColumnsMode;
|
|
28
52
|
/** @title Выравнивание */
|
|
29
53
|
align?: TextAlign;
|
|
@@ -4,20 +4,32 @@ exports.linkDocsContentExample = {
|
|
|
4
4
|
title: 'Дополнительные документы',
|
|
5
5
|
description: 'Ответы на часто задаваемые вопросы',
|
|
6
6
|
documents: [
|
|
7
|
-
{ text: 'target self', href: '/abc1/cooldoc.doc', target: '_self' },
|
|
8
|
-
{ text: 'target blank', href: '/abc2/wtf.rtf', target: '_blank' },
|
|
9
|
-
{ text: 'GlassIcon', href: '/abc3/map.jpeg' },
|
|
10
|
-
{ text: 'no icon', href: '/abc4' },
|
|
11
|
-
{ text: 'документ 5', href: '/abc5' },
|
|
12
|
-
{ text: 'документ 6', href: '/abc6/abc.pdf' },
|
|
13
|
-
{ text: 'Text text text', href: '/abc7/yolo.png' },
|
|
14
7
|
{
|
|
8
|
+
docType: 'Attachment',
|
|
9
|
+
text: 'target self',
|
|
10
|
+
attachment: { src: '/abc1/cooldoc.doc' },
|
|
11
|
+
target: '_self',
|
|
12
|
+
},
|
|
13
|
+
{ docType: 'Link', text: 'target blank', href: '/abc2/wtf.rtf', target: '_blank' },
|
|
14
|
+
{ docType: 'Link', text: 'GlassIcon', href: '/abc3/map.jpeg' },
|
|
15
|
+
{ docType: 'Link', text: 'no icon', href: '/abc4' },
|
|
16
|
+
{ docType: 'Link', text: 'документ 5', href: '/abc5' },
|
|
17
|
+
{ docType: 'Link', text: 'документ 6', href: '/abc6/abc.pdf' },
|
|
18
|
+
{ docType: 'Link', text: 'Text text text', href: '/abc7/yolo.png' },
|
|
19
|
+
{
|
|
20
|
+
docType: 'Link',
|
|
15
21
|
text: 'Some more generic text to stretch item, and even more, more text, and more generic text, and even more, more text, and even more',
|
|
16
22
|
href: '/abc8/archive.zip',
|
|
17
23
|
fileSize: '2.3МБ',
|
|
18
24
|
},
|
|
19
|
-
{ text: 'И ещё немного текста', href: '/abc9/rarniw.rar', fileSize: '666МБ' },
|
|
20
25
|
{
|
|
26
|
+
docType: 'Link',
|
|
27
|
+
text: 'И ещё немного текста',
|
|
28
|
+
href: '/abc9/rarniw.rar',
|
|
29
|
+
fileSize: '666МБ',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
docType: 'Link',
|
|
21
33
|
text: 'Форматируем, сортируем, смотрим как отображается...',
|
|
22
34
|
href: '/abc10/',
|
|
23
35
|
fileSize: '65ГБ',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkDocsContentExample.js","sourceRoot":"","sources":["../../../src/components/LinkDocs/linkDocsContentExample.ts"],"names":[],"mappings":";;AAEa,QAAA,sBAAsB,GAAoB;IACrD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,oCAAoC;IACjD,SAAS,EAAE;QACT,EAAE,IAAI,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"linkDocsContentExample.js","sourceRoot":"","sources":["../../../src/components/LinkDocs/linkDocsContentExample.ts"],"names":[],"mappings":";;AAEa,QAAA,sBAAsB,GAAoB;IACrD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,oCAAoC;IACjD,SAAS,EAAE;QACT;YACE,OAAO,EAAE,YAAY;YACrB,IAAI,EAAE,aAAa;YACnB,UAAU,EAAE,EAAE,GAAG,EAAE,mBAAmB,EAAE;YACxC,MAAM,EAAE,OAAO;SAChB;QACD,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE;QAClF,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,gBAAgB,EAAE;QAC9D,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE;QACnD,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE;QACtD,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE;QAC9D,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE;QACnE;YACE,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,kIAAkI;YACxI,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,OAAO;SAClB;QACD;YACE,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,kBAAkB;YACxB,QAAQ,EAAE,OAAO;SAClB;QACD;YACE,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,qDAAqD;YAC3D,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,MAAM;SACjB;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const linkIconStyle = "min-w-6 min-h-6";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkIconStyle.js","sourceRoot":"","sources":["../../../src/components/LinkDocs/linkIconStyle.ts"],"names":[],"mappings":";;AAAa,QAAA,aAAa,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const linkIconStyle = "min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkIconStyle.mobile.js","sourceRoot":"","sources":["../../../src/components/LinkDocs/linkIconStyle.mobile.ts"],"names":[],"mappings":";;AAAa,QAAA,aAAa,GAAG,0DAA0D,CAAC"}
|
|
@@ -7,14 +7,24 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const util_1 = __importDefault(require("util"));
|
|
9
9
|
const mapJSON_1 = require("./mapJSON");
|
|
10
|
-
const
|
|
10
|
+
const transformDocument_1 = require("./transformDocument");
|
|
11
11
|
const transformHTML_1 = require("./transformHTML");
|
|
12
12
|
const transformMarkdown_1 = require("./transformMarkdown");
|
|
13
13
|
const transformPicture_1 = require("./transformPicture");
|
|
14
14
|
const readFile = util_1.default.promisify(fs_1.default.readFile);
|
|
15
15
|
const writeFile = util_1.default.promisify(fs_1.default.writeFile);
|
|
16
16
|
const OUTPUT_SUFFIX = '.static';
|
|
17
|
-
const DOCUMENT_EXT_LIST = [
|
|
17
|
+
const DOCUMENT_EXT_LIST = [
|
|
18
|
+
'.txt',
|
|
19
|
+
'.doc',
|
|
20
|
+
'.docx',
|
|
21
|
+
'.xls',
|
|
22
|
+
'.xlsx',
|
|
23
|
+
'.xlsb',
|
|
24
|
+
'.ppt',
|
|
25
|
+
'.pptx',
|
|
26
|
+
'.pdf',
|
|
27
|
+
];
|
|
18
28
|
async function transformContentPage(pagePath, options) {
|
|
19
29
|
const content = await readFile(pagePath, 'utf8');
|
|
20
30
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
@@ -26,8 +36,8 @@ async function transformContentPage(pagePath, options) {
|
|
|
26
36
|
else if (isHTML(key, value)) {
|
|
27
37
|
return await (0, transformHTML_1.transformHTML)(value);
|
|
28
38
|
}
|
|
29
|
-
else if (
|
|
30
|
-
return await (0,
|
|
39
|
+
else if (isDocument(value)) {
|
|
40
|
+
return await (0, transformDocument_1.transformDocument)(value, pagePath, options);
|
|
31
41
|
}
|
|
32
42
|
else if (isPicture(value)) {
|
|
33
43
|
return await (0, transformPicture_1.transformPicture)(value, pagePath, options);
|
|
@@ -47,7 +57,7 @@ const generatedPagePath = (pagePath) => `${pagePath}${OUTPUT_SUFFIX}`;
|
|
|
47
57
|
exports.generatedPagePath = generatedPagePath;
|
|
48
58
|
const isMarkdown = (key, value) => isString(value) && key?.endsWith('__md');
|
|
49
59
|
const isHTML = (key, value) => isString(value) && key?.endsWith('__html');
|
|
50
|
-
const
|
|
60
|
+
const isDocument = (_) => Boolean(_ && isLocalPath(_?.src) && isDocumentExt(path_1.default.extname(_?.src)));
|
|
51
61
|
const isDocumentExt = (input) => DOCUMENT_EXT_LIST.some((ext) => input.toLowerCase().endsWith(ext));
|
|
52
62
|
const isPicture = (_) => Boolean(_ && isLocalPath(_?.src));
|
|
53
63
|
const isLocalPath = (_) => isString(_) && _.length < 1024 && !isURL(_);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformContentPage.js","sourceRoot":"","sources":["../../src/content-page-repository/transformContentPage.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AAIxB,uCAAoC;AAEpC,
|
|
1
|
+
{"version":3,"file":"transformContentPage.js","sourceRoot":"","sources":["../../src/content-page-repository/transformContentPage.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AAIxB,uCAAoC;AAEpC,2DAAwD;AACxD,mDAAgD;AAChD,2DAAwD;AACxD,yDAAsD;AAEtD,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,QAAQ,CAAC,CAAC;AAC7C,MAAM,SAAS,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,SAAS,CAAC,CAAC;AAE/C,MAAM,aAAa,GAAG,SAAS,CAAC;AAEhC,MAAM,iBAAiB,GAAG;IACxB,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;CACP,CAAC;AAEK,KAAK,UAAU,oBAAoB,CACxC,QAAgB,EAChB,OAA8B;IAE9B,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEjD,iEAAiE;IACjE,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAO,EAAiB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAU,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE;QAC5F,IAAI;YACF,IAAI,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;gBAC1B,OAAO,MAAM,IAAA,qCAAiB,EAAC,KAAe,CAAC,CAAC;aACjD;iBAAM,IAAI,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;gBAC7B,OAAO,MAAM,IAAA,6BAAa,EAAC,KAAe,CAAC,CAAC;aAC7C;iBAAM,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE;gBAC5B,OAAO,MAAM,IAAA,qCAAiB,EAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;aAC1D;iBAAM,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE;gBAC3B,OAAO,MAAM,IAAA,mCAAgB,EAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;aACzD;SACF;QAAC,OAAO,EAAE,EAAE;YACX,OAAO,CAAC,IAAI,CAAC,mCAAmC,GAAG,cAAc,QAAQ,EAAE,CAAC,CAAC;YAC7E,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;SACnB;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,CAAC,IAAA,yBAAiB,EAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IAE9E,OAAO,MAAM,CAAC;AAChB,CAAC;AA7BD,oDA6BC;AAEM,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,QAAQ,GAAG,aAAa,EAAE,CAAC;AAAxE,QAAA,iBAAiB,qBAAuD;AAErF,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,KAAU,EAAmB,EAAE,CAC9D,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,KAAU,EAAmB,EAAE,CAC1D,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC7C,MAAM,UAAU,GAAG,CAAC,CAAM,EAAmB,EAAE,CAC7C,OAAO,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,aAAa,CAAC,cAAI,CAAC,OAAO,CAAC,CAAC,EAAE,GAAa,CAAC,CAAC,CAAC,CAAC;AACrF,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,EAAE,CACtC,iBAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AACrE,MAAM,SAAS,GAAG,CAAC,CAAM,EAAgB,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AAC9E,MAAM,WAAW,GAAG,CAAC,CAAM,EAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACrF,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;AAEnG,MAAM,QAAQ,GAAG,CAAC,CAAM,EAAe,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC"}
|
|
@@ -2,17 +2,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
2
2
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3
3
|
};
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
5
|
+
exports.transformDocument = void 0;
|
|
6
6
|
const fs_1 = __importDefault(require("fs"));
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const util_1 = __importDefault(require("util"));
|
|
9
9
|
const copyFile = util_1.default.promisify(fs_1.default.copyFile);
|
|
10
|
-
async function
|
|
11
|
-
if (!
|
|
12
|
-
return
|
|
10
|
+
async function transformDocument(attachment, pagePath, options) {
|
|
11
|
+
if (!attachment?.src) {
|
|
12
|
+
return attachment;
|
|
13
13
|
}
|
|
14
14
|
const { contentDir, publicDir } = options;
|
|
15
|
-
const input = path_1.default.join(path_1.default.dirname(pagePath),
|
|
15
|
+
const input = path_1.default.join(path_1.default.dirname(pagePath), attachment.src);
|
|
16
16
|
const docRelativePath = path_1.default.relative(contentDir, input);
|
|
17
17
|
const output = path_1.default.join(publicDir, docRelativePath);
|
|
18
18
|
try {
|
|
@@ -20,13 +20,13 @@ async function transformDocumentLink(link, pagePath, options) {
|
|
|
20
20
|
}
|
|
21
21
|
catch (e) {
|
|
22
22
|
console.info(`No "${input}" attachment found on page: "${pagePath}"`);
|
|
23
|
-
return
|
|
23
|
+
return attachment;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const src = path_1.default.join('/', docRelativePath);
|
|
26
26
|
return {
|
|
27
|
-
...
|
|
28
|
-
|
|
27
|
+
...attachment,
|
|
28
|
+
src,
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
exports.
|
|
32
|
-
//# sourceMappingURL=
|
|
31
|
+
exports.transformDocument = transformDocument;
|
|
32
|
+
//# sourceMappingURL=transformDocument.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformDocument.js","sourceRoot":"","sources":["../../src/content-page-repository/transformDocument.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AAIxB,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,YAAE,CAAC,QAAQ,CAAC,CAAC;AAEtC,KAAK,UAAU,iBAAiB,CACrC,UAAsB,EACtB,QAAgB,EAChB,OAA8B;IAE9B,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE;QACpB,OAAO,UAAU,CAAC;KACnB;IAED,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC1C,MAAM,KAAK,GAAG,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAChE,MAAM,eAAe,GAAG,cAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IAErD,IAAI;QACF,MAAM,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;KAC/B;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,IAAI,CAAC,OAAO,KAAK,gCAAgC,QAAQ,GAAG,CAAC,CAAC;QAEtE,OAAO,UAAU,CAAC;KACnB;IAED,MAAM,GAAG,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAE5C,OAAO;QACL,GAAG,UAAU;QACb,GAAG;KACJ,CAAC;AACJ,CAAC;AA5BD,8CA4BC"}
|