Merged in feat/list-block (pull request #18)
Feat/list block Approved-by: Michael Zetterberg Approved-by: Simon.Emanuelsson
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { Edges } from "../utils/edges"
|
||||
import type { ExternalLink } from "../utils/externalLink"
|
||||
import type { TempPageLink } from "../utils/tempPageLink"
|
||||
import type { PageLink } from "../utils/pageLink"
|
||||
import { Typename } from "../utils/typename"
|
||||
|
||||
enum ListItemStyleEnum {
|
||||
checkmark = "checkmark",
|
||||
@@ -9,38 +10,60 @@ enum ListItemStyleEnum {
|
||||
|
||||
type ListItemStyle = keyof typeof ListItemStyleEnum
|
||||
|
||||
type ExternalLinkListItem = {
|
||||
list_item_external_link: {
|
||||
link: {
|
||||
href: string
|
||||
export enum BlockListItemsEnum {
|
||||
CurrentBlocksPageBlocksListBlockListItemsListItem = "CurrentBlocksPageBlocksListBlockListItemsListItem",
|
||||
CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink = "CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink",
|
||||
CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink = "CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink",
|
||||
}
|
||||
|
||||
type ExternalLinkListItem = Typename<
|
||||
{
|
||||
list_item_external_link: {
|
||||
link: {
|
||||
href: string
|
||||
title: string
|
||||
}
|
||||
list_item_style: ListItemStyle
|
||||
subtitle?: string
|
||||
}
|
||||
},
|
||||
BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemExternalLink
|
||||
>
|
||||
|
||||
type InternalLinkListItem = Typename<
|
||||
{
|
||||
list_item_internal_link: {
|
||||
link_text?: string
|
||||
list_item_style: ListItemStyle
|
||||
subtitle?: string
|
||||
pageConnection: Edges<TempPageLink | PageLink>
|
||||
}
|
||||
},
|
||||
BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink
|
||||
>
|
||||
|
||||
type RegularListItem = Typename<
|
||||
{
|
||||
list_item: {
|
||||
list_item_style: ListItemStyle
|
||||
subtitle?: string
|
||||
title: string
|
||||
}
|
||||
list_item_style: ListItemStyle
|
||||
subtitle?: string
|
||||
}
|
||||
}
|
||||
},
|
||||
BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItem
|
||||
>
|
||||
|
||||
type InternalLinkListItem = {
|
||||
list_item_internal_link: {
|
||||
link_text?: string
|
||||
list_item_style: ListItemStyle
|
||||
subtitle?: string
|
||||
pageConnection: Edges<ExternalLink | PageLink>
|
||||
}
|
||||
}
|
||||
|
||||
type RegularListItem = {
|
||||
list_item: {
|
||||
list_item_style: ListItemStyle
|
||||
subtitle?: string
|
||||
title: string
|
||||
}
|
||||
}
|
||||
|
||||
type ListItem = ExternalLinkListItem | InternalLinkListItem | RegularListItem
|
||||
export type ListItem =
|
||||
| ExternalLinkListItem
|
||||
| InternalLinkListItem
|
||||
| RegularListItem
|
||||
|
||||
export type List = {
|
||||
list: {
|
||||
list_items: ListItem
|
||||
title?: string
|
||||
list_items: ListItem[]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export type ListProps = List
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import type { SysAsset } from "./utils/asset"
|
||||
import type { ExternalLinkType } from "./utils/externalLink"
|
||||
import type { TempPageLinkType } from "./utils/tempPageLink"
|
||||
import type { PageLinkType } from "./utils/pageLink"
|
||||
|
||||
export type Embeds =
|
||||
| ExternalLinkType
|
||||
| PageLinkType
|
||||
| SysAsset
|
||||
export type Embeds = TempPageLinkType | PageLinkType | SysAsset
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Image } from "../image"
|
||||
import type { Edges } from "./utils/edges"
|
||||
import type { Embeds } from "./embeds"
|
||||
import type { ExternalLink } from "./utils/externalLink"
|
||||
import type { TempPageLink } from "./utils/tempPageLink"
|
||||
import type { PageLink } from "./utils/pageLink"
|
||||
import type { RTEDocument } from "../rte/node"
|
||||
|
||||
@@ -13,7 +13,7 @@ export type Puff = {
|
||||
title: string
|
||||
}
|
||||
link_text?: string
|
||||
pageConnection: Edges<ExternalLink | PageLink>
|
||||
pageConnection: Edges<TempPageLink | PageLink>
|
||||
system: {
|
||||
uid: string
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { Lang } from "@/types/lang"
|
||||
import type { EmbedEnum } from "./embeds"
|
||||
import type { Typename } from "./typename"
|
||||
|
||||
export type PageLink = {
|
||||
system: {
|
||||
uid: string
|
||||
locale: Lang
|
||||
}
|
||||
title: string
|
||||
url: string
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Lang } from "@/types/lang"
|
||||
import type { EmbedEnum } from "./embeds"
|
||||
import type { Typename } from "./typename"
|
||||
|
||||
export type ExternalLink = {
|
||||
export type TempPageLink = {
|
||||
system: {
|
||||
uid: string
|
||||
locale: Lang
|
||||
}
|
||||
title: string
|
||||
url: string
|
||||
}
|
||||
|
||||
export type ExternalLinkType = Typename<ExternalLink, EmbedEnum.TempPage>
|
||||
export type TempPageLinkType = Typename<TempPageLink, EmbedEnum.TempPage>
|
||||
Reference in New Issue
Block a user