import type { TypeOfSectionAction } from './sectionActionTypes'; import type { ComponentBlock } from './sections/CustomSection/types'; import type { CB_CONTENT_PROP_VISIBILITY_SPECS } from './sections/CustomSection/util/contentPropParsers/parseContentVisibility'; import type { CB_EFFECT_PROP_ENTANIM_SPECS } from './sections/CustomSection/util/effectPropParsers/parseEffectPropEntAnim'; import type { CB_LAYOUT_PROP_PADDING_SPECS } from './sections/CustomSection/util/layoutPropParsers/parseLayoutPropPadding'; import type { CB_STYLE_PROP_BGCOLOR_SPECS } from './sections/CustomSection/util/stylePropParsers/parseStylePropBgColor'; import type { CB_STYLE_PROP_BGOVERLAY_SPECS } from './sections/CustomSection/util/stylePropParsers/parseStylePropBgOverlay'; import type { Block, ZOrder } from 'publ-echo/dist/lib/GridLayoutEditor/group'; import type { Ref } from 'react'; export { TypeOfSectionAction }; export type TypeOfSectionManifestSchema = 'BASE_INTRO' | 'BASE_CONTENTS' | 'BASE_CONTENTS_CAROUSEL' | 'BASE_FOOTER' | 'BASE_INFO_BOX' | 'EXP_IFRAME' | 'PRG_MEMBERSHIP_DISPLAY' | 'CUSTOM'; export type TypeofSectionTemplate = 'BASE_INTRO_A' | 'BASE_INTRO_B' | 'BASE_INTRO_C' | 'BASE_INTRO_D' | 'BASE_CONTENTS_A' | 'BASE_CONTENTS_B' | 'BASE_CONTENTS_CAROUSEL_A' | 'BASE_CONTENTS_CAROUSEL_B' | 'BASE_FOOTER_A' | 'BASE_FOOTER_B' | 'BASE_INFO_BOX_A' | 'EXP_IFRAME_A' | 'PRG_MEMBERSHIP_DISPLAY_A' | 'PRG_MEMBERSHIP_DISPLAY_B' | null | undefined; export type TypeOfSectionContentMediaType = 'IMAGE' | 'YOUTUBE'; export type TypeOfSectionLinkType = 'WEB_LINK' | 'INTERNAL_LINK' | 'NONE'; export type TypeOfSectionType = 'PROGRAMMED' | 'DESIGNED' | 'CUSTOM'; export type TypeOfCarouselAutoplayMode = 'AUTO' | 'MANUAL'; export type TypeOfCarouselInfiniteLoopMode = 'USE' | 'NO_USE'; export type TypeOfBackgroundMediaType = 'IMAGE' | 'YOUTUBE'; export type TypeOfSectionButtonDesignType = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I'; export type TypeOfItemButtonDesignType = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I'; export type TypeOfItemManifestSchema = 'BASE_CONTENTS_CAROUSEL_ITEM' | 'BASE_FOOTER_ITEM' | 'BASE_INFO_BOX_ITEM'; export type TypeOfItemLinkMethod = 'CLICK_ITEM' | 'CLICK_BUTTON_IN_ITEM' | 'NONE'; export type TypeOfItemLinkType = 'WEB_LINK' | 'INTERNAL_LINK' | 'NONE'; export type TypeOfItemToneType = 'LIGHT' | 'DARK'; export type TypeOfProgrammedItemActionButtonTextType = 'A' | 'B' | 'C' | 'D' | 'E'; type KeyOfSectionProperties = 'title' | 'description' | 'section_content_media_type' | 'section_content_media_src' | 'button_alpha_label' | 'button_alpha_link_type' | 'button_alpha_link_src' | 'button_bravo_label' | 'button_bravo_link_type' | 'button_bravo_link_src' | 'button_charlie_label' | 'button_charlie_link_type' | 'button_charlie_link_src' | 'button_delta_label' | 'button_delta_link_type' | 'button_delta_link_src' | 'button_echo_label' | 'button_echo_link_type' | 'button_echo_link_src' | 'carousel_autoplay_mode' | 'carousel_autoplay_time' | 'carousel_infinite_loop_mode' | 'item_link_method' | 'multi_purpose_url'; type KeyOfSectionStyles = 'title_color_in_hex' | 'description_color_in_hex' | 'background_color_in_hex' | 'background_media_type' | 'background_media_src' | 'background_overlay_color_in_hex' | 'button_alpha_design_type' | 'button_alpha_background_color_in_hex' | 'button_alpha_label_color_in_hex' | 'button_bravo_design_type' | 'button_bravo_background_color_in_hex' | 'button_bravo_label_color_in_hex' | 'button_charlie_design_type' | 'button_charlie_background_color_in_hex' | 'button_charlie_label_color_in_hex' | 'button_delta_design_type' | 'button_delta_background_color_in_hex' | 'button_delta_label_color_in_hex' | 'button_echo_design_type' | 'button_echo_background_color_in_hex' | 'button_echo_label_color_in_hex' | 'item_title_color_in_hex' | 'item_description_color_in_hex' | 'item_button_design_type' | 'item_button_background_color_in_hex' | 'item_button_label_color_in_hex' | 'item_highlighting_color_in_hex' | 'item_tone_type' | 'programmed_item_action_button_text_type'; type KeyOfItemProperties = 'title' | 'description' | 'body' | 'logo_image_src' | 'image_src' | 'link_type' | 'link_src' | 'button_label'; export interface ISection { id: number; administrativeTitle?: string; display: boolean; order: number; manifest: { schema: TypeOfSectionManifestSchema; availableProperties: Array; availableStyles: Array; availableTemplates: Array; } | Record; template: TypeofSectionTemplate; properties: ISectionProperties; styles: ISectionStyles; dynamicLayoutSectionItems: Array | null; insertedAt: string; updatedAt: string; type: TypeOfSectionType; program?: 'MEMBERSHIP_DISPLAY'; programData?: { mdid: string; preview: { availableResources: ['REAL.MEMBERSHIP_DISPLAY']; resources: { mock: Record; real: { membershipDisplay: IMembershipDisplay; }; }; }; }; componentBlocks?: ComponentBlock[]; jsonProperties?: ISectionJsonProperties; } export type SectionPedigree = Block; export interface SubscriptionProductInList { id: number; type: SubscriptionProductType; title: string; alias: string; expiryPeriodInDays: ExpiryPeriodInDaysType; isDeactivated: boolean; fee: { currency: 'KRW' | 'USD'; amount: string; }; insertedAt: string; updatedAt: string; } export interface ISectionProperties { title: string; description: string; sectionContentMediaType: TypeOfSectionContentMediaType; sectionContentMediaSrc: string; buttonAlphaLabel: string; buttonAlphaLinkType: TypeOfSectionLinkType; buttonAlphaLinkSrc: string; buttonBravoLabel: string; buttonBravoLinkType: TypeOfSectionLinkType; buttonBravoLinkSrc: string; buttonCharlieLabel: string; buttonCharlieLinkType: TypeOfSectionLinkType; buttonCharlieLinkSrc: string; buttonDeltaLabel: string; buttonDeltaLinkType: TypeOfSectionLinkType; buttonDeltaLinkSrc: string; buttonEchoLabel: string; buttonEchoLinkType: TypeOfSectionLinkType; buttonEchoLinkSrc: string; carouselAutoplayMode: TypeOfCarouselAutoplayMode; carouselAutoplayTime: number; carouselInfiniteLoopMode: TypeOfCarouselInfiniteLoopMode; itemLinkMethod: TypeOfItemLinkMethod; multiPurposeUrl: string; } export interface ISectionStyles { titleColorInHex: string; descriptionColorInHex: string; backgroundColorInHex: string; backgroundMediaType: TypeOfBackgroundMediaType; backgroundMediaSrc: string; backgroundOverlayColorInHex: string; buttonAlphaDesignType: TypeOfSectionButtonDesignType; buttonAlphaBackgroundColorInHex: string; buttonAlphaLabelColorInHex: string; buttonBravoDesignType: TypeOfSectionButtonDesignType; buttonBravoBackgroundColorInHex: string; buttonBravoLabelColorInHex: string; buttonCharlieDesignType: TypeOfSectionButtonDesignType; buttonCharlieBackgroundColorInHex: string; buttonCharlieLabelColorInHex: string; buttonDeltaDesignType: TypeOfSectionButtonDesignType; buttonDeltaBackgroundColorInHex: string; buttonDeltaLabelColorInHex: string; buttonEchoDesignType: TypeOfSectionButtonDesignType; buttonEchoBackgroundColorInHex: string; buttonEchoLabelColorInHex: string; itemTitleColorInHex: string; itemDescriptionColorInHex: string; itemButtonDesignType: TypeOfItemButtonDesignType; itemButtonBackgroundColorInHex: string; itemButtonLabelColorInHex: string; itemHighlightingColorInHex: string; itemToneType: TypeOfItemToneType; programmedItemActionButtonTextType: TypeOfProgrammedItemActionButtonTextType; } export interface IItem { id: number; display: boolean; order: number; manifest: { schema: TypeOfItemManifestSchema; section_schema: TypeOfSectionManifestSchema; availableProperties: Array; }; properties: IItemProperties; insertedAt: string; updatedAt: string; } export interface IItemProperties { title: string; description: string; body: string; logoImageSrc: string; imageSrc: string; linkType: TypeOfItemLinkType; linkSrc: string; buttonLabel: string; } interface IButton { buttonType: string; backgroundColor?: string; textColor?: string; text?: string; linkType?: TypeOfSectionLinkType | TypeOfItemLinkType; src?: string; borderColor?: string; state?: 'normal' | 'disabled'; } export interface ISectionButton extends IButton { linkType?: TypeOfSectionLinkType; } export interface IItemButton extends IButton { linkType?: TypeOfItemLinkType; linkMethod?: TypeOfItemLinkMethod; } interface IBackground { backgroundType: TypeOfBackground; backgroundColorInHex?: string; backgroundMediaSrc?: string; backgroundOverlayColorInHex?: IBackgroundOverlay; } export interface ISectionBackground extends IBackground { type: TypeOfBackground; src?: string; color?: string; overlay?: IBackgroundOverlay; } type TypeOfBackground = 'COLOR' | 'IMAGE' | 'VIDEO' | 'YOUTUBE'; export interface IBackgroundOverlay { color?: string; } interface ITitle { text: string; color?: string; } export interface ISectionTitle extends ITitle { text: string; color?: string; } export interface IItemTitle extends ITitle { text: string; color?: string; } interface IDescription { text: string; color?: string; } export interface ISectionDescription extends IDescription { text: string; color?: string; } export interface IItemDescription extends IDescription { text: string; color?: string; } export type CustomSectionShortcutKeysType = 'BULK_SELECT' | 'COLLISION_SELECT' | 'SELECT_ALL' | 'MANUAL_COLLISION_SELECT' | 'MANUAL_BULK_BREAK' | null; export type CustomSectionImperativeHandleRef = { selectCB: (cbId: string) => void; selectCBInBulk: (cbIds: string[]) => void; selectGroup: (groupBlockId: string) => void; }; export type DynamicLayoutProps = { device: 'DESKTOP' | 'MOBILE'; /** @default 'NORMAL */ mode?: 'NORMAL' | 'PREVIEW' | 'EDIT'; /** @deprecated use 'mode' instead */ isPreview?: boolean; sections: ISection[]; scrollDownTargetSectionId?: number; editingSectionId?: number; navigationHandler?: (linkType: 'WEB_LINK' | 'INTERNAL_LINK' | 'NONE', src: string, action?: NavHandlerAction) => void; onClickEditSection?: (section: ISection) => void; sectionActionHandler?: (action: TypeOfSectionAction) => void; programmedSectionComponents?: IProgrammedSectionComponents; width?: number; shortcutKeyMode?: CustomSectionShortcutKeysType; dynamicLayoutRef?: Ref; zoomScale?: number; }; export type NavHandlerAction = { openNewTab: boolean; }; export type SubscriptionProductType = 'FREE_INFINITE' | 'FREE_FINITE' | 'ONCE_INFINITE' | 'ONCE_FINITE' | 'COUPON_FREE_INFINITE' | 'COUPON_FREE_FINITE' | 'COUPON_ONCE_INFINITE' | 'COUPON_ONCE_FINITE' | 'SUBSCRIPTION_30DAYS' | 'SUBSCRIPTION_90DAYS' | 'SUBSCRIPTION_180DAYS' | 'SUBSCRIPTION_365DAYS'; type ExpiryPeriodInDaysType = 1 | 3 | 7 | 14 | 30; export type IMembershipCardTemplate = { backgroundImageSrc: string; logoImageSrc: string; overlayType: 'NONE' | 'SOLID' | 'GRADIENT'; overlayColorPrimary: string; overlayColorSecondary: string; designSchema: 'A' | 'B' | 'C'; }; export type IMembershipBenefitInfo = { benefitAlpha?: string; benefitBravo?: string; benefitCharlie?: string; benefitDelta?: string; benefitEcho?: string; }; export type IConnectedSubscriptionProducts = { id: number; order: number; connectedMembershipId: number; subscriptionProductId: number; subscriptionProduct: { id: number; type: SubscriptionProductType; title: string; alias: string; expiryPeriodInDays: ExpiryPeriodInDaysType; isDeactivated: boolean; fee: { currency: 'KRW' | 'USD'; amount: string | number; }; insertedAt: string; updatedAt: string; }; }; export type IMembership = { id: number; type: 'SYSTEM_GUEST' | 'SYSTEM_MEMBER' | 'SYSTEM_P_APP_UNLOCK' | 'GENERAL'; mid: string; title: string; insertedAt: string; updatedAt: string; membershipCardTemplate: IMembershipCardTemplate; membershipBenefitInfo: IMembershipBenefitInfo; totalSubscriptionProducts: number; }; export type IConnectedMembership = { id: number; order: number; mdid: string; mid: string; membership: IMembership; connectedSubscriptionProducts: IConnectedSubscriptionProducts[]; }; export type IProgrammedSectionComponents = { [key in TypeOfSectionManifestSchema]?: JSX.Element; }; export type IMembershipDisplay = { id: number; mdid: string; title: string; isDefault: boolean; connectedMemberships: IConnectedMembership[]; }; export type ISectionJsonProperties = { zOrders?: ZOrder; pedigree?: SectionPedigree; data: { CB_CONTENT_PROP_SECTION: { CB_CONTENT_PROP_SECTION_SPEC_VARIABLEROOTFONTSIZE: boolean; }; CB_CONTENT_PROP_VISIBILITY: CB_CONTENT_PROP_VISIBILITY_SPECS; CB_EFFECT_PROP_ENTANIM: CB_EFFECT_PROP_ENTANIM_SPECS; CB_LAYOUT_PROP_PADDING?: CB_LAYOUT_PROP_PADDING_SPECS; CB_PLACEMENT_PROP_SECTION: { CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH: boolean; 'CB_PLACEMENT_PROP_SECTION_SPEC_FULLWIDTH:MOBILE': boolean | null | undefined; CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT: number; 'CB_PLACEMENT_PROP_SECTION_SPEC_MINHEIGHT:MOBILE': number | null | undefined; CB_PLACEMENT_PROP_SECTION_SPEC_ROWS: number; 'CB_PLACEMENT_PROP_SECTION_SPEC_ROWS:MOBILE': number | null | undefined; CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH: number; 'CB_PLACEMENT_PROP_SECTION_SPEC_WIDTH:MOBILE': number | null | undefined; CB_PLACEMENT_PROP_SECTION_SPEC_COLS?: number; 'CB_PLACEMENT_PROP_SECTION_SPEC_COLS:MOBILE': number | null | undefined; }; CB_STYLE_PROP_BGCOLOR?: CB_STYLE_PROP_BGCOLOR_SPECS; CB_STYLE_PROP_BGMEDIA?: CB_STYLE_PROP_BGMEDIA_SPECS; CB_STYLE_PROP_BGOVERLAY?: CB_STYLE_PROP_BGOVERLAY_SPECS; }; }; export type CB_STYLE_PROP_BGMEDIA_SPECS_BASE = { CB_STYLE_PROP_BGMEDIA_SPEC_YSRC: string; CB_STYLE_PROP_BGMEDIA_SPEC_TYPE: string; CB_STYLE_PROP_BGMEDIA_SPEC_SCROLL: boolean; CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME: number; CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY: boolean; CB_STYLE_PROP_BGMEDIA_SPEC_MPLAY: boolean; CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEPOSITION: string; CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR: string; CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEFIT: string; CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME: number; CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR: string; }; export type CB_STYLE_PROP_BGMEDIA_SPECS = CB_STYLE_PROP_BGMEDIA_SPECS_BASE & { 'CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME:HOVER': number | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME:MOBILE': number | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME:MOBILE:HOVER': number | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEFIT:HOVER': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEFIT:MOBILE': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEFIT:MOBILE:HOVER': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR:HOVER': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR:MOBILE': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR:MOBILE:HOVER': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEPOSITION:HOVER': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEPOSITION:MOBILE': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEPOSITION:MOBILE:HOVER': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_MPLAY:MOBILE': boolean | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY:HOVER': boolean | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY:MOBILE': boolean | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY:MOBILE:HOVER': boolean | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME:HOVER': number | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME:MOBILE': number | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME:MOBILE:HOVER': number | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_SCROLL:HOVER': boolean | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_SCROLL:MOBILE': boolean | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_SCROLL:MOBILE:HOVER': boolean | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_TYPE:HOVER': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_TYPE:MOBILE': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_TYPE:MOBILE:HOVER': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_YSRC:HOVER': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_YSRC:MOBILE': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_YSRC:MOBILE:HOVER': string | null | undefined; 'CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR:HOVER'?: string | null; 'CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR:MOBILE'?: string | null; 'CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR:MOBILE:HOVER'?: string | null; }; export interface IComposition { id: number; administrativeTitle?: string; display: boolean; order: number; manifest: { schema: TypeOfSectionManifestSchema; availableProperties: Array; availableStyles: Array; availableTemplates: Array; } | Record; template: TypeofSectionTemplate; properties: ISectionProperties; styles: ISectionStyles; dynamicLayoutSectionItems: Array | null; insertedAt: string; updatedAt: string; type: TypeOfSectionType; program?: 'MEMBERSHIP_DISPLAY'; programData?: { mdid: string; preview: { availableResources: ['REAL.MEMBERSHIP_DISPLAY']; resources: { mock: Record; real: { membershipDisplay: IMembershipDisplay; }; }; }; }; componentBlocks?: ComponentBlock[]; jsonProperties?: ISectionJsonProperties; }