@developer_tribe/react-builder 0.1.2 → 0.1.7
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 +2 -2
- package/dist/build-components/Carousel/Carousel.d.ts +2 -2
- package/dist/build-components/CarouselButtons/CarouselButtons.d.ts +2 -2
- package/dist/build-components/CarouselDots/CarouselDots.d.ts +2 -2
- package/dist/build-components/CarouselItem/CarouselItem.d.ts +2 -2
- package/dist/build-components/CarouselProvider/CarouselProvider.d.ts +2 -2
- package/dist/build-components/Image/Image.d.ts +2 -2
- package/dist/build-components/Onboard/Onboard.d.ts +2 -2
- package/dist/build-components/OnboardBoardTitle/OnboardBoardTitle.d.ts +2 -2
- package/dist/build-components/OnboardButton/OnboardButton.d.ts +2 -2
- package/dist/build-components/OnboardButtons/OnboardButtons.d.ts +2 -2
- package/dist/build-components/OnboardExpandingDot/OnboardExpandingDot.d.ts +2 -2
- package/dist/build-components/OnboardFooter/OnboardFooter.d.ts +2 -2
- package/dist/build-components/OnboardImage/OnboardImage.d.ts +2 -2
- package/dist/build-components/OnboardItem/OnboardItem.d.ts +2 -2
- package/dist/build-components/OnboardProvider/OnboardProvider.d.ts +2 -2
- package/dist/build-components/OnboardSubtitle/OnboardSubtitle.d.ts +2 -2
- package/dist/build-components/RenderNode.generated.d.ts +1 -1
- package/dist/build-components/Text/Text.d.ts +2 -2
- package/dist/build-components/View/View.d.ts +2 -2
- package/dist/build-components/other.d.ts +3 -0
- package/dist/utils/generateRandomKeyForNode.d.ts +1 -0
- package/package.json +9 -4
- package/scripts/{build-components.js → prebuild/build-components.js} +8 -30
- package/scripts/public/bin.js +57 -0
- package/scripts/public/scripts/build/index.js +42 -0
- package/scripts/public/scripts/build/info.json +17 -0
- package/scripts/public/scripts/build/utils/checkFolderAndFilesValid.js +41 -0
- package/scripts/public/scripts/build/utils/checkPathExists.js +9 -0
- package/scripts/public/scripts/build/utils/createMissingFoldersAndFiles.js +54 -0
- package/scripts/public/scripts/build/utils/createRenderNodeGenerated.js +82 -0
- package/scripts/public/scripts/build/utils/getAllComponents.js +11 -0
- package/src/build-components/Button/Button.tsx +2 -2
- package/src/build-components/Carousel/Carousel.tsx +2 -2
- package/src/build-components/CarouselButtons/CarouselButtons.tsx +2 -2
- package/src/build-components/CarouselDots/CarouselDots.tsx +2 -2
- package/src/build-components/CarouselItem/CarouselItem.tsx +2 -2
- package/src/build-components/CarouselProvider/CarouselProvider.tsx +2 -2
- package/src/build-components/Image/Image.tsx +2 -2
- package/src/build-components/Onboard/Onboard.tsx +2 -2
- package/src/build-components/OnboardBoardTitle/OnboardBoardTitle.tsx +2 -2
- package/src/build-components/OnboardButton/OnboardButton.tsx +2 -2
- package/src/build-components/OnboardButtons/OnboardButtons.tsx +2 -2
- package/src/build-components/OnboardExpandingDot/OnboardExpandingDot.tsx +2 -2
- package/src/build-components/OnboardFooter/OnboardFooter.tsx +2 -2
- package/src/build-components/OnboardImage/OnboardImage.tsx +2 -2
- package/src/build-components/OnboardItem/OnboardItem.tsx +2 -2
- package/src/build-components/OnboardProvider/OnboardProvider.tsx +2 -2
- package/src/build-components/OnboardSubtitle/OnboardSubtitle.tsx +2 -2
- package/src/build-components/Text/Text.tsx +2 -2
- package/src/build-components/View/View.tsx +3 -3
- package/src/utils/novaToJson.ts +0 -1
- package/dist/build-components/Button/ButtonProps.d.ts +0 -3
- package/dist/build-components/Carousel/CarouselProps.d.ts +0 -3
- package/dist/build-components/CarouselButtons/CarouselButtonsProps.d.ts +0 -3
- package/dist/build-components/CarouselDots/CarouselDotsProps.d.ts +0 -3
- package/dist/build-components/CarouselItem/CarouselItemProps.d.ts +0 -3
- package/dist/build-components/CarouselProvider/CarouselProviderProps.d.ts +0 -3
- package/dist/build-components/Image/ImageProps.d.ts +0 -3
- package/dist/build-components/Onboard/OnboardProps.d.ts +0 -3
- package/dist/build-components/OnboardBoardTitle/OnboardBoardTitleProps.d.ts +0 -3
- package/dist/build-components/OnboardButton/OnboardButtonProps.d.ts +0 -3
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.d.ts +0 -3
- package/dist/build-components/OnboardExpandingDot/OnboardExpandingDotProps.d.ts +0 -3
- package/dist/build-components/OnboardFooter/OnboardFooterProps.d.ts +0 -3
- package/dist/build-components/OnboardImage/OnboardImageProps.d.ts +0 -3
- package/dist/build-components/OnboardItem/OnboardItemProps.d.ts +0 -3
- package/dist/build-components/OnboardProvider/OnboardProviderProps.d.ts +0 -3
- package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.d.ts +0 -3
- package/dist/build-components/Text/TextProps.d.ts +0 -3
- package/dist/build-components/View/ViewProps.d.ts +0 -3
- package/src/build-components/Button/ButtonProps.ts +0 -3
- package/src/build-components/Carousel/CarouselProps.ts +0 -3
- package/src/build-components/CarouselButtons/CarouselButtonsProps.ts +0 -3
- package/src/build-components/CarouselDots/CarouselDotsProps.ts +0 -3
- package/src/build-components/CarouselItem/CarouselItemProps.ts +0 -3
- package/src/build-components/CarouselProvider/CarouselProviderProps.ts +0 -3
- package/src/build-components/Image/ImageProps.ts +0 -3
- package/src/build-components/Onboard/OnboardProps.ts +0 -3
- package/src/build-components/OnboardBoardTitle/OnboardBoardTitleProps.ts +0 -4
- package/src/build-components/OnboardButton/OnboardButtonProps.ts +0 -3
- package/src/build-components/OnboardButtons/OnboardButtonsProps.ts +0 -3
- package/src/build-components/OnboardExpandingDot/OnboardExpandingDotProps.ts +0 -4
- package/src/build-components/OnboardFooter/OnboardFooterProps.ts +0 -3
- package/src/build-components/OnboardImage/OnboardImageProps.ts +0 -3
- package/src/build-components/OnboardItem/OnboardItemProps.ts +0 -3
- package/src/build-components/OnboardProvider/OnboardProviderProps.ts +0 -3
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.ts +0 -3
- package/src/build-components/Text/TextProps.ts +0 -3
- package/src/build-components/View/ViewProps.ts +0 -3
- /package/scripts/{prebuild.js → prebuild/prebuild.js} +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import Path from 'path';
|
|
3
|
+
|
|
4
|
+
function readPatternType(builderComponentsPath, componentName) {
|
|
5
|
+
try {
|
|
6
|
+
const p = Path.join(builderComponentsPath, componentName, 'pattern.json');
|
|
7
|
+
const raw = fs.readFileSync(p, 'utf8');
|
|
8
|
+
const json = JSON.parse(raw.toString('utf8'));
|
|
9
|
+
const type = json?.pattern?.type;
|
|
10
|
+
if (typeof type === 'string' && type.length > 0) return type;
|
|
11
|
+
} catch {}
|
|
12
|
+
return componentName.toLowerCase();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createRenderNodeGenerated(
|
|
16
|
+
builderComponentsPath,
|
|
17
|
+
targetRootPath,
|
|
18
|
+
components
|
|
19
|
+
) {
|
|
20
|
+
const buildComponentsTarget = Path.join(
|
|
21
|
+
targetRootPath,
|
|
22
|
+
'src',
|
|
23
|
+
'build-components'
|
|
24
|
+
);
|
|
25
|
+
if (!fs.existsSync(buildComponentsTarget)) {
|
|
26
|
+
fs.mkdirSync(buildComponentsTarget, { recursive: true });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const targetPath = Path.join(
|
|
30
|
+
buildComponentsTarget,
|
|
31
|
+
'RenderNode.generated.tsx'
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const imports = components
|
|
35
|
+
.map(name => `import ${name} from './${name}/${name}';`)
|
|
36
|
+
.join('\n');
|
|
37
|
+
|
|
38
|
+
const cases = components
|
|
39
|
+
.map(name => {
|
|
40
|
+
const type = readPatternType(builderComponentsPath, name);
|
|
41
|
+
return ` case ${JSON.stringify(type)}:\n return <${name} node={simpleNode} />;`;
|
|
42
|
+
})
|
|
43
|
+
.join('\n');
|
|
44
|
+
|
|
45
|
+
const content = `/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
46
|
+
import React from 'react';
|
|
47
|
+
import { Node, NodeData, isNodeArray, isNodeNullOrUndefined, isNodeString } from '@developer_tribe/react-builder';
|
|
48
|
+
import { other } from './other';
|
|
49
|
+
${imports}
|
|
50
|
+
|
|
51
|
+
function RenderNode({ node }: { node: Node }) {
|
|
52
|
+
if (isNodeNullOrUndefined(node)) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
if (isNodeString(node)) {
|
|
56
|
+
return <Text node={{ children: node as string, type: 'text' }} />;
|
|
57
|
+
}
|
|
58
|
+
if (isNodeArray(node)) {
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
{(node as Node[]).map((item: Node, index) => (
|
|
62
|
+
<RenderNode key={index} node={item} />
|
|
63
|
+
))}
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const simpleNode = node as NodeData;
|
|
69
|
+
switch (simpleNode?.type) {
|
|
70
|
+
${cases}
|
|
71
|
+
default:
|
|
72
|
+
return other(simpleNode?.type, node);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default React.memo(RenderNode);
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
fs.writeFileSync(targetPath, content, 'utf8');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// no default export
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import Path from 'path';
|
|
3
|
+
|
|
4
|
+
// Get immediate subfolder names within the given build-components path
|
|
5
|
+
export function getAllComponents(buildComponentsPath) {
|
|
6
|
+
const items = fs.readdirSync(buildComponentsPath, { withFileTypes: true });
|
|
7
|
+
return items
|
|
8
|
+
.filter(item => item.isDirectory())
|
|
9
|
+
.map(dir => dir.name)
|
|
10
|
+
.sort();
|
|
11
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ButtonPropsGenerated } from './ButtonProps.generated';
|
|
4
4
|
|
|
5
5
|
type ButtonComponentProps = {
|
|
6
|
-
node: NodeData<
|
|
6
|
+
node: NodeData<ButtonPropsGenerated['attributes']>;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
function Button({ node }: ButtonComponentProps) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { CarouselPropsGenerated } from './CarouselProps.generated';
|
|
4
4
|
import RenderNode from '../RenderNode.generated';
|
|
5
5
|
import { isCarouselItem } from '../../utils/isCarousel';
|
|
6
6
|
|
|
7
7
|
type CarouselComponentProps = {
|
|
8
|
-
node: NodeData<
|
|
8
|
+
node: NodeData<CarouselPropsGenerated['attributes']>;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
function Carousel({ node }: CarouselComponentProps) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { CarouselButtonsPropsGenerated } from './CarouselButtonsProps.generated';
|
|
4
4
|
import { carouselContext } from '../CarouselProvider/CarouselProvider';
|
|
5
5
|
|
|
6
6
|
type CarouselButtonsComponentProps = {
|
|
7
|
-
node: NodeData<
|
|
7
|
+
node: NodeData<CarouselButtonsPropsGenerated['attributes']>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
function CarouselButtons({ node }: CarouselButtonsComponentProps) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState } from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { CarouselDotsPropsGenerated } from './CarouselDotsProps.generated';
|
|
4
4
|
import { carouselContext } from '../CarouselProvider/CarouselProvider';
|
|
5
5
|
|
|
6
6
|
type CarouselDotsComponentProps = {
|
|
7
|
-
node: NodeData<
|
|
7
|
+
node: NodeData<CarouselDotsPropsGenerated['attributes']>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
function CarouselDots({ node }: CarouselDotsComponentProps) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { CarouselItemPropsGenerated } from './CarouselItemProps.generated';
|
|
4
4
|
import { RenderNode } from '../..';
|
|
5
5
|
|
|
6
6
|
type CarouselItemComponentProps = {
|
|
7
|
-
node: NodeData<
|
|
7
|
+
node: NodeData<CarouselItemPropsGenerated['attributes']>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export function CarouselItem({ node }: CarouselItemComponentProps) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { createContext } from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { CarouselProviderPropsGenerated } from './CarouselProviderProps.generated';
|
|
4
4
|
import { RenderNode } from '../..';
|
|
5
5
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
6
6
|
|
|
7
7
|
type CarouselProviderComponentProps = {
|
|
8
|
-
node: NodeData<
|
|
8
|
+
node: NodeData<CarouselProviderPropsGenerated['attributes']>;
|
|
9
9
|
};
|
|
10
10
|
export const carouselContext = createContext<any>(undefined);
|
|
11
11
|
function CarouselProvider({ node }: CarouselProviderComponentProps) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ImagePropsGenerated } from './ImageProps.generated';
|
|
4
4
|
|
|
5
5
|
type ImageComponentProps = {
|
|
6
|
-
node: NodeData<
|
|
6
|
+
node: NodeData<ImagePropsGenerated['attributes']>;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
function Image({ node }: ImageComponentProps) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardPropsGenerated } from './OnboardProps.generated';
|
|
4
4
|
import Carousel from '../Carousel/Carousel';
|
|
5
5
|
|
|
6
6
|
type OnboardComponentProps = {
|
|
7
|
-
node: NodeData<
|
|
7
|
+
node: NodeData<OnboardPropsGenerated['attributes']>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
function Onboard({ node }: OnboardComponentProps) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardBoardTitlePropsGenerated } from './OnboardBoardTitleProps.generated';
|
|
4
4
|
import Text from '../Text/Text';
|
|
5
5
|
|
|
6
6
|
type OnboardBoardTitleComponentProps = {
|
|
7
|
-
node: NodeData<
|
|
7
|
+
node: NodeData<OnboardBoardTitlePropsGenerated['attributes']>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
function OnboardBoardTitle({ node }: OnboardBoardTitleComponentProps) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardButtonPropsGenerated } from './OnboardButtonProps.generated';
|
|
4
4
|
import { carouselContext } from '../CarouselProvider/CarouselProvider';
|
|
5
5
|
import { mainNodeContext } from '../../RenderMainNode';
|
|
6
6
|
|
|
7
7
|
type OnboardButtonComponentProps = {
|
|
8
|
-
node: NodeData<
|
|
8
|
+
node: NodeData<OnboardButtonPropsGenerated['attributes']>;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
function OnboardButton({ node }: OnboardButtonComponentProps) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState } from 'react';
|
|
2
2
|
import type { NodeData, Node } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardButtonsPropsGenerated } from './OnboardButtonsProps.generated';
|
|
4
4
|
import { carouselContext } from '../CarouselProvider/CarouselProvider';
|
|
5
5
|
import RenderNode from '../RenderNode.generated';
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ const THEME_COLORS = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
type OnboardButtonsComponentProps = {
|
|
12
|
-
node: NodeData<
|
|
12
|
+
node: NodeData<OnboardButtonsPropsGenerated['attributes']>;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
function OnboardButtons({ node }: OnboardButtonsComponentProps) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardExpandingDotPropsGenerated } from './OnboardExpandingDotProps.generated';
|
|
4
4
|
import CarouselDots from '../CarouselDots/CarouselDots';
|
|
5
5
|
|
|
6
6
|
type OnboardExpandingDotComponentProps = {
|
|
7
|
-
node: NodeData<
|
|
7
|
+
node: NodeData<OnboardExpandingDotPropsGenerated['attributes']>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
function OnboardExpandingDot({ node }: OnboardExpandingDotComponentProps) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardFooterPropsGenerated } from './OnboardFooterProps.generated';
|
|
4
4
|
|
|
5
5
|
type OnboardFooterComponentProps = {
|
|
6
|
-
node: NodeData<
|
|
6
|
+
node: NodeData<OnboardFooterPropsGenerated['attributes']>;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
function OnboardFooter({ node }: OnboardFooterComponentProps) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardImagePropsGenerated } from './OnboardImageProps.generated';
|
|
4
4
|
import Image from '../Image/Image';
|
|
5
5
|
|
|
6
6
|
type OnboardImageComponentProps = {
|
|
7
|
-
node: NodeData<
|
|
7
|
+
node: NodeData<OnboardImagePropsGenerated['attributes']>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
function OnboardImage({ node }: OnboardImageComponentProps) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardItemPropsGenerated } from './OnboardItemProps.generated';
|
|
4
4
|
import CarouselItem from '../CarouselItem/CarouselItem';
|
|
5
5
|
import { isNodeArray } from '../../utils/analyseNode';
|
|
6
6
|
|
|
7
7
|
type OnboardItemComponentProps = {
|
|
8
|
-
node: NodeData<
|
|
8
|
+
node: NodeData<OnboardItemPropsGenerated['attributes']>;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
function OnboardItem({ node }: OnboardItemComponentProps) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardProviderPropsGenerated } from './OnboardProviderProps.generated';
|
|
4
4
|
import { carouselContext } from '../CarouselProvider/CarouselProvider';
|
|
5
5
|
import { mainNodeContext } from '../../RenderMainNode';
|
|
6
6
|
import { isNodeArray } from '../../utils/analyseNode';
|
|
@@ -8,7 +8,7 @@ import useEmblaCarousel from 'embla-carousel-react';
|
|
|
8
8
|
import RenderNode from '../RenderNode.generated';
|
|
9
9
|
|
|
10
10
|
type OnboardProviderComponentProps = {
|
|
11
|
-
node: NodeData<
|
|
11
|
+
node: NodeData<OnboardProviderPropsGenerated['attributes']>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
function OnboardProvider({ node }: OnboardProviderComponentProps) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnboardSubtitlePropsGenerated } from './OnboardSubtitleProps.generated';
|
|
4
4
|
import Text from '../Text/Text';
|
|
5
5
|
|
|
6
6
|
type OnboardSubtitleComponentProps = {
|
|
7
|
-
node: NodeData<
|
|
7
|
+
node: NodeData<OnboardSubtitlePropsGenerated['attributes']>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
function OnboardSubtitle({ node }: OnboardSubtitleComponentProps) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import type { NodeData } from '../../types/Node';
|
|
3
|
-
import type {
|
|
3
|
+
import type { TextPropsGenerated } from './TextProps.generated';
|
|
4
4
|
import { mainNodeContext } from '../../RenderMainNode';
|
|
5
5
|
|
|
6
6
|
type TextComponentProps = {
|
|
7
|
-
node: NodeData<
|
|
7
|
+
node: NodeData<TextPropsGenerated['attributes']>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
function Text({ node }: TextComponentProps) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ViewPropsGenerated } from './ViewProps.generated';
|
|
3
3
|
import RenderNode from '../RenderNode.generated';
|
|
4
4
|
import { Node, NodeData } from '../../types/Node';
|
|
5
5
|
|
|
6
6
|
function mapAttributesToStyle(
|
|
7
|
-
attributes:
|
|
7
|
+
attributes: ViewPropsGenerated['attributes'],
|
|
8
8
|
): React.CSSProperties {
|
|
9
9
|
const scrollable = attributes?.scrollable ?? false;
|
|
10
10
|
const style: React.CSSProperties = {
|
|
@@ -45,7 +45,7 @@ function mapAttributesToStyle(
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
type ViewComponentProps = {
|
|
48
|
-
node: NodeData<
|
|
48
|
+
node: NodeData<ViewPropsGenerated['attributes']>;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
export function View({ node }: ViewComponentProps) {
|
package/src/utils/novaToJson.ts
CHANGED
|
File without changes
|