@peassoft/mnr-web-topline 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/en/parts/shell/context.d.ts +1 -0
- package/dist/en/parts/shell/context.js +1 -0
- package/dist/en/parts/shell/ui/logo/index.d.ts +2 -1
- package/dist/en/parts/shell/ui/logo/index.js +6 -0
- package/dist/en/topline.d.ts +6 -0
- package/dist/en/topline.js +2 -0
- package/dist/ru/parts/shell/context.d.ts +1 -0
- package/dist/ru/parts/shell/context.js +1 -0
- package/dist/ru/parts/shell/ui/logo/index.d.ts +2 -1
- package/dist/ru/parts/shell/ui/logo/index.js +6 -0
- package/dist/ru/topline.d.ts +6 -0
- package/dist/ru/topline.js +2 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import type { ToplineUser } from '../../types/data.js';
|
|
|
3
3
|
import type { ToplineService } from '../../modules/topline-service/index.js';
|
|
4
4
|
export type InnerToplineContext = {
|
|
5
5
|
ssrUser: ToplineUser | null;
|
|
6
|
+
forceBlankHomeLink: boolean;
|
|
6
7
|
user: ToplineUser | null;
|
|
7
8
|
handleUserChange: (user: ToplineUser | null) => unknown;
|
|
8
9
|
onReady: (toplineService: ToplineService, user: ToplineUser | null) => unknown;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
export default function Logo(): JSX.Element;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
2
3
|
import LogoFull from './logo-full.js';
|
|
3
4
|
import LogoShort from './logo-short.js';
|
|
5
|
+
import ToplineContext from '../../context.js';
|
|
4
6
|
export default function Logo() {
|
|
7
|
+
const {
|
|
8
|
+
forceBlankHomeLink
|
|
9
|
+
} = useContext(ToplineContext);
|
|
5
10
|
return _jsxs("a", {
|
|
6
11
|
href: '/',
|
|
7
12
|
"aria-label": "Home page",
|
|
13
|
+
target: forceBlankHomeLink ? '_blank' : undefined,
|
|
8
14
|
children: [_jsx(LogoFull, {}), _jsx(LogoShort, {})]
|
|
9
15
|
});
|
|
10
16
|
}
|
package/dist/en/topline.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ import type { ToplineService } from './modules/topline-service/index.js';
|
|
|
6
6
|
export type ToplineProps = {
|
|
7
7
|
/** User to use in SSR */
|
|
8
8
|
ssrUser?: ToplineUser | null;
|
|
9
|
+
/**
|
|
10
|
+
* If set to `true`, the link to the home page opens the home page in a separate window.
|
|
11
|
+
*
|
|
12
|
+
* For use in PWA.
|
|
13
|
+
*/
|
|
14
|
+
forceBlankHomeLink?: boolean;
|
|
9
15
|
/** Callback that is invoked after user is restored from a local DB */
|
|
10
16
|
onReady?: (toplineService: ToplineService, user: ToplineUser | null) => unknown;
|
|
11
17
|
/**
|
package/dist/en/topline.js
CHANGED
|
@@ -7,6 +7,7 @@ import { ToplineContext, Shell } from './parts/shell/index.js';
|
|
|
7
7
|
export default function Topline(props) {
|
|
8
8
|
const {
|
|
9
9
|
ssrUser = null,
|
|
10
|
+
forceBlankHomeLink = false,
|
|
10
11
|
onReady = () => undefined,
|
|
11
12
|
onError = () => undefined
|
|
12
13
|
} = props;
|
|
@@ -18,6 +19,7 @@ export default function Topline(props) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
const context = {
|
|
20
21
|
ssrUser: isSsrUserConsumed ? null : ssrUser,
|
|
22
|
+
forceBlankHomeLink,
|
|
21
23
|
user,
|
|
22
24
|
handleUserChange,
|
|
23
25
|
onReady,
|
|
@@ -3,6 +3,7 @@ import type { ToplineUser } from '../../types/data.js';
|
|
|
3
3
|
import type { ToplineService } from '../../modules/topline-service/index.js';
|
|
4
4
|
export type InnerToplineContext = {
|
|
5
5
|
ssrUser: ToplineUser | null;
|
|
6
|
+
forceBlankHomeLink: boolean;
|
|
6
7
|
user: ToplineUser | null;
|
|
7
8
|
handleUserChange: (user: ToplineUser | null) => unknown;
|
|
8
9
|
onReady: (toplineService: ToplineService, user: ToplineUser | null) => unknown;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
export default function Logo(): JSX.Element;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
2
3
|
import LogoFull from './logo-full.js';
|
|
3
4
|
import LogoShort from './logo-short.js';
|
|
5
|
+
import ToplineContext from '../../context.js';
|
|
4
6
|
export default function Logo() {
|
|
7
|
+
const {
|
|
8
|
+
forceBlankHomeLink
|
|
9
|
+
} = useContext(ToplineContext);
|
|
5
10
|
return _jsxs("a", {
|
|
6
11
|
href: '/',
|
|
7
12
|
"aria-label": "Главная страница",
|
|
13
|
+
target: forceBlankHomeLink ? '_blank' : undefined,
|
|
8
14
|
children: [_jsx(LogoFull, {}), _jsx(LogoShort, {})]
|
|
9
15
|
});
|
|
10
16
|
}
|
package/dist/ru/topline.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ import type { ToplineService } from './modules/topline-service/index.js';
|
|
|
6
6
|
export type ToplineProps = {
|
|
7
7
|
/** User to use in SSR */
|
|
8
8
|
ssrUser?: ToplineUser | null;
|
|
9
|
+
/**
|
|
10
|
+
* If set to `true`, the link to the home page opens the home page in a separate window.
|
|
11
|
+
*
|
|
12
|
+
* For use in PWA.
|
|
13
|
+
*/
|
|
14
|
+
forceBlankHomeLink?: boolean;
|
|
9
15
|
/** Callback that is invoked after user is restored from a local DB */
|
|
10
16
|
onReady?: (toplineService: ToplineService, user: ToplineUser | null) => unknown;
|
|
11
17
|
/**
|
package/dist/ru/topline.js
CHANGED
|
@@ -7,6 +7,7 @@ import { ToplineContext, Shell } from './parts/shell/index.js';
|
|
|
7
7
|
export default function Topline(props) {
|
|
8
8
|
const {
|
|
9
9
|
ssrUser = null,
|
|
10
|
+
forceBlankHomeLink = false,
|
|
10
11
|
onReady = () => undefined,
|
|
11
12
|
onError = () => undefined
|
|
12
13
|
} = props;
|
|
@@ -18,6 +19,7 @@ export default function Topline(props) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
const context = {
|
|
20
21
|
ssrUser: isSsrUserConsumed ? null : ssrUser,
|
|
22
|
+
forceBlankHomeLink,
|
|
21
23
|
user,
|
|
22
24
|
handleUserChange,
|
|
23
25
|
onReady,
|