@builder.io/sdk-react-nextjs 0.5.2 → 0.5.3

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.
Files changed (34) hide show
  1. package/dist/blocks/button/button.d.ts +1 -0
  2. package/dist/blocks/columns/columns.d.ts +1 -0
  3. package/dist/blocks/custom-code/custom-code.d.ts +1 -0
  4. package/dist/blocks/embed/embed.d.ts +1 -0
  5. package/dist/blocks/fragment/fragment.d.ts +1 -0
  6. package/dist/blocks/image/image.d.ts +1 -0
  7. package/dist/blocks/img/img.d.ts +1 -0
  8. package/dist/blocks/section/section.d.ts +1 -0
  9. package/dist/blocks/symbol/symbol.d.ts +1 -0
  10. package/dist/blocks/text/text.d.ts +1 -0
  11. package/dist/blocks/video/video.d.ts +1 -0
  12. package/dist/components/block/block.d.ts +1 -0
  13. package/dist/components/block/components/block-styles.d.ts +1 -0
  14. package/dist/components/block/components/block-wrapper.d.ts +1 -0
  15. package/dist/components/block/components/component-ref/component-ref.d.ts +1 -0
  16. package/dist/components/block/components/interactive-element.d.ts +1 -0
  17. package/dist/components/block/components/repeated-block.d.ts +1 -0
  18. package/dist/components/blocks/blocks-wrapper.d.ts +1 -0
  19. package/dist/components/blocks/blocks.d.ts +1 -0
  20. package/dist/components/content/components/enable-editor.d.ts +1 -0
  21. package/dist/components/content/components/styles.d.ts +1 -0
  22. package/dist/components/content/content.d.ts +1 -0
  23. package/dist/components/content-variants/content-variants.d.ts +1 -0
  24. package/dist/components/content-variants/content-variants.js +12 -6
  25. package/dist/components/inlined-script.d.ts +1 -0
  26. package/dist/components/inlined-styles.d.ts +1 -0
  27. package/dist/constants/sdk-version.d.ts +1 -1
  28. package/dist/constants/sdk-version.js +1 -1
  29. package/dist/functions/evaluate/acorn.d.ts +0 -0
  30. package/dist/functions/evaluate/acorn.js +2432 -0
  31. package/dist/functions/evaluate/evaluate.js +19 -1
  32. package/dist/functions/evaluate/interpreter.js +1 -1
  33. package/dist/functions/evaluate/types.d.ts +1 -0
  34. package/package.json +10 -2
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * This import is used by the Svelte SDK. Do not remove.
3
4
  */ export interface ButtonProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type Column = {
2
3
  blocks: BuilderBlock[];
3
4
  width?: number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface CustomCodeProps {
2
3
  code: string;
3
4
  replaceNodes?: boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface EmbedProps {
2
3
  content: string;
3
4
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FragmentProps {
2
3
  maxWidth?: number;
3
4
  attributes?: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface ImageProps {
2
3
  className?: string;
3
4
  image: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * This import is used by the Svelte SDK. Do not remove.
3
4
  */ export interface ImgProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * This import is used by the Svelte SDK. Do not remove.
3
4
  */ export interface SectionProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * This import is used by the Svelte SDK. Do not remove.
3
4
  */ export interface SymbolInfo {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface TextProps {
2
3
  text?: string;
3
4
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface VideoProps {
2
3
  attributes?: any;
3
4
  video?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type BlockProps = {
2
3
  block: BuilderBlock;
3
4
  context: BuilderContextInterface;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type BlockStylesProps = {
2
3
  block: BuilderBlock;
3
4
  context: BuilderContextInterface;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * This import is used by the Svelte SDK. Do not remove.
3
4
  */ type BlockWrapperProps = {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { ComponentProps } from "./component-ref.helpers.js";
2
3
  declare function ComponentRef(props: ComponentProps): JSX.Element;
3
4
  export default ComponentRef;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type InteractiveElementProps = {
2
3
  Wrapper: any;
3
4
  block: BuilderBlock;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type Props = {
2
3
  block: BuilderBlock;
3
4
  repeatContext: BuilderContextInterface;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type BlocksWrapperProps = {
2
3
  blocks: BuilderBlock[] | undefined;
3
4
  parent: string | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type BlocksProps = Partial<BlocksWrapperProps> & {
2
3
  context?: BuilderContextInterface;
3
4
  registeredComponents?: RegisteredComponents;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type BuilderEditorProps = Omit<ContentProps, "customComponents" | "data" | "apiVersion" | "isSsrAbTest"> & {
2
3
  builderContextSignal: BuilderContextInterface;
3
4
  setBuilderContextSignal?: (signal: any) => any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props {
2
3
  cssCode?: string;
3
4
  customFonts?: CustomFont[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { ContentProps } from "./content.types.js";
2
3
  declare function ContentComponent(props: ContentProps): JSX.Element;
3
4
  export default ContentComponent;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type VariantsProviderProps = ContentVariantsProps & {
2
3
  /**
3
4
  * For internal use only. Do not provide this prop.
@@ -22,6 +22,17 @@ function ContentVariants(props) {
22
22
  .map((value) => `.variant-${value.testVariationId} { display: none; } `)
23
23
  .join("");
24
24
  };
25
+ const defaultContent = function defaultContent() {
26
+ return shouldRenderVariants
27
+ ? {
28
+ ...props.content,
29
+ testVariationId: props.content?.id,
30
+ }
31
+ : handleABTestingSync({
32
+ item: props.content,
33
+ canTrack: getDefaultCanTrack(props.canTrack),
34
+ });
35
+ };
25
36
  return (React.createElement(React.Fragment, null,
26
37
  !props.__isNestedRender && TARGET !== "reactNative" ? (React.createElement(React.Fragment, null,
27
38
  React.createElement(InlinedScript, { scriptStr: getScriptString() }))) : null,
@@ -29,11 +40,6 @@ function ContentVariants(props) {
29
40
  React.createElement(InlinedStyles, { id: `variants-styles-${props.content?.id}`, styles: hideVariantsStyleString() }),
30
41
  React.createElement(InlinedScript, { scriptStr: variantScriptStr() }),
31
42
  getVariants(props.content)?.map((variant) => (React.createElement(ContentComponent, { key: variant.testVariationId, content: variant, showContent: false, classNameProp: undefined, model: props.model, data: props.data, context: props.context, apiKey: props.apiKey, apiVersion: props.apiVersion, customComponents: props.customComponents, canTrack: props.canTrack, locale: props.locale, includeRefs: props.includeRefs, enrich: props.enrich, isSsrAbTest: shouldRenderVariants }))))) : null,
32
- React.createElement(ContentComponent, { content: shouldRenderVariants
33
- ? props.content
34
- : handleABTestingSync({
35
- item: props.content,
36
- canTrack: getDefaultCanTrack(props.canTrack),
37
- }), classNameProp: `variant-${props.content?.id}`, showContent: true, model: props.model, data: props.data, context: props.context, apiKey: props.apiKey, apiVersion: props.apiVersion, customComponents: props.customComponents, canTrack: props.canTrack, locale: props.locale, includeRefs: props.includeRefs, enrich: props.enrich, isSsrAbTest: shouldRenderVariants })));
43
+ React.createElement(ContentComponent, { content: defaultContent(), classNameProp: `variant-${props.content?.id}`, showContent: true, model: props.model, data: props.data, context: props.context, apiKey: props.apiKey, apiVersion: props.apiVersion, customComponents: props.customComponents, canTrack: props.canTrack, locale: props.locale, includeRefs: props.includeRefs, enrich: props.enrich, isSsrAbTest: shouldRenderVariants })));
38
44
  }
39
45
  export default ContentVariants;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props {
2
3
  scriptStr: string;
3
4
  id?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props {
2
3
  styles: string;
3
4
  id?: string;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.5.2";
1
+ export declare const SDK_VERSION = "UNKNOWN_VERSION";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.5.2";
1
+ export const SDK_VERSION = 'UNKNOWN_VERSION';
File without changes