UNPKG

xobuilder-extractor

Version:

> **A sophisticated web application that converts HTML and CSS to JSON layout through an intelligent multi-step flow process with AI validation.**

365 lines (364 loc) 11 kB
import { ValueWithDevice } from './general.entity'; import { StyleEntity } from './style.entity'; export type SectionRawV2 = SectionRawData | GridRawData | ColumnRawData | WrapperRawData | HeadingRawData | DividerRawData | ParagraphRawData | ButtonRawData | IconRawData | ImageRawData | AccordionRawData | AccordionItemRawData | AccordionHeaderRawData | AccordionContentRawData | AccordionIconRawData | ListRawData | ListItemRawData | ExternalVideoRawData | HTMLVideoRawData | HTMLIconRawData | MarqueeRawData | CalloutRawData | QRCodeRawData | MapRawData | GalleryRawData | GalleryItemRawData | MasonryRawData | MasonryItemRawData | FreedomRawData | TabRawData | TabPaneRawData | CarouselRawData | CarouselContentRawData | CarouselNavigationRawData | CarouselNavigationNextRawData | CarouselNavigationPrevRawData | CarouselPaginationRawData | CarouselSlideRawData; export type SectionRawData = { type: string; containerWidth: string; containerGapSelector: string; containerGap: ValueWithDevice<string>; maxWidth: ValueWithDevice<string>; heightSelector: string; minHeight: ValueWithDevice<string>; alignContent: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type GridRawData = { type: string; column: ValueWithDevice<string>; verticalGap?: ValueWithDevice<string>; horizontalGap?: ValueWithDevice<string>; children: SectionRawV2[]; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; }; export type ColumnRawData = { type: string; col?: ValueWithDevice<string>; row?: ValueWithDevice<string>; alignSelf?: string; columnOrder?: ValueWithDevice<string>; children: SectionRawV2[]; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; }; export type WrapperRawData = { type: string; layoutStyle?: string; wrapperWidth?: string; horizontalPosition?: ValueWithDevice<string>; maxWidth?: ValueWithDevice<string>; verticalSpacing?: ValueWithDevice<string>; horizontalSpacing?: ValueWithDevice<string>; horizontalAlign?: ValueWithDevice<string>; verticalAlign?: ValueWithDevice<string>; position?: string; positionAbsolute?: ValueWithDevice<string>; styles?: StyleEntity.StyleRawData; css_code?: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type HeadingRawData = { type: string; title: string; htmlTag: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; }; export type ParagraphRawData = { type: string; text: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; }; export type DividerRawData = { type: string; fullWidthEnabled?: string; align?: string; height?: ValueWithDevice<string>; color?: string; styles?: StyleEntity.StyleRawData; css_code?: string; visibility?: Record<string, boolean>; }; export type ButtonRawData = { type: string; buttonText: string; iconEnabled?: boolean; iconPosition?: string; styles: StyleEntity.StyleRawData; css_code: string; children: SectionRawV2[]; visibility?: Record<string, boolean>; }; export type IconRawData = { type: string; icon?: string; begin: string; group: string; size?: ValueWithDevice<string>; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; }; export type ImageRawData = { type: string; url: string; alt: string; styles: StyleEntity.StyleRawData; css_code: string; }; export type AccordionRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: AccordionItemRawData[]; }; export type AccordionItemRawData = { type: string; speed?: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: AccordionHeaderRawData[]; }; export type AccordionHeaderRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type AccordionContentRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type AccordionIconRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; begin: string; beginActive: string; visibility?: Record<string, boolean>; }; export type ListRawData = { type: string; listType?: string; markerType?: string; itemSpacings?: ValueWithDevice<string>; verticalAlign?: ValueWithDevice<string>; horizontalAlign?: ValueWithDevice<string>; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: ListItemRawData[]; }; export type ListItemRawData = { type: string; text?: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type ExternalVideoRawData = { type: string; url?: string; poster?: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: HTMLIconRawData[]; }; export type HTMLVideoRawData = { type: string; url?: string; poster?: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: HTMLIconRawData[]; }; export type HTMLIconRawData = { type: string; icon?: string; size?: ValueWithDevice<string>; "icon-position"?: string; begin: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; }; export type MarqueeRawData = { type: string; rightToLeft?: boolean; pauseOnHover?: boolean; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type CalloutRawData = { type: string; spacing?: ValueWithDevice<string>; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type QRCodeRawData = { type: string; content?: string; alt?: string; qrSize?: string; qrWidth?: ValueWithDevice<string>; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; }; export type MapRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; }; export type GalleryRawData = { type: string; grid?: ValueWithDevice<string>; rowHeight?: ValueWithDevice<string>; verticalGap?: ValueWithDevice<string>; horizontalGap?: ValueWithDevice<string>; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: GalleryItemRawData[]; }; export type GalleryItemRawData = { type: string; image?: string; column?: string; row?: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; }; export type MasonryRawData = { type: string; itemSpacing?: ValueWithDevice<string>; itemsPerRow?: ValueWithDevice<string>; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: MasonryItemRawData[]; }; export type MasonryItemRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type FreedomRawData = { type: string; x?: ValueWithDevice<string>; y?: ValueWithDevice<string>; width?: ValueWithDevice<string>; height?: ValueWithDevice<string>; verticalAlignment?: ValueWithDevice<string>; horizontalAlignment?: ValueWithDevice<string>; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type TabRawData = { type: string; header_position?: string; itemSpacing?: ValueWithDevice<string>; tab_header_color?: string; active_color?: string; active_background_color?: string; inactive_color?: string; inactive_background_color?: string; underline_color?: string; nav_border_color?: string; nav_border_radius?: ValueWithDevice<string>; nav_max_width?: ValueWithDevice<string>; header_full_width?: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: TabPaneRawData[]; }; export type TabPaneRawData = { type: string; title?: string; description?: string; enable_icon?: boolean; icon?: string; icon_size?: ValueWithDevice<string>; spacing?: ValueWithDevice<string>; icon_position?: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type CarouselRawData = { type: string; slider_displayed?: ValueWithDevice<string>; itemSpacing?: ValueWithDevice<string>; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type CarouselContentRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type CarouselNavigationRawData = { type: string; position: string; direction: string; placement: string; verticalSpacing: ValueWithDevice<string>; horizontalSpacing: ValueWithDevice<string>; verticalAlign: string; horizontalAlign: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type CarouselNavigationNextRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type CarouselNavigationPrevRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; }; export type CarouselPaginationRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; }; export type CarouselSlideRawData = { type: string; styles: StyleEntity.StyleRawData; css_code: string; visibility?: Record<string, boolean>; children: SectionRawV2[]; };