@developer_tribe/react-builder 1.2.2 → 1.2.4
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/RenderPage.d.ts +3 -1
- package/dist/build-components/PaywallOptions/PaywallOptionButton.d.ts +1 -1
- package/dist/components/BuilderProvider.d.ts +17 -0
- package/dist/components/Checkbox.d.ts +1 -1
- package/dist/components/RenderErrorBoundary.d.ts +1 -1
- package/dist/hooks/useExtractImageStyle.d.ts +3 -0
- package/dist/hooks/useExtractTextStyle.d.ts +1 -7
- package/dist/hooks/useExtractViewStyle.d.ts +1 -7
- package/dist/hooks/useLocalize.d.ts +4 -1
- package/dist/hooks/useSafeAreaViewStyle.d.ts +2 -1
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.cjs.js +1 -28
- package/dist/index.native.cjs.js.map +1 -1
- package/dist/index.native.esm.js +1 -28
- package/dist/index.native.esm.js.map +1 -1
- package/dist/types/Node.d.ts +1 -0
- package/dist/utils/extractTextStyle/extractTextStyle.d.ts +4 -0
- package/dist/utils/extractViewStyle/extractViewStyle.d.ts +1 -2
- package/dist/utils/parseColor.d.ts +1 -2
- package/package.json +1 -1
- package/src/RenderPage.tsx +35 -20
- package/src/build-components/BIcon/BIcon.tsx +8 -14
- package/src/build-components/BackgroundImage/BackgroundImage.tsx +9 -13
- package/src/build-components/Button/Button.tsx +11 -20
- package/src/build-components/Carousel/Carousel.tsx +8 -14
- package/src/build-components/CarouselButtons/CarouselButtons.tsx +2 -8
- package/src/build-components/CarouselDots/CarouselDots.tsx +3 -10
- package/src/build-components/CarouselItem/CarouselItem.tsx +2 -8
- package/src/build-components/CarouselProvider/CarouselProvider.tsx +2 -8
- package/src/build-components/Image/Image.tsx +11 -17
- package/src/build-components/Main/Main.tsx +10 -18
- package/src/build-components/OnboardButton/OnboardButton.tsx +7 -15
- package/src/build-components/OnboardButtons/OnboardButtons.tsx +7 -14
- package/src/build-components/OnboardDot/OnboardDot.tsx +23 -23
- package/src/build-components/OnboardFooter/OnboardFooter.tsx +16 -20
- package/src/build-components/OnboardImage/OnboardImage.tsx +10 -12
- package/src/build-components/OnboardItem/OnboardItem.tsx +2 -10
- package/src/build-components/OnboardProvider/OnboardProvider.tsx +2 -12
- package/src/build-components/PaywallBackground/PaywallBackground.tsx +8 -11
- package/src/build-components/PaywallCloseButton/PaywallCloseButton.tsx +9 -16
- package/src/build-components/PaywallOptions/PaywallOptionButton.tsx +11 -14
- package/src/build-components/PaywallProvider/PaywallProvider.tsx +15 -19
- package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButton.tsx +10 -16
- package/src/build-components/RadioButton/RadioButton.tsx +11 -20
- package/src/build-components/Text/Text.tsx +13 -21
- package/src/build-components/View/View.tsx +9 -12
- package/src/build-components/other.tsx +1 -1
- package/src/components/BuilderProvider.tsx +39 -6
- package/src/hooks/useExtractImageStyle.ts +19 -0
- package/src/hooks/useExtractTextStyle.ts +12 -16
- package/src/hooks/useExtractViewStyle.ts +7 -16
- package/src/hooks/useLocalize.ts +7 -6
- package/src/hooks/useSafeAreaViewStyle.ts +4 -5
- package/src/index.ts +9 -7
- package/src/pages/ProjectDebug.tsx +16 -15
- package/src/pages/ProjectPage.tsx +17 -5
- package/src/types/Node.ts +1 -0
- package/src/utils/extractTextStyle/extractTextStyle.ts +32 -13
- package/src/utils/extractViewStyle/extractViewStyle.ts +2 -3
- package/src/utils/parseColor.ts +4 -5
package/dist/RenderPage.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Node } from './types/Node';
|
|
2
|
+
import { type BuilderProviderParams } from './components/BuilderProvider';
|
|
2
3
|
export type ScreenStyle = {
|
|
3
4
|
light: {
|
|
4
5
|
backgroundColor: string;
|
|
@@ -15,6 +16,7 @@ interface RenderPageProps {
|
|
|
15
16
|
data: Node;
|
|
16
17
|
name: string;
|
|
17
18
|
onSelectNode?: (node: Node | null) => void;
|
|
19
|
+
params: BuilderProviderParams;
|
|
18
20
|
}
|
|
19
|
-
export declare function RenderPage({ data, name, onSelectNode }: RenderPageProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function RenderPage({ data, name, onSelectNode, params, }: RenderPageProps): import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
export {};
|
|
@@ -4,6 +4,6 @@ export type OptionsButtonProps = {
|
|
|
4
4
|
product: Product;
|
|
5
5
|
selected: boolean;
|
|
6
6
|
onPress: (productId: string) => void;
|
|
7
|
-
node: NodeData<
|
|
7
|
+
node: NodeData<Record<string, unknown>>;
|
|
8
8
|
};
|
|
9
9
|
export declare function PaywallOptionButton({ product, selected, onPress, node, }: OptionsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Product } from '../paywall/types/paywall-types';
|
|
3
3
|
import type { PaywallBenefits } from '../paywall/types/benefits';
|
|
4
|
+
import type { AppConfig } from '../types/PreviewConfig';
|
|
5
|
+
import type { Fonts } from '../types/Fonts';
|
|
6
|
+
import type { ProjectColors } from '../types/Project';
|
|
4
7
|
export type Products = Product;
|
|
5
8
|
export type BuilderProviderParams = {
|
|
6
9
|
products: Products[];
|
|
7
10
|
benefits: PaywallBenefits;
|
|
8
11
|
onPaywallClose?: () => void;
|
|
9
12
|
onPaywallSubscribe?: (product?: Product) => void | boolean | Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Optional runtime config + styling inputs.
|
|
15
|
+
* These are intentionally passed down via BuilderProvider so `build-components`
|
|
16
|
+
* never need to touch `useRenderStore`.
|
|
17
|
+
*/
|
|
18
|
+
appConfig?: AppConfig;
|
|
19
|
+
projectColors?: ProjectColors;
|
|
20
|
+
fonts?: Fonts;
|
|
21
|
+
appFont?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Optional selection info (used by builder UI; ignored by host runtime).
|
|
24
|
+
*/
|
|
25
|
+
previewMode?: boolean;
|
|
26
|
+
selectedKey?: string;
|
|
10
27
|
};
|
|
11
28
|
type BuilderProviderProps = {
|
|
12
29
|
params: BuilderProviderParams;
|
|
@@ -7,7 +7,7 @@ export type CheckboxProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 't
|
|
|
7
7
|
inputClassName?: string;
|
|
8
8
|
onChange?: CheckboxChangeHandler;
|
|
9
9
|
};
|
|
10
|
-
export declare const Checkbox: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
10
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "type" | "className"> & {
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
helperText?: React.ReactNode;
|
|
13
13
|
className?: string;
|
|
@@ -23,6 +23,6 @@ export declare class RenderErrorBoundary extends React.Component<RenderErrorBoun
|
|
|
23
23
|
private buildDetails;
|
|
24
24
|
private copyDetails;
|
|
25
25
|
private reset;
|
|
26
|
-
render(): string | number | boolean |
|
|
26
|
+
render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
27
27
|
}
|
|
28
28
|
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { NodeData } from '../types/Node';
|
|
2
|
+
import type { ImagePropsGenerated } from '../build-components/Image/ImageProps.generated';
|
|
3
|
+
export declare function useExtractImageStyle<T extends ImagePropsGenerated['attributes']>(node: NodeData<T>): import("react").CSSProperties;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import type { NodeData } from '../types/Node';
|
|
2
2
|
import type { TextPropsGenerated } from '../build-components/Text/TextProps.generated';
|
|
3
|
-
|
|
4
|
-
import type { ProjectColors } from '../types/Project';
|
|
5
|
-
export type UseExtractTextStyleOptions = {
|
|
6
|
-
appConfig?: AppConfig;
|
|
7
|
-
projectColors?: ProjectColors;
|
|
8
|
-
};
|
|
9
|
-
export declare function useExtractTextStyle<T extends TextPropsGenerated['attributes']>(node: NodeData<T>, options?: UseExtractTextStyleOptions): import("react").CSSProperties;
|
|
3
|
+
export declare function useExtractTextStyle<T extends TextPropsGenerated['attributes']>(node: NodeData<T>): import("react").CSSProperties;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import type { NodeData } from '../types/Node';
|
|
2
2
|
import type { ViewPropsGenerated } from '../build-components/View/ViewProps.generated';
|
|
3
|
-
|
|
4
|
-
import type { ProjectColors } from '../types/Project';
|
|
5
|
-
export type UseExtractViewStyleOptions = {
|
|
6
|
-
appConfig?: AppConfig;
|
|
7
|
-
projectColors?: ProjectColors;
|
|
8
|
-
};
|
|
9
|
-
export declare function useExtractViewStyle<T extends ViewPropsGenerated['attributes']>(node: NodeData<T>, options?: UseExtractViewStyleOptions): import("react").CSSProperties;
|
|
3
|
+
export declare function useExtractViewStyle<T extends ViewPropsGenerated['attributes']>(node: NodeData<T>): import("react").CSSProperties;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Device } from '../types/Device';
|
|
2
|
+
export declare function useSafeAreaViewStyle(baseStyle: React.CSSProperties, enabled: boolean, device?: Device): import("react").CSSProperties;
|