@redneckz/wildless-cms-uni-blocks 0.8.7 → 0.8.9
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/EventBus/EventBus.d.ts +1 -4
- package/bundle/EventBus/defaultEventBus.d.ts +7 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +34 -70
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/bundle/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/bundle/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/bundle/hooks/useRouter.d.ts +6 -2
- package/bundle/model/DefaultListItemType.d.ts +4 -0
- package/bundle/model/RichTextItem.d.ts +8 -0
- package/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/dist/EventBus/EventBus.d.ts +1 -4
- package/dist/EventBus/EventBus.js +0 -1
- package/dist/EventBus/EventBus.js.map +1 -1
- package/dist/EventBus/defaultEventBus.d.ts +7 -0
- package/dist/EventBus/defaultEventBus.js +5 -0
- package/dist/EventBus/defaultEventBus.js.map +1 -0
- package/dist/components/ButtonBlock/ButtonBlock.js +2 -1
- package/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/dist/components/ProductTile/ProductTile.js +1 -2
- package/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/dist/components/Tabs/Tabs.js +4 -4
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/TextBlock/TextBlock.js +3 -2
- package/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/dist/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/dist/hooks/useLink.js +2 -3
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/hooks/useRouter.d.ts +6 -2
- package/dist/hooks/useRouter.js.map +1 -1
- package/dist/model/DefaultListItemType.d.ts +4 -0
- package/dist/model/DefaultListItemType.js +2 -0
- package/dist/model/DefaultListItemType.js.map +1 -0
- package/dist/model/RichTextItem.d.ts +8 -0
- package/{mobile/dist/EventBus/EventMap.js → dist/model/RichTextItem.js} +1 -1
- package/dist/model/RichTextItem.js.map +1 -0
- package/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/dist/services/BlockRouter/BlockRouter.js +11 -30
- package/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
- package/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
- package/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
- package/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/dist/ui-kit/BlockWrapper.js +2 -2
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/EventBus/EventBus.d.ts +1 -4
- package/lib/EventBus/EventBus.js +0 -1
- package/lib/EventBus/EventBus.js.map +1 -1
- package/lib/EventBus/defaultEventBus.d.ts +7 -0
- package/lib/EventBus/defaultEventBus.js +3 -0
- package/lib/EventBus/defaultEventBus.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ButtonBlock/ButtonBlock.js +2 -1
- package/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/lib/components/ProductTile/ProductTile.js +1 -2
- package/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/lib/components/Tabs/Tabs.js +4 -4
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/TextBlock/TextBlock.js +3 -2
- package/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/lib/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/lib/hooks/useLink.js +2 -3
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/hooks/useRouter.d.ts +6 -2
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/model/DefaultListItemType.d.ts +4 -0
- package/lib/model/DefaultListItemType.js +2 -0
- package/lib/model/DefaultListItemType.js.map +1 -0
- package/lib/model/RichTextItem.d.ts +8 -0
- package/lib/model/RichTextItem.js +2 -0
- package/lib/model/RichTextItem.js.map +1 -0
- package/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/lib/services/BlockRouter/BlockRouter.js +8 -28
- package/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
- package/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
- package/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
- package/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/lib/ui-kit/BlockWrapper.js +2 -2
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/bundle/EventBus/EventBus.d.ts +1 -4
- package/mobile/bundle/EventBus/defaultEventBus.d.ts +7 -0
- package/mobile/bundle/bundle.umd.js +27 -62
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/mobile/bundle/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/mobile/bundle/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/mobile/bundle/hooks/useRouter.d.ts +6 -2
- package/mobile/bundle/model/DefaultListItemType.d.ts +4 -0
- package/mobile/bundle/model/RichTextItem.d.ts +8 -0
- package/mobile/bundle/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/mobile/bundle/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/mobile/bundle/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/mobile/bundle/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/mobile/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/mobile/dist/EventBus/EventBus.d.ts +1 -4
- package/mobile/dist/EventBus/EventBus.js +0 -1
- package/mobile/dist/EventBus/EventBus.js.map +1 -1
- package/mobile/dist/EventBus/defaultEventBus.d.ts +7 -0
- package/mobile/dist/EventBus/defaultEventBus.js +5 -0
- package/mobile/dist/EventBus/defaultEventBus.js.map +1 -0
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js +2 -1
- package/mobile/dist/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/mobile/dist/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/mobile/dist/components/ProductTile/ProductTile.js +1 -2
- package/mobile/dist/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/mobile/dist/components/Tabs/Tabs.js +4 -4
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/mobile/dist/hooks/useLink.js +2 -3
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/hooks/useRouter.d.ts +6 -2
- package/mobile/dist/hooks/useRouter.js.map +1 -1
- package/mobile/dist/model/DefaultListItemType.d.ts +4 -0
- package/mobile/dist/model/DefaultListItemType.js +2 -0
- package/mobile/dist/model/DefaultListItemType.js.map +1 -0
- package/mobile/dist/model/RichTextItem.d.ts +8 -0
- package/{dist/EventBus/EventMap.js → mobile/dist/model/RichTextItem.js} +1 -1
- package/mobile/dist/model/RichTextItem.js.map +1 -0
- package/mobile/dist/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/mobile/dist/services/BlockRouter/BlockRouter.js +11 -30
- package/mobile/dist/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/dist/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/mobile/dist/services/BlockRouter/blockRouterEventBus.js +5 -0
- package/mobile/dist/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js +5 -16
- package/mobile/dist/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js +11 -12
- package/mobile/dist/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/mobile/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/mobile/dist/ui-kit/BlockWrapper.js +2 -2
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/EventBus/EventBus.d.ts +1 -4
- package/mobile/lib/EventBus/EventBus.js +0 -1
- package/mobile/lib/EventBus/EventBus.js.map +1 -1
- package/mobile/lib/EventBus/defaultEventBus.d.ts +7 -0
- package/mobile/lib/EventBus/defaultEventBus.js +3 -0
- package/mobile/lib/EventBus/defaultEventBus.js.map +1 -0
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js +2 -1
- package/mobile/lib/components/ButtonBlock/ButtonBlock.js.map +1 -1
- package/mobile/lib/components/ButtonBlock/ButtonBlockContent.d.ts +5 -1
- package/mobile/lib/components/ProductTile/ProductTile.js +1 -2
- package/mobile/lib/components/ProductTile/ProductTile.js.map +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +4 -13
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +6 -4
- package/mobile/lib/components/Tabs/Tabs.js +4 -4
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/TextBlock/TextBlockContent.d.ts +3 -2
- package/mobile/lib/hooks/useLink.js +2 -3
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/hooks/useRouter.d.ts +6 -2
- package/mobile/lib/hooks/useRouter.js.map +1 -1
- package/mobile/lib/model/DefaultListItemType.d.ts +4 -0
- package/mobile/lib/model/DefaultListItemType.js +2 -0
- package/mobile/lib/model/DefaultListItemType.js.map +1 -0
- package/mobile/lib/model/RichTextItem.d.ts +8 -0
- package/mobile/lib/model/RichTextItem.js +2 -0
- package/mobile/lib/model/RichTextItem.js.map +1 -0
- package/mobile/lib/services/BlockRouter/BlockRouter.d.ts +3 -22
- package/mobile/lib/services/BlockRouter/BlockRouter.js +8 -28
- package/mobile/lib/services/BlockRouter/BlockRouter.js.map +1 -1
- package/mobile/lib/services/BlockRouter/blockRouterEventBus.d.ts +11 -0
- package/mobile/lib/services/BlockRouter/blockRouterEventBus.js +3 -0
- package/mobile/lib/services/BlockRouter/blockRouterEventBus.js.map +1 -0
- package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.d.ts +1 -2
- package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js +6 -17
- package/mobile/lib/services/BlockRouter/useBlockIntersectionObserver.js.map +1 -1
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.d.ts +1 -2
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js +12 -13
- package/mobile/lib/services/BlockRouter/useBlockRouterProvider.js.map +1 -1
- package/mobile/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +4 -13
- package/mobile/lib/ui-kit/BlockWrapper.js +2 -2
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/src/EventBus/EventBus.ts +1 -7
- package/mobile/src/EventBus/defaultEventBus.ts +8 -0
- package/mobile/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
- package/mobile/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
- package/mobile/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
- package/mobile/src/components/ProductTile/ProductTile.tsx +1 -2
- package/mobile/src/components/ProductTile/ProductTileContent.ts +4 -15
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +13 -13
- package/mobile/src/components/Tabs/Tabs.tsx +4 -4
- package/mobile/src/components/TextBlock/TextBlock.ui.json +7 -1
- package/mobile/src/components/TextBlock/TextBlockContent.ts +12 -10
- package/mobile/src/hooks/useLink.ts +2 -3
- package/mobile/src/hooks/useRouter.ts +6 -2
- package/mobile/src/model/DefaultListItemType.ts +4 -0
- package/mobile/src/model/RichTextItem.ts +9 -0
- package/mobile/src/services/BlockRouter/BlockRouter.ts +8 -47
- package/mobile/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
- package/mobile/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
- package/mobile/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
- package/mobile/src/ui-kit/BenefitItem/BenefitItemProps.ts +4 -14
- package/mobile/src/ui-kit/BlockWrapper.tsx +2 -2
- package/package.json +1 -1
- package/src/EventBus/EventBus.ts +1 -7
- package/src/EventBus/defaultEventBus.ts +8 -0
- package/src/components/ButtonBlock/ButtonBlock.example.json +2 -2
- package/src/components/ButtonBlock/ButtonBlock.tsx +5 -2
- package/src/components/ButtonBlock/ButtonBlockContent.ts +5 -1
- package/src/components/ProductTile/ProductTile.tsx +1 -2
- package/src/components/ProductTile/ProductTileContent.ts +4 -15
- package/src/components/StepsBlock/StepsBlockContent.ts +13 -13
- package/src/components/Tabs/Tabs.tsx +4 -4
- package/src/components/TextBlock/TextBlock.tsx +3 -0
- package/src/components/TextBlock/TextBlock.ui.json +7 -1
- package/src/components/TextBlock/TextBlockContent.ts +12 -10
- package/src/hooks/useLink.ts +2 -3
- package/src/hooks/useRouter.ts +6 -2
- package/src/model/DefaultListItemType.ts +4 -0
- package/src/model/RichTextItem.ts +9 -0
- package/src/services/BlockRouter/BlockRouter.ts +8 -47
- package/src/services/BlockRouter/blockRouterEventBus.ts +13 -0
- package/src/services/BlockRouter/useBlockIntersectionObserver.ts +6 -23
- package/src/services/BlockRouter/useBlockRouterProvider.ts +13 -19
- package/src/ui-kit/BenefitItem/BenefitItemProps.ts +4 -14
- package/src/ui-kit/BlockWrapper.tsx +2 -2
- package/bundle/EventBus/EventMap.d.ts +0 -4
- package/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/dist/EventBus/EventMap.d.ts +0 -4
- package/dist/EventBus/EventMap.js.map +0 -1
- package/dist/model/BlurVersion.d.ts +0 -0
- package/dist/model/BlurVersion.js +0 -1
- package/dist/model/BlurVersion.js.map +0 -1
- package/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/dist/services/BlockRouter/useBlockRouter.js +0 -8
- package/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/lib/EventBus/EventMap.d.ts +0 -4
- package/lib/EventBus/EventMap.js +0 -2
- package/lib/EventBus/EventMap.js.map +0 -1
- package/lib/model/BlurVersion.d.ts +0 -0
- package/lib/model/BlurVersion.js +0 -1
- package/lib/model/BlurVersion.js.map +0 -1
- package/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/lib/services/BlockRouter/useBlockRouter.js +0 -5
- package/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/mobile/bundle/EventBus/EventMap.d.ts +0 -4
- package/mobile/bundle/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/mobile/dist/EventBus/EventMap.d.ts +0 -4
- package/mobile/dist/EventBus/EventMap.js.map +0 -1
- package/mobile/dist/model/BlurVersion.d.ts +0 -0
- package/mobile/dist/model/BlurVersion.js +0 -1
- package/mobile/dist/model/BlurVersion.js.map +0 -1
- package/mobile/dist/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/mobile/dist/services/BlockRouter/useBlockRouter.js +0 -8
- package/mobile/dist/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/mobile/lib/EventBus/EventMap.d.ts +0 -4
- package/mobile/lib/EventBus/EventMap.js +0 -2
- package/mobile/lib/EventBus/EventMap.js.map +0 -1
- package/mobile/lib/model/BlurVersion.d.ts +0 -0
- package/mobile/lib/model/BlurVersion.js +0 -1
- package/mobile/lib/model/BlurVersion.js.map +0 -1
- package/mobile/lib/services/BlockRouter/useBlockRouter.d.ts +0 -2
- package/mobile/lib/services/BlockRouter/useBlockRouter.js +0 -5
- package/mobile/lib/services/BlockRouter/useBlockRouter.js.map +0 -1
- package/mobile/src/EventBus/EventMap.ts +0 -5
- package/mobile/src/model/BlurVersion.ts +0 -0
- package/mobile/src/services/BlockRouter/useBlockRouter.ts +0 -5
- package/src/EventBus/EventMap.ts +0 -5
- package/src/model/BlurVersion.ts +0 -0
- package/src/services/BlockRouter/useBlockRouter.ts +0 -5
|
@@ -3,10 +3,7 @@ import type { DescriptionProps, HeadlineCommonProps, LabelProps } from '../../mo
|
|
|
3
3
|
import type { IconProps } from '../../model/Picture';
|
|
4
4
|
import type { SizeVersion } from '../../model/SizeVersion';
|
|
5
5
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
6
|
-
|
|
7
|
-
* @title Шаг
|
|
8
|
-
*/
|
|
9
|
-
export declare type Step = DescriptionProps & LabelProps & IconProps & {
|
|
6
|
+
declare type StepCommonProps = IconProps & {
|
|
10
7
|
/** @title Кнопка */
|
|
11
8
|
button?: ButtonWithIconProps;
|
|
12
9
|
/**
|
|
@@ -17,6 +14,10 @@ export declare type Step = DescriptionProps & LabelProps & IconProps & {
|
|
|
17
14
|
/** @title Список */
|
|
18
15
|
items?: string[];
|
|
19
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* @title Шаг
|
|
19
|
+
*/
|
|
20
|
+
export declare type Step = DescriptionProps & LabelProps & StepCommonProps;
|
|
20
21
|
/**
|
|
21
22
|
* @title Блок шаги
|
|
22
23
|
*/
|
|
@@ -41,3 +42,4 @@ export declare type StepsBlockContent = HeadlineCommonProps & {
|
|
|
41
42
|
size?: SizeVersion;
|
|
42
43
|
version?: BlockVersion;
|
|
43
44
|
};
|
|
45
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
|
-
import {
|
|
4
|
+
import { defaultEventBus } from '../../EventBus/defaultEventBus.js';
|
|
5
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
6
6
|
import { renderTab } from './renderTab.js';
|
|
7
7
|
import { ScrollableTabs } from './ScrollableTabs.js';
|
|
8
8
|
export const Tabs = JSX((props) => {
|
|
9
9
|
const { className = '', tabs, showCounter, isSticky, tabsMode, ...rest } = props;
|
|
10
10
|
const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
|
|
11
|
-
useEffect(() =>
|
|
11
|
+
useEffect(() => defaultEventBus.subscribe('tab', (event) => {
|
|
12
12
|
const tab = tabs?.find(checkTab(event));
|
|
13
13
|
if (event.type === 'link' && tab) {
|
|
14
14
|
setCurrentTab(tab);
|
|
@@ -16,11 +16,11 @@ export const Tabs = JSX((props) => {
|
|
|
16
16
|
return [];
|
|
17
17
|
}), [tabs]);
|
|
18
18
|
useEffect(() => currentTab?.type === 'group'
|
|
19
|
-
?
|
|
19
|
+
? defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref })
|
|
20
20
|
: undefined, [currentTab]);
|
|
21
21
|
const handleClick = useCallback((selectedTab) => {
|
|
22
22
|
if (selectedTab?.type === 'group') {
|
|
23
|
-
|
|
23
|
+
defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
|
|
24
24
|
}
|
|
25
25
|
setCurrentTab(selectedTab);
|
|
26
26
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAUlD,MAAM,CAAC,MAAM,IAAI,G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,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,YAAY,IACX,SAAS,EAAE,2CACT,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EACpC,IAAI,SAAS,EAAE,EACf,IAAI,EAAC,SAAS,KACV,IAAI,YAEP,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,CAC3B,KAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,KACpB,IAAI,GACR,CACH,CAAC,CAAC,CAAC,CACF,IAAI,EAAE,GAAG,CACP,SAAS,CAAC;YACR,OAAO,EAAE,WAAW;YACpB,UAAU;YACV,WAAW;YACX,GAAG,IAAI;SACR,CAAC,CACH,CACF,GACY,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,CAAC,KAAyB,EAAE,EAAE,CAAC,CAAC,CAAU,EAAE,EAAE,CAC7D,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -3,15 +3,16 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
3
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
5
5
|
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph.js';
|
|
6
|
+
import { RichText } from '../../ui-kit/RichText/RichText.js';
|
|
6
7
|
import { Text } from '../../ui-kit/Text/Text.js';
|
|
7
8
|
const textBlockBack = {
|
|
8
9
|
primary: 'bg-white',
|
|
9
10
|
secondary: 'bg-primary-main',
|
|
10
11
|
'secondary-light': 'bg-primary-main/10',
|
|
11
12
|
};
|
|
12
|
-
export const TextBlock = JSX(({ className = '', title, description, blockVersion = 'primary', iconVersion, image, ...rest }) => {
|
|
13
|
+
export const TextBlock = JSX(({ className = '', title, description, blockVersion = 'primary', iconVersion, image, __html, ...rest }) => {
|
|
13
14
|
const isSecondaryBlock = blockVersion === 'secondary';
|
|
14
|
-
return (_jsxs(BlockWrapper, { className: `px-9 py-4 flex gap-3 ${textBlockBack[blockVersion]} ${className}`, ...rest, children: [iconVersion === 'small' ? (_jsx("div", { className: "mt-1", children: renderIcon(isSecondaryBlock) })) : null, iconVersion === 'big' ? renderImage(image) : null, _jsxs("div", { children: [title ? renderTitle(title, isSecondaryBlock) : null, description ? (_jsx("div", { className: "mt-1", children: renderDescription(description, isSecondaryBlock) })) : null] })] }));
|
|
15
|
+
return (_jsxs(BlockWrapper, { className: `px-9 py-4 flex gap-3 ${textBlockBack[blockVersion]} ${className}`, ...rest, children: [iconVersion === 'small' ? (_jsx("div", { className: "mt-1", children: renderIcon(isSecondaryBlock) })) : null, iconVersion === 'big' ? renderImage(image) : null, _jsxs("div", { children: [title ? renderTitle(title, isSecondaryBlock) : null, description ? (_jsx("div", { className: "mt-1", children: renderDescription(description, isSecondaryBlock) })) : null, __html ? _jsx(RichText, { __html: __html }) : null] })] }));
|
|
15
16
|
});
|
|
16
17
|
const renderIcon = (isSecondaryBlock) => (_jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs-light ${isSecondaryBlock ? 'bg-white text-primary-main' : 'bg-primary-main text-white'}`, children: "i" }));
|
|
17
18
|
const renderImage = (image) => (image?.src ? _jsx(Img, { image: image }) : null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextBlock.js","sourceRoot":"","sources":["../../../src/components/TextBlock/TextBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,E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UAAU,GAAG,CAAC,gBAAyB,EAAE,EAAE,CAAC,CAChD,cACE,SAAS,EAAE,kDACT,gBAAgB,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,4BACpD,EAAE,kBAGE,CACP,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,KAAe,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,KAAC,GAAG,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAErF,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,gBAAyB,EAAE,EAAE,CAAC,CAChE,KAAC,IAAI,IACH,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,aAAa,EAClB,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,mBAAmB,YAE3D,KAAK,GACD,CACR,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,WAAmB,EAAE,gBAAyB,EAAE,EAAE,CAAC,CAC5E,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,qBAAqB,YACpF,WAAW,GACF,CACb,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Picture } from '../../model/Picture';
|
|
2
1
|
import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
2
|
+
import type { Picture } from '../../model/Picture';
|
|
3
|
+
import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
3
4
|
/**
|
|
4
5
|
* @title Цвет блока
|
|
5
6
|
* @enumNames ["Основная", "Второстепенная", "Второстепенная прозрачная"]
|
|
@@ -13,7 +14,7 @@ export declare type TextBlockIconVersion = 'none' | 'small' | 'big';
|
|
|
13
14
|
/**
|
|
14
15
|
* @title Текстовый блок
|
|
15
16
|
*/
|
|
16
|
-
export declare type TextBlockContent = HeadlineCommonProps & {
|
|
17
|
+
export declare type TextBlockContent = HeadlineCommonProps & RichTextProps & {
|
|
17
18
|
iconVersion?: TextBlockIconVersion;
|
|
18
19
|
image?: Picture;
|
|
19
20
|
blockVersion?: TextBlockVersion;
|
package/lib/hooks/useLink.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { projectSettings } from '../ProjectSettings.js';
|
|
2
|
-
import {
|
|
2
|
+
import { gotoBlock } from '../services/BlockRouter/BlockRouter.js';
|
|
3
3
|
import { isHash, isLocalURL, joinPath } from '../utils/url.js';
|
|
4
4
|
import { handlerDecorator } from './handlerDecorator.js';
|
|
5
5
|
import { useRouter } from './useRouter.js';
|
|
6
6
|
export function useLink(isRemote) {
|
|
7
7
|
const router = useRouter();
|
|
8
|
-
const blockRouter = useBlockRouter();
|
|
9
8
|
return (props) => ({
|
|
10
9
|
...props,
|
|
11
10
|
href: adjustHref(props.href),
|
|
@@ -28,7 +27,7 @@ export function useLink(isRemote) {
|
|
|
28
27
|
// Client routing
|
|
29
28
|
ev?.preventDefault();
|
|
30
29
|
if (isHash(href)) {
|
|
31
|
-
|
|
30
|
+
gotoBlock(router, href);
|
|
32
31
|
}
|
|
33
32
|
else if (href) {
|
|
34
33
|
router.push(href);
|
package/lib/hooks/useLink.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useLink.js","sourceRoot":"","sources":["../../src/hooks/useLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC5D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CAAC;AACH,CAAC"}
|
package/lib/hooks/useRouter.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
interface RouterOptions {
|
|
2
|
+
scroll?: boolean;
|
|
3
|
+
}
|
|
1
4
|
export interface Router {
|
|
2
5
|
pathname: string;
|
|
3
6
|
query: Record<string, string | string[] | undefined>;
|
|
4
7
|
href?: string;
|
|
5
8
|
basePath?: string;
|
|
6
|
-
push: (url: string) => void;
|
|
7
|
-
replace: (url: string) => void;
|
|
9
|
+
push: (url: string, as?: string, options?: RouterOptions) => void;
|
|
10
|
+
replace: (url: string, as?: string, options?: RouterOptions) => void;
|
|
8
11
|
}
|
|
9
12
|
export declare function useRouter(): Router;
|
|
10
13
|
export declare namespace useRouter {
|
|
11
14
|
var _impl: () => Router;
|
|
12
15
|
var setup: (impl: () => Router) => void;
|
|
13
16
|
}
|
|
17
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouter.js","sourceRoot":"","sources":["../../src/hooks/useRouter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRouter.js","sourceRoot":"","sources":["../../src/hooks/useRouter.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,SAAS;IACvB,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,CAAC,KAAK,GAAG,GAAW,EAAE,CAAC,CAAC;IAC/B,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,IAAI,IAAI,GAAG;IACtC,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG;IAC9C,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,GAAG,EAAE;QACT,aAAa;IACf,CAAC;IACD,OAAO,EAAE,GAAG,EAAE;QACZ,aAAa;IACf,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,CAAC,KAAK,GAAG,CAAC,IAAkB,EAAE,EAAE;IACvC,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;AACzB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultListItemType.js","sourceRoot":"","sources":["../../src/model/DefaultListItemType.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextItem.js","sourceRoot":"","sources":["../../src/model/RichTextItem.ts"],"names":[],"mappings":""}
|
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Router } from '../../hooks/useRouter';
|
|
2
2
|
import type { BlockDef } from '../../model/ContentPageDef';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export interface BlockIntersectionEvent {
|
|
7
|
-
block: BlockDef;
|
|
8
|
-
intersection: IntersectionObserverEntry;
|
|
9
|
-
}
|
|
10
|
-
interface EventMap {
|
|
11
|
-
goto: GotoAnchorEvent;
|
|
12
|
-
intersection: BlockIntersectionEvent;
|
|
13
|
-
}
|
|
14
|
-
export declare class BlockRouter {
|
|
15
|
-
static readonly inst: BlockRouter;
|
|
16
|
-
readonly eventBus: EventBus<EventMap>;
|
|
17
|
-
constructor();
|
|
18
|
-
goto(rawAnchor?: string): void;
|
|
19
|
-
push(rawAnchor: string): void;
|
|
20
|
-
replace(rawAnchor: string): void;
|
|
21
|
-
reset(): void;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
3
|
+
export declare function gotoBlock(router: Router, anchor?: string): void;
|
|
4
|
+
export declare function trackBlock(router: Router, block?: BlockDef): void;
|
|
@@ -1,30 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (anchor) {
|
|
10
|
-
this.eventBus.subject('goto', { anchor });
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
goto(rawAnchor) {
|
|
14
|
-
const anchor = normalizeAnchor(rawAnchor);
|
|
15
|
-
if (anchor) {
|
|
16
|
-
this.push(anchor);
|
|
17
|
-
this.eventBus.fire('goto', { anchor });
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
push(rawAnchor) {
|
|
21
|
-
globalThis.history?.pushState(null, '', getURLWithAnchor(rawAnchor));
|
|
22
|
-
}
|
|
23
|
-
replace(rawAnchor) {
|
|
24
|
-
globalThis.history?.replaceState(null, '', getURLWithAnchor(rawAnchor));
|
|
25
|
-
}
|
|
26
|
-
reset() {
|
|
27
|
-
globalThis.history?.replaceState(null, '', getURLWithAnchor());
|
|
28
|
-
}
|
|
1
|
+
const normalizeAnchor = (anchor) => anchor?.replace('#', '') || '';
|
|
2
|
+
export function gotoBlock(router, anchor) {
|
|
3
|
+
router.replace(`#${normalizeAnchor(anchor)}`);
|
|
4
|
+
}
|
|
5
|
+
export function trackBlock(router, block) {
|
|
6
|
+
router.replace(`#${normalizeAnchor(block?.anchor)}`, undefined, {
|
|
7
|
+
scroll: false,
|
|
8
|
+
});
|
|
29
9
|
}
|
|
30
10
|
//# sourceMappingURL=BlockRouter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockRouter.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockRouter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BlockRouter.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/BlockRouter.ts"],"names":[],"mappings":"AAGA,MAAM,eAAe,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAE5E,MAAM,UAAU,SAAS,CAAC,MAAc,EAAE,MAAe;IACvD,MAAM,CAAC,OAAO,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,KAAgB;IACzD,MAAM,CAAC,OAAO,CAAC,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE;QAC9D,MAAM,EAAE,KAAK;KACd,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EventBus } from '../../EventBus/EventBus';
|
|
2
|
+
import type { BlockDef } from '../../model/ContentPageDef';
|
|
3
|
+
export interface BlockIntersectionEvent {
|
|
4
|
+
block: BlockDef;
|
|
5
|
+
intersection: IntersectionObserverEntry;
|
|
6
|
+
}
|
|
7
|
+
interface EventMap {
|
|
8
|
+
intersection: BlockIntersectionEvent;
|
|
9
|
+
}
|
|
10
|
+
export declare const blockRouterEventBus: EventBus<EventMap>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockRouterEventBus.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/blockRouterEventBus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAYnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,QAAQ,EAAY,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { BlockDef } from '../../model/ContentPageDef';
|
|
2
|
-
|
|
3
|
-
export declare function useBlockIntersectionObserver(block?: BlockDef, router?: BlockRouter): {
|
|
2
|
+
export declare function useBlockIntersectionObserver(block?: BlockDef): {
|
|
4
3
|
current: Element | null;
|
|
5
4
|
};
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
import { useCallback
|
|
1
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { useIntersectionObserver } from '../../hooks/useIntersectionObserver.js';
|
|
3
|
-
import {
|
|
4
|
-
export function useBlockIntersectionObserver(block
|
|
3
|
+
import { blockRouterEventBus } from './blockRouterEventBus.js';
|
|
4
|
+
export function useBlockIntersectionObserver(block) {
|
|
5
5
|
const observerCallback = useCallback((entries) => {
|
|
6
6
|
if (!block || !entries?.length) {
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
9
|
const intersection = entries[entries.length - 1];
|
|
10
|
-
|
|
11
|
-
}, [block
|
|
12
|
-
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (!ref.current) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
return router.eventBus.subscribe('goto', ({ anchor }) => {
|
|
18
|
-
if (ref.current && block?.anchor === anchor) {
|
|
19
|
-
ref.current.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}, [block, router]);
|
|
23
|
-
return ref;
|
|
10
|
+
blockRouterEventBus.fire('intersection', { block, intersection });
|
|
11
|
+
}, [block]);
|
|
12
|
+
return useIntersectionObserver(observerCallback, { sensitivity: 1 });
|
|
24
13
|
}
|
|
25
14
|
//# sourceMappingURL=useBlockIntersectionObserver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"useBlockIntersectionObserver.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockIntersectionObserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,4BAA4B,CAAC,KAAgB;IAC3D,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,OAAoC,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;YAC9B,OAAO;SACR;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjD,mBAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IACpE,CAAC,EACD,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function useBlockRouterProvider(router?: BlockRouter, scrollTarget?: EventTarget): void;
|
|
1
|
+
export declare function useBlockRouterProvider(scrollTarget?: EventTarget): void;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useRouter } from '../../hooks/useRouter.js';
|
|
2
3
|
import { debounce } from '../../utils/debounce.js';
|
|
3
|
-
import {
|
|
4
|
+
import { trackBlock } from './BlockRouter.js';
|
|
5
|
+
import { blockRouterEventBus } from './blockRouterEventBus.js';
|
|
4
6
|
import { findActiveBlock } from './findActiveBlock.js';
|
|
5
7
|
const isScrolledEnough = () => globalThis.scrollY > (globalThis.innerHeight * 3) / 4;
|
|
6
|
-
export function useBlockRouterProvider(
|
|
8
|
+
export function useBlockRouterProvider(scrollTarget = globalThis) {
|
|
9
|
+
const router = useRouter();
|
|
7
10
|
const intersectionsMapRef = useRef(new Map());
|
|
8
|
-
useEffect(() =>
|
|
11
|
+
useEffect(() => blockRouterEventBus.subscribe('intersection', ({ block, intersection }) => {
|
|
9
12
|
if (intersectionsMapRef.current) {
|
|
10
13
|
intersectionsMapRef.current.set(block, intersection);
|
|
11
14
|
}
|
|
12
|
-
}), [
|
|
15
|
+
}), []);
|
|
13
16
|
useEffect(() => {
|
|
14
17
|
const handleScroll = debounce(() => {
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
if (isScrolledEnough()) {
|
|
19
|
+
const activeBlock = findActiveBlock([...(intersectionsMapRef.current || [])]);
|
|
20
|
+
trackBlock(router, activeBlock);
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
router.replace(activeBlock.anchor);
|
|
22
|
-
}
|
|
23
|
-
else if (!activeBlock) {
|
|
24
|
-
router.reset();
|
|
22
|
+
else {
|
|
23
|
+
trackBlock(router);
|
|
25
24
|
}
|
|
26
25
|
}, 100);
|
|
27
26
|
scrollTarget.addEventListener('scroll', handleScroll);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"useBlockRouterProvider.js","sourceRoot":"","sources":["../../../src/services/BlockRouter/useBlockRouterProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,UAAU,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAErF,MAAM,UAAU,sBAAsB,CAAC,eAA4B,UAAU;IAC3E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,mBAAmB,GAAG,MAAM,CAA2C,IAAI,GAAG,EAAE,CAAC,CAAC;IAExF,SAAS,CACP,GAAG,EAAE,CACH,mBAAmB,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE;QACxE,IAAI,mBAAmB,CAAC,OAAO,EAAE;YAC/B,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,EACJ,EAAE,CACH,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE;YACjC,IAAI,gBAAgB,EAAE,EAAE;gBACtB,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC9E,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;aACjC;iBAAM;gBACL,UAAU,CAAC,MAAM,CAAC,CAAC;aACpB;QACH,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,YAAY,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEtD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,EAAE,CAAC;YACvB,YAAY,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import type { DefaultListItemType } from '../../model/DefaultListItemType';
|
|
2
3
|
import type { DescriptionProps, LabelProps } from '../../model/HeadlineType';
|
|
3
4
|
import type { IconVersion } from '../../model/IconVersion';
|
|
4
5
|
import type { IconProps } from '../../model/Picture';
|
|
5
|
-
import {
|
|
6
|
+
import type { RichTextItem } from '../../model/RichTextItem';
|
|
6
7
|
export interface BenefitItemCommonProps {
|
|
7
8
|
/** @hidden */
|
|
8
9
|
benefitsVersion?: IconVersion;
|
|
@@ -15,24 +16,14 @@ export declare type BenefitItemProps = DescriptionProps & LabelProps & IconProps
|
|
|
15
16
|
/**
|
|
16
17
|
* @title Стандартный бенефит
|
|
17
18
|
*/
|
|
18
|
-
declare type DefaultBenefit = BenefitItemProps &
|
|
19
|
-
/** @default default */
|
|
20
|
-
type: 'default';
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* @title Форматированный текст
|
|
24
|
-
*/
|
|
25
|
-
declare type RichText = RichTextProps & {
|
|
26
|
-
/** @default rte */
|
|
27
|
-
type: 'rte';
|
|
28
|
-
};
|
|
19
|
+
declare type DefaultBenefit = BenefitItemProps & DefaultListItemType;
|
|
29
20
|
/**
|
|
30
21
|
* @title Преимущество
|
|
31
22
|
* @default{
|
|
32
23
|
* "type": "default"
|
|
33
24
|
* }
|
|
34
25
|
*/
|
|
35
|
-
export declare type ComplexBenefitProps = DefaultBenefit |
|
|
26
|
+
export declare type ComplexBenefitProps = DefaultBenefit | RichTextItem;
|
|
36
27
|
/**
|
|
37
28
|
* @title Преимущество
|
|
38
29
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
|
-
import {
|
|
4
|
+
import { defaultEventBus } from '../EventBus/defaultEventBus.js';
|
|
5
5
|
import { useBlockIntersectionObserver } from '../services/BlockRouter/useBlockIntersectionObserver.js';
|
|
6
6
|
import { style } from '../utils/style.js';
|
|
7
7
|
export const blockStyles = {
|
|
@@ -15,7 +15,7 @@ export const BlockWrapper = JSX(({ className = '', version = 'primary', block, t
|
|
|
15
15
|
const Tag = tag;
|
|
16
16
|
const ref = useBlockIntersectionObserver(block);
|
|
17
17
|
const [isVisible, setVisible] = useState(true);
|
|
18
|
-
useEffect(() =>
|
|
18
|
+
useEffect(() => defaultEventBus.subscribe('tab', (event) => {
|
|
19
19
|
if (event.type === 'group') {
|
|
20
20
|
const hasSettings = block?.labels?.length || block?.anchor;
|
|
21
21
|
setVisible(event.label ? !hasSettings || Boolean(block?.labels?.includes(event.label)) : true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BlockWrapper.js","sourceRoot":"","sources":["../../src/ui-kit/BlockWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAOvC,MAAM,CAAC,MAAM,WAAW,GAAiC;IACvD,OAAO,EAAE,4BAA4B;IACrC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mCAAmC;IACzC,WAAW,EAAE,kCAAkC;IAC/C,EAAE,EAAE,EAAE;CACP,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAClF,MAAM,GAAG,GAAQ,GAAG,CAAC;IAErB,MAAM,GAAG,GAAG,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st: EventBus<EventMap>;
|
|
1
|
+
export declare class EventBus<EM extends Record<string, any>> {
|
|
5
2
|
private subscribers;
|
|
6
3
|
private subjectsStateMap;
|
|
7
4
|
subscribe<K extends keyof EM>(type: K, listener: (event: EM[K]) => void): () => void;
|