@developer_tribe/react-builder 0.1.7 → 0.1.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/dist/build-components/Button/Button.d.ts +1 -5
- package/dist/build-components/Button/ButtonProps.generated.d.ts +4 -0
- package/dist/build-components/Carousel/Carousel.d.ts +1 -5
- package/dist/build-components/Carousel/CarouselProps.generated.d.ts +4 -0
- package/dist/build-components/CarouselButtons/CarouselButtons.d.ts +1 -5
- package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +4 -0
- package/dist/build-components/CarouselDots/CarouselDots.d.ts +1 -5
- package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +4 -0
- package/dist/build-components/CarouselItem/CarouselItem.d.ts +1 -5
- package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +4 -0
- package/dist/build-components/CarouselProvider/CarouselProvider.d.ts +1 -5
- package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +4 -0
- package/dist/build-components/Image/Image.d.ts +1 -5
- package/dist/build-components/Image/ImageProps.generated.d.ts +4 -0
- package/dist/build-components/Onboard/Onboard.d.ts +1 -5
- package/dist/build-components/Onboard/OnboardProps.generated.d.ts +4 -0
- package/dist/build-components/OnboardBoardTitle/OnboardBoardTitle.d.ts +1 -5
- package/dist/build-components/OnboardBoardTitle/OnboardBoardTitleProps.generated.d.ts +4 -0
- package/dist/build-components/OnboardButton/OnboardButton.d.ts +1 -5
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +4 -0
- package/dist/build-components/OnboardButtons/OnboardButtons.d.ts +1 -5
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +4 -0
- package/dist/build-components/OnboardDot/OnboardDot.d.ts +5 -0
- package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +10 -0
- package/dist/build-components/OnboardDot/OnboardExpandingDotProps.generated.d.ts +10 -0
- package/dist/build-components/OnboardFooter/OnboardFooter.d.ts +1 -5
- package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +4 -0
- package/dist/build-components/OnboardImage/OnboardImage.d.ts +1 -5
- package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +4 -0
- package/dist/build-components/OnboardItem/OnboardItem.d.ts +1 -5
- package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +4 -0
- package/dist/build-components/OnboardProvider/OnboardProvider.d.ts +1 -5
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +4 -0
- package/dist/build-components/OnboardSubtitle/OnboardSubtitle.d.ts +1 -5
- package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +4 -0
- package/dist/build-components/Text/Text.d.ts +1 -5
- package/dist/build-components/Text/TextProps.generated.d.ts +4 -0
- package/dist/build-components/View/View.d.ts +1 -5
- package/dist/build-components/View/ViewProps.generated.d.ts +4 -0
- package/dist/build-components/index.d.ts +19 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/package.json +4 -3
- package/scripts/prebuild/build-components.js +20 -502
- package/scripts/prebuild/utils/createBuildComponentsIndex.js +24 -0
- package/scripts/prebuild/utils/createComponentTsx.js +21 -0
- package/scripts/prebuild/utils/createGeneratedProps.js +65 -0
- package/scripts/prebuild/utils/createRenderNodeGenerated.js +69 -0
- package/scripts/prebuild/utils/ensureDir.js +5 -0
- package/scripts/prebuild/utils/ensurePropsTs.js +15 -0
- package/scripts/prebuild/utils/fail.js +7 -0
- package/scripts/prebuild/utils/formatAllSourceFiles.js +39 -0
- package/scripts/prebuild/utils/formatWithPrettier.js +10 -0
- package/scripts/prebuild/utils/index.js +15 -0
- package/scripts/prebuild/utils/lintNonGeneratedOrThrow.js +27 -0
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +156 -0
- package/scripts/prebuild/utils/validateExistingComponentTsx.js +40 -0
- package/scripts/prebuild/utils/validatePatternJson.js +77 -0
- package/scripts/public/bin.js +1 -6
- package/scripts/public/scripts/build/index.js +3 -3
- package/scripts/public/scripts/build/utils/createMissingFoldersAndFiles.js +1 -1
- package/src/build-components/Button/Button.tsx +1 -6
- package/src/build-components/Button/ButtonProps.generated.ts +6 -0
- package/src/build-components/Carousel/Carousel.tsx +1 -6
- package/src/build-components/Carousel/CarouselProps.generated.ts +6 -0
- package/src/build-components/CarouselButtons/CarouselButtons.tsx +1 -6
- package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +6 -0
- package/src/build-components/CarouselDots/CarouselDots.tsx +1 -6
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +6 -0
- package/src/build-components/CarouselItem/CarouselItem.tsx +1 -6
- package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +6 -0
- package/src/build-components/CarouselProvider/CarouselProvider.tsx +1 -5
- package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +6 -0
- package/src/build-components/Image/Image.tsx +1 -6
- package/src/build-components/Image/ImageProps.generated.ts +6 -0
- package/src/build-components/Onboard/Onboard.tsx +1 -6
- package/src/build-components/Onboard/OnboardProps.generated.ts +6 -0
- package/src/build-components/OnboardBoardTitle/OnboardBoardTitle.tsx +1 -6
- package/src/build-components/OnboardBoardTitle/OnboardBoardTitleProps.generated.ts +6 -0
- package/src/build-components/OnboardButton/OnboardButton.tsx +1 -6
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +6 -0
- package/src/build-components/OnboardButtons/OnboardButtons.tsx +2 -6
- package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +6 -0
- package/src/build-components/OnboardDot/OnboardDot.tsx +9 -0
- package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +20 -0
- package/src/build-components/{OnboardExpandingDot → OnboardDot}/OnboardExpandingDotProps.generated.ts +7 -1
- package/src/build-components/{OnboardExpandingDot → OnboardDot}/pattern.json +1 -1
- package/src/build-components/OnboardFooter/OnboardFooter.tsx +1 -6
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +6 -0
- package/src/build-components/OnboardImage/OnboardImage.tsx +1 -6
- package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +6 -0
- package/src/build-components/OnboardItem/OnboardItem.tsx +1 -5
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +6 -0
- package/src/build-components/OnboardProvider/OnboardProvider.tsx +1 -5
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +6 -0
- package/src/build-components/OnboardSubtitle/OnboardSubtitle.tsx +1 -6
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +6 -0
- package/src/build-components/RenderNode.generated.tsx +3 -3
- package/src/build-components/Text/Text.tsx +1 -6
- package/src/build-components/Text/TextProps.generated.ts +6 -0
- package/src/build-components/View/View.tsx +5 -6
- package/src/build-components/View/ViewProps.generated.ts +6 -0
- package/src/build-components/index.ts +78 -0
- package/src/index.ts +1 -0
- package/src/utils/novaToJson.ts +1 -1
- package/src/utils/patterns.ts +1 -1
- package/dist/build-components/OnboardExpandingDot/OnboardExpandingDot.d.ts +0 -9
- package/dist/build-components/OnboardExpandingDot/OnboardExpandingDotProps.generated.d.ts +0 -6
- package/src/build-components/OnboardExpandingDot/OnboardExpandingDot.tsx +0 -14
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import React, { createContext } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { CarouselProviderPropsGenerated } from './CarouselProviderProps.generated';
|
|
2
|
+
import type { CarouselProviderComponentProps } from './CarouselProviderProps.generated';
|
|
4
3
|
import { RenderNode } from '../..';
|
|
5
4
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
6
5
|
|
|
7
|
-
type CarouselProviderComponentProps = {
|
|
8
|
-
node: NodeData<CarouselProviderPropsGenerated['attributes']>;
|
|
9
|
-
};
|
|
10
6
|
export const carouselContext = createContext<any>(undefined);
|
|
11
7
|
function CarouselProvider({ node }: CarouselProviderComponentProps) {
|
|
12
8
|
const [emblaRef, emblaApi] = useEmblaCarousel(node.attributes as any);
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface CarouselProviderPropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {};
|
|
6
8
|
}
|
|
9
|
+
|
|
10
|
+
export interface CarouselProviderComponentProps {
|
|
11
|
+
node: NodeData<CarouselProviderPropsGenerated['attributes']>;
|
|
12
|
+
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { ImagePropsGenerated } from './ImageProps.generated';
|
|
4
|
-
|
|
5
|
-
type ImageComponentProps = {
|
|
6
|
-
node: NodeData<ImagePropsGenerated['attributes']>;
|
|
7
|
-
};
|
|
2
|
+
import type { ImageComponentProps } from './ImageProps.generated';
|
|
8
3
|
|
|
9
4
|
function Image({ node }: ImageComponentProps) {
|
|
10
5
|
return (
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface ImagePropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {
|
|
@@ -10,3 +12,7 @@ export interface ImagePropsGenerated {
|
|
|
10
12
|
borderRadius?: number;
|
|
11
13
|
};
|
|
12
14
|
}
|
|
15
|
+
|
|
16
|
+
export interface ImageComponentProps {
|
|
17
|
+
node: NodeData<ImagePropsGenerated['attributes']>;
|
|
18
|
+
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { OnboardPropsGenerated } from './OnboardProps.generated';
|
|
2
|
+
import type { OnboardComponentProps } from './OnboardProps.generated';
|
|
4
3
|
import Carousel from '../Carousel/Carousel';
|
|
5
4
|
|
|
6
|
-
type OnboardComponentProps = {
|
|
7
|
-
node: NodeData<OnboardPropsGenerated['attributes']>;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
5
|
function Onboard({ node }: OnboardComponentProps) {
|
|
11
6
|
return <Carousel node={{ ...node, type: 'carousel' } as any} />;
|
|
12
7
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface OnboardPropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {};
|
|
6
8
|
}
|
|
9
|
+
|
|
10
|
+
export interface OnboardComponentProps {
|
|
11
|
+
node: NodeData<OnboardPropsGenerated['attributes']>;
|
|
12
|
+
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { OnboardBoardTitlePropsGenerated } from './OnboardBoardTitleProps.generated';
|
|
2
|
+
import type { OnboardBoardTitleComponentProps } from './OnboardBoardTitleProps.generated';
|
|
4
3
|
import Text from '../Text/Text';
|
|
5
4
|
|
|
6
|
-
type OnboardBoardTitleComponentProps = {
|
|
7
|
-
node: NodeData<OnboardBoardTitlePropsGenerated['attributes']>;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
5
|
function OnboardBoardTitle({ node }: OnboardBoardTitleComponentProps) {
|
|
11
6
|
return (
|
|
12
7
|
<Text
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface OnboardBoardTitlePropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {
|
|
@@ -19,3 +21,7 @@ export interface OnboardBoardTitlePropsGenerated {
|
|
|
19
21
|
| '900';
|
|
20
22
|
};
|
|
21
23
|
}
|
|
24
|
+
|
|
25
|
+
export interface OnboardBoardTitleComponentProps {
|
|
26
|
+
node: NodeData<OnboardBoardTitlePropsGenerated['attributes']>;
|
|
27
|
+
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { OnboardButtonPropsGenerated } from './OnboardButtonProps.generated';
|
|
2
|
+
import type { OnboardButtonComponentProps } from './OnboardButtonProps.generated';
|
|
4
3
|
import { carouselContext } from '../CarouselProvider/CarouselProvider';
|
|
5
4
|
import { mainNodeContext } from '../../RenderMainNode';
|
|
6
5
|
|
|
7
|
-
type OnboardButtonComponentProps = {
|
|
8
|
-
node: NodeData<OnboardButtonPropsGenerated['attributes']>;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
6
|
function OnboardButton({ node }: OnboardButtonComponentProps) {
|
|
12
7
|
const emblaApi = useContext(carouselContext);
|
|
13
8
|
const { localication, defaultLanguage } = useContext(mainNodeContext) ?? {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface OnboardButtonPropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {
|
|
@@ -11,3 +13,7 @@ export interface OnboardButtonPropsGenerated {
|
|
|
11
13
|
events?: string;
|
|
12
14
|
};
|
|
13
15
|
}
|
|
16
|
+
|
|
17
|
+
export interface OnboardButtonComponentProps {
|
|
18
|
+
node: NodeData<OnboardButtonPropsGenerated['attributes']>;
|
|
19
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { Node } from '../../types/Node';
|
|
3
|
+
import type { OnboardButtonsComponentProps } from './OnboardButtonsProps.generated';
|
|
4
4
|
import { carouselContext } from '../CarouselProvider/CarouselProvider';
|
|
5
5
|
import RenderNode from '../RenderNode.generated';
|
|
6
6
|
|
|
@@ -8,10 +8,6 @@ const THEME_COLORS = {
|
|
|
8
8
|
ONBOARD_SEPARATOR_COLOR: '#E5E7EB',
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
type OnboardButtonsComponentProps = {
|
|
12
|
-
node: NodeData<OnboardButtonsPropsGenerated['attributes']>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
11
|
function OnboardButtons({ node }: OnboardButtonsComponentProps) {
|
|
16
12
|
const emblaApi = useContext(carouselContext);
|
|
17
13
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface OnboardButtonsPropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {
|
|
@@ -10,3 +12,7 @@ export interface OnboardButtonsPropsGenerated {
|
|
|
10
12
|
seperatorColor?: string;
|
|
11
13
|
};
|
|
12
14
|
}
|
|
15
|
+
|
|
16
|
+
export interface OnboardButtonsComponentProps {
|
|
17
|
+
node: NodeData<OnboardButtonsPropsGenerated['attributes']>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OnboardDotComponentProps } from './OnboardExpandingDotProps.generated';
|
|
3
|
+
import CarouselDots from '../CarouselDots/CarouselDots';
|
|
4
|
+
|
|
5
|
+
function OnboardDot({ node }: OnboardDotComponentProps) {
|
|
6
|
+
return <CarouselDots node={{ ...node, type: 'carouselDots' } as any} />;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default React.memo(OnboardDot);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
|
+
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
5
|
+
export interface OnboardDotPropsGenerated {
|
|
6
|
+
child: string;
|
|
7
|
+
attributes: {
|
|
8
|
+
dotType?:
|
|
9
|
+
| 'expanding_dot'
|
|
10
|
+
| 'normal_dot'
|
|
11
|
+
| 'scaling_dot'
|
|
12
|
+
| 'sliding_border'
|
|
13
|
+
| 'sliding_dot'
|
|
14
|
+
| 'liquid_like';
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface OnboardDotComponentProps {
|
|
19
|
+
node: NodeData<OnboardDotPropsGenerated['attributes']>;
|
|
20
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
5
|
+
export interface OnboardDotPropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {
|
|
6
8
|
dotType?:
|
|
@@ -12,3 +14,7 @@ export interface OnboardExpandingDotPropsGenerated {
|
|
|
12
14
|
| 'liquid_like';
|
|
13
15
|
};
|
|
14
16
|
}
|
|
17
|
+
|
|
18
|
+
export interface OnboardDotComponentProps {
|
|
19
|
+
node: NodeData<OnboardDotPropsGenerated['attributes']>;
|
|
20
|
+
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { OnboardFooterPropsGenerated } from './OnboardFooterProps.generated';
|
|
4
|
-
|
|
5
|
-
type OnboardFooterComponentProps = {
|
|
6
|
-
node: NodeData<OnboardFooterPropsGenerated['attributes']>;
|
|
7
|
-
};
|
|
2
|
+
import type { OnboardFooterComponentProps } from './OnboardFooterProps.generated';
|
|
8
3
|
|
|
9
4
|
function OnboardFooter({ node }: OnboardFooterComponentProps) {
|
|
10
5
|
return String(node?.type ?? 'OnboardFooter');
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface OnboardFooterPropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {
|
|
@@ -22,3 +24,7 @@ export interface OnboardFooterPropsGenerated {
|
|
|
22
24
|
height?: number;
|
|
23
25
|
};
|
|
24
26
|
}
|
|
27
|
+
|
|
28
|
+
export interface OnboardFooterComponentProps {
|
|
29
|
+
node: NodeData<OnboardFooterPropsGenerated['attributes']>;
|
|
30
|
+
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { OnboardImagePropsGenerated } from './OnboardImageProps.generated';
|
|
2
|
+
import type { OnboardImageComponentProps } from './OnboardImageProps.generated';
|
|
4
3
|
import Image from '../Image/Image';
|
|
5
4
|
|
|
6
|
-
type OnboardImageComponentProps = {
|
|
7
|
-
node: NodeData<OnboardImagePropsGenerated['attributes']>;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
5
|
function OnboardImage({ node }: OnboardImageComponentProps) {
|
|
11
6
|
return <Image node={{ ...node, type: 'image' } as any} />;
|
|
12
7
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface OnboardImagePropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {
|
|
@@ -10,3 +12,7 @@ export interface OnboardImagePropsGenerated {
|
|
|
10
12
|
borderRadius?: number;
|
|
11
13
|
};
|
|
12
14
|
}
|
|
15
|
+
|
|
16
|
+
export interface OnboardImageComponentProps {
|
|
17
|
+
node: NodeData<OnboardImagePropsGenerated['attributes']>;
|
|
18
|
+
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardItemComponentProps } from './OnboardItemProps.generated';
|
|
4
4
|
import CarouselItem from '../CarouselItem/CarouselItem';
|
|
5
5
|
import { isNodeArray } from '../../utils/analyseNode';
|
|
6
6
|
|
|
7
|
-
type OnboardItemComponentProps = {
|
|
8
|
-
node: NodeData<OnboardItemPropsGenerated['attributes']>;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
7
|
function OnboardItem({ node }: OnboardItemComponentProps) {
|
|
12
8
|
const children = useMemo(() => {
|
|
13
9
|
return (
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface OnboardItemPropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {};
|
|
6
8
|
}
|
|
9
|
+
|
|
10
|
+
export interface OnboardItemComponentProps {
|
|
11
|
+
node: NodeData<OnboardItemPropsGenerated['attributes']>;
|
|
12
|
+
}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardProviderComponentProps } from './OnboardProviderProps.generated';
|
|
4
4
|
import { carouselContext } from '../CarouselProvider/CarouselProvider';
|
|
5
5
|
import { mainNodeContext } from '../../RenderMainNode';
|
|
6
6
|
import { isNodeArray } from '../../utils/analyseNode';
|
|
7
7
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
8
8
|
import RenderNode from '../RenderNode.generated';
|
|
9
9
|
|
|
10
|
-
type OnboardProviderComponentProps = {
|
|
11
|
-
node: NodeData<OnboardProviderPropsGenerated['attributes']>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
10
|
function OnboardProvider({ node }: OnboardProviderComponentProps) {
|
|
15
11
|
const [emblaRef, emblaApi] = useEmblaCarousel(node.attributes as any);
|
|
16
12
|
const { theme, setWarning } = useContext(mainNodeContext) ?? {};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface OnboardProviderPropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {};
|
|
6
8
|
}
|
|
9
|
+
|
|
10
|
+
export interface OnboardProviderComponentProps {
|
|
11
|
+
node: NodeData<OnboardProviderPropsGenerated['attributes']>;
|
|
12
|
+
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { OnboardSubtitlePropsGenerated } from './OnboardSubtitleProps.generated';
|
|
2
|
+
import type { OnboardSubtitleComponentProps } from './OnboardSubtitleProps.generated';
|
|
4
3
|
import Text from '../Text/Text';
|
|
5
4
|
|
|
6
|
-
type OnboardSubtitleComponentProps = {
|
|
7
|
-
node: NodeData<OnboardSubtitlePropsGenerated['attributes']>;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
5
|
function OnboardSubtitle({ node }: OnboardSubtitleComponentProps) {
|
|
11
6
|
return (
|
|
12
7
|
<Text
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface OnboardSubtitlePropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {
|
|
@@ -19,3 +21,7 @@ export interface OnboardSubtitlePropsGenerated {
|
|
|
19
21
|
| '900';
|
|
20
22
|
};
|
|
21
23
|
}
|
|
24
|
+
|
|
25
|
+
export interface OnboardSubtitleComponentProps {
|
|
26
|
+
node: NodeData<OnboardSubtitlePropsGenerated['attributes']>;
|
|
27
|
+
}
|
|
@@ -23,7 +23,7 @@ import Onboard from './Onboard/Onboard';
|
|
|
23
23
|
import OnboardBoardTitle from './OnboardBoardTitle/OnboardBoardTitle';
|
|
24
24
|
import OnboardButton from './OnboardButton/OnboardButton';
|
|
25
25
|
import OnboardButtons from './OnboardButtons/OnboardButtons';
|
|
26
|
-
import
|
|
26
|
+
import OnboardDot from './OnboardDot/OnboardDot';
|
|
27
27
|
import OnboardFooter from './OnboardFooter/OnboardFooter';
|
|
28
28
|
import OnboardImage from './OnboardImage/OnboardImage';
|
|
29
29
|
import OnboardItem from './OnboardItem/OnboardItem';
|
|
@@ -73,8 +73,8 @@ function RenderNode({ node }: { node: Node }) {
|
|
|
73
73
|
return <OnboardButton node={simpleNode} />;
|
|
74
74
|
case 'OnboardButtons':
|
|
75
75
|
return <OnboardButtons node={simpleNode} />;
|
|
76
|
-
case '
|
|
77
|
-
return <
|
|
76
|
+
case 'OnboardDot':
|
|
77
|
+
return <OnboardDot node={simpleNode} />;
|
|
78
78
|
case 'OnboardFooter':
|
|
79
79
|
return <OnboardFooter node={simpleNode} />;
|
|
80
80
|
case 'OnboardImage':
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { TextPropsGenerated } from './TextProps.generated';
|
|
2
|
+
import type { TextComponentProps } from './TextProps.generated';
|
|
4
3
|
import { mainNodeContext } from '../../RenderMainNode';
|
|
5
4
|
|
|
6
|
-
type TextComponentProps = {
|
|
7
|
-
node: NodeData<TextPropsGenerated['attributes']>;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
5
|
function Text({ node }: TextComponentProps) {
|
|
11
6
|
const { localication, defaultLanguage } = useContext(mainNodeContext) ?? {};
|
|
12
7
|
const keyOrText: string = node.children as string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface TextPropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {
|
|
@@ -19,3 +21,7 @@ export interface TextPropsGenerated {
|
|
|
19
21
|
| '900';
|
|
20
22
|
};
|
|
21
23
|
}
|
|
24
|
+
|
|
25
|
+
export interface TextComponentProps {
|
|
26
|
+
node: NodeData<TextPropsGenerated['attributes']>;
|
|
27
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
ViewComponentProps,
|
|
4
|
+
ViewPropsGenerated,
|
|
5
|
+
} from './ViewProps.generated';
|
|
3
6
|
import RenderNode from '../RenderNode.generated';
|
|
4
|
-
import { Node
|
|
7
|
+
import { Node } from '../../types/Node';
|
|
5
8
|
|
|
6
9
|
function mapAttributesToStyle(
|
|
7
10
|
attributes: ViewPropsGenerated['attributes'],
|
|
@@ -44,10 +47,6 @@ function mapAttributesToStyle(
|
|
|
44
47
|
return style;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
|
-
type ViewComponentProps = {
|
|
48
|
-
node: NodeData<ViewPropsGenerated['attributes']>;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
50
|
export function View({ node }: ViewComponentProps) {
|
|
52
51
|
return (
|
|
53
52
|
<div
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
2
|
|
|
3
|
+
import type { NodeData } from '../../types/Node';
|
|
4
|
+
|
|
3
5
|
export interface ViewPropsGenerated {
|
|
4
6
|
child: string;
|
|
5
7
|
attributes: {
|
|
@@ -22,3 +24,7 @@ export interface ViewPropsGenerated {
|
|
|
22
24
|
height?: number;
|
|
23
25
|
};
|
|
24
26
|
}
|
|
27
|
+
|
|
28
|
+
export interface ViewComponentProps {
|
|
29
|
+
node: NodeData<ViewPropsGenerated['attributes']>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
|
+
|
|
3
|
+
export type {
|
|
4
|
+
ButtonPropsGenerated,
|
|
5
|
+
ButtonComponentProps,
|
|
6
|
+
} from './Button/ButtonProps.generated';
|
|
7
|
+
export type {
|
|
8
|
+
CarouselPropsGenerated,
|
|
9
|
+
CarouselComponentProps,
|
|
10
|
+
} from './Carousel/CarouselProps.generated';
|
|
11
|
+
export type {
|
|
12
|
+
CarouselButtonsPropsGenerated,
|
|
13
|
+
CarouselButtonsComponentProps,
|
|
14
|
+
} from './CarouselButtons/CarouselButtonsProps.generated';
|
|
15
|
+
export type {
|
|
16
|
+
CarouselDotsPropsGenerated,
|
|
17
|
+
CarouselDotsComponentProps,
|
|
18
|
+
} from './CarouselDots/CarouselDotsProps.generated';
|
|
19
|
+
export type {
|
|
20
|
+
CarouselItemPropsGenerated,
|
|
21
|
+
CarouselItemComponentProps,
|
|
22
|
+
} from './CarouselItem/CarouselItemProps.generated';
|
|
23
|
+
export type {
|
|
24
|
+
CarouselProviderPropsGenerated,
|
|
25
|
+
CarouselProviderComponentProps,
|
|
26
|
+
} from './CarouselProvider/CarouselProviderProps.generated';
|
|
27
|
+
export type {
|
|
28
|
+
ImagePropsGenerated,
|
|
29
|
+
ImageComponentProps,
|
|
30
|
+
} from './Image/ImageProps.generated';
|
|
31
|
+
export type {
|
|
32
|
+
OnboardPropsGenerated,
|
|
33
|
+
OnboardComponentProps,
|
|
34
|
+
} from './Onboard/OnboardProps.generated';
|
|
35
|
+
export type {
|
|
36
|
+
OnboardBoardTitlePropsGenerated,
|
|
37
|
+
OnboardBoardTitleComponentProps,
|
|
38
|
+
} from './OnboardBoardTitle/OnboardBoardTitleProps.generated';
|
|
39
|
+
export type {
|
|
40
|
+
OnboardButtonPropsGenerated,
|
|
41
|
+
OnboardButtonComponentProps,
|
|
42
|
+
} from './OnboardButton/OnboardButtonProps.generated';
|
|
43
|
+
export type {
|
|
44
|
+
OnboardButtonsPropsGenerated,
|
|
45
|
+
OnboardButtonsComponentProps,
|
|
46
|
+
} from './OnboardButtons/OnboardButtonsProps.generated';
|
|
47
|
+
export type {
|
|
48
|
+
OnboardDotPropsGenerated,
|
|
49
|
+
OnboardDotComponentProps,
|
|
50
|
+
} from './OnboardDot/OnboardDotProps.generated';
|
|
51
|
+
export type {
|
|
52
|
+
OnboardFooterPropsGenerated,
|
|
53
|
+
OnboardFooterComponentProps,
|
|
54
|
+
} from './OnboardFooter/OnboardFooterProps.generated';
|
|
55
|
+
export type {
|
|
56
|
+
OnboardImagePropsGenerated,
|
|
57
|
+
OnboardImageComponentProps,
|
|
58
|
+
} from './OnboardImage/OnboardImageProps.generated';
|
|
59
|
+
export type {
|
|
60
|
+
OnboardItemPropsGenerated,
|
|
61
|
+
OnboardItemComponentProps,
|
|
62
|
+
} from './OnboardItem/OnboardItemProps.generated';
|
|
63
|
+
export type {
|
|
64
|
+
OnboardProviderPropsGenerated,
|
|
65
|
+
OnboardProviderComponentProps,
|
|
66
|
+
} from './OnboardProvider/OnboardProviderProps.generated';
|
|
67
|
+
export type {
|
|
68
|
+
OnboardSubtitlePropsGenerated,
|
|
69
|
+
OnboardSubtitleComponentProps,
|
|
70
|
+
} from './OnboardSubtitle/OnboardSubtitleProps.generated';
|
|
71
|
+
export type {
|
|
72
|
+
TextPropsGenerated,
|
|
73
|
+
TextComponentProps,
|
|
74
|
+
} from './Text/TextProps.generated';
|
|
75
|
+
export type {
|
|
76
|
+
ViewPropsGenerated,
|
|
77
|
+
ViewComponentProps,
|
|
78
|
+
} from './View/ViewProps.generated';
|
package/src/index.ts
CHANGED
package/src/utils/novaToJson.ts
CHANGED
|
@@ -219,7 +219,7 @@ function mapDotsFromGeneralComponents(generalComponents: any[]): Node | null {
|
|
|
219
219
|
| 'sliding_dot'
|
|
220
220
|
| 'liquid_like';
|
|
221
221
|
return {
|
|
222
|
-
type: '
|
|
222
|
+
type: 'OnboardDot',
|
|
223
223
|
attributes: dotType ? { dotType } : undefined,
|
|
224
224
|
children: undefined as unknown as Node,
|
|
225
225
|
} as unknown as NodeData;
|
package/src/utils/patterns.ts
CHANGED
|
@@ -16,7 +16,7 @@ import onboardButtonPattern from '../build-components/OnboardButton/pattern.json
|
|
|
16
16
|
import onboardBoardTitlePattern from '../build-components/OnboardBoardTitle/pattern.json';
|
|
17
17
|
import onboardSubtitlePattern from '../build-components/OnboardSubtitle/pattern.json';
|
|
18
18
|
import onboardFooterPattern from '../build-components/OnboardFooter/pattern.json';
|
|
19
|
-
import onboardExpandingDotPattern from '../build-components/
|
|
19
|
+
import onboardExpandingDotPattern from '../build-components/OnboardDot/pattern.json';
|
|
20
20
|
|
|
21
21
|
type Pattern = {
|
|
22
22
|
schemaVersion: number;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type { OnboardExpandingDotPropsGenerated } from './OnboardExpandingDotProps.generated';
|
|
4
|
-
type OnboardExpandingDotComponentProps = {
|
|
5
|
-
node: NodeData<OnboardExpandingDotPropsGenerated['attributes']>;
|
|
6
|
-
};
|
|
7
|
-
declare function OnboardExpandingDot({ node }: OnboardExpandingDotComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare const _default: React.MemoExoticComponent<typeof OnboardExpandingDot>;
|
|
9
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type { OnboardExpandingDotPropsGenerated } from './OnboardExpandingDotProps.generated';
|
|
4
|
-
import CarouselDots from '../CarouselDots/CarouselDots';
|
|
5
|
-
|
|
6
|
-
type OnboardExpandingDotComponentProps = {
|
|
7
|
-
node: NodeData<OnboardExpandingDotPropsGenerated['attributes']>;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
function OnboardExpandingDot({ node }: OnboardExpandingDotComponentProps) {
|
|
11
|
-
return <CarouselDots node={{ ...node, type: 'carouselDots' } as any} />;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default React.memo(OnboardExpandingDot);
|