@prismicio/types-internal
Advanced tools
Comparing version 3.4.0-alpha.10 to 3.4.0-alpha.11
@@ -8,3 +8,2 @@ "use strict"; | ||
const EmptyContent_1 = require("../EmptyContent"); | ||
const _1 = require("."); | ||
const BooleanContent_1 = require("./BooleanContent"); | ||
@@ -39,4 +38,4 @@ const EmbedContent_1 = require("./EmbedContent"); | ||
SeparatorContent_1.SeparatorContent, | ||
TableContent_1.TableContent, | ||
RepeatableContent_1.RepeatableContent, | ||
TableContent_1.TableContent, | ||
]); | ||
@@ -69,5 +68,5 @@ const NestableContentDefaultValue = (widgetDef) => { | ||
(0, SeparatorContent_1.isSeparatorContent)(u) || | ||
(0, TableContent_1.isTableContent)(u) || | ||
(0, EmptyContent_1.isEmptyContent)(u) || | ||
(0, RepeatableContent_1.isRepeatableContent)(u) || | ||
(0, _1.isTableContent)(u); | ||
(0, RepeatableContent_1.isRepeatableContent)(u); | ||
exports.isNestableContent = isNestableContent; | ||
@@ -114,6 +113,6 @@ const NestableLegacy = (ctx) => { | ||
return (0, SeparatorContent_1.SeparatorLegacy)(ctx); | ||
case "Table": | ||
return (0, TableContent_1.TableLegacy)(ctx); | ||
case "Repeatable.Link": | ||
return (0, RepeatableContent_1.RepeatableLegacy)(ctx, "Link"); | ||
case "Table": | ||
return (0, TableContent_1.TableLegacy)(ctx); | ||
default: | ||
@@ -162,6 +161,6 @@ return; | ||
return (0, SeparatorContent_1.SeparatorLegacy)(ctx).encode(value); | ||
case TableContent_1.TableContentType: | ||
return (0, TableContent_1.TableLegacy)(ctx).encode(value); | ||
case "RepeatableContent": | ||
return (0, RepeatableContent_1.RepeatableLegacy)(ctx, value.type).encode(value); | ||
case TableContent_1.TableContentType: | ||
return (0, TableContent_1.TableLegacy)(ctx).encode(value); | ||
default: | ||
@@ -168,0 +167,0 @@ return; |
@@ -97,3 +97,3 @@ import * as t from "io-ts"; | ||
}) | ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl"; | ||
content: { | ||
@@ -157,135 +157,3 @@ text: string; | ||
direction?: string; | ||
}) | { | ||
type: "table"; | ||
content: { | ||
type: "tableRow"; | ||
content: ({ | ||
type: "tableHeader"; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
content: { | ||
text: string; | ||
} & { | ||
spans?: ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[]; | ||
}; | ||
} & { | ||
label?: string; | ||
direction?: string; | ||
})[]; | ||
} | { | ||
type: "tableCell"; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
content: { | ||
text: string; | ||
} & { | ||
spans?: ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[]; | ||
}; | ||
} & { | ||
label?: string; | ||
direction?: string; | ||
})[]; | ||
})[]; | ||
}[]; | ||
})[]; | ||
}))[]; | ||
}; | ||
@@ -421,3 +289,3 @@ export declare const RichTextContent: t.ExactC<t.TypeC<{ | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -531,237 +399,6 @@ text: t.StringC; | ||
direction: t.StringC; | ||
}>]>>, t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"table">; | ||
content: t.ArrayC<t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"tableRow">; | ||
content: t.ArrayC<t.UnionC<[t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"tableHeader">; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
text: t.StringC; | ||
}>, t.PartialC<{ | ||
spans: t.Type<({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], unknown>; | ||
}>]>; | ||
}>, t.PartialC<{ | ||
label: t.StringC; | ||
direction: t.StringC; | ||
}>]>>>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"tableCell">; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
text: t.StringC; | ||
}>, t.PartialC<{ | ||
spans: t.Type<({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], unknown>; | ||
}>]>; | ||
}>, t.PartialC<{ | ||
label: t.StringC; | ||
direction: t.StringC; | ||
}>]>>>; | ||
}>>]>>; | ||
}>>>; | ||
}>>]>>; | ||
}>]>>]>>; | ||
}>>; | ||
export declare type RichTextContent = t.TypeOf<typeof RichTextContent>; | ||
export * from "./Blocks"; | ||
export declare const RichTextLegacy: (ctx: LegacyContentCtx) => t.Type<{ | ||
@@ -860,3 +497,3 @@ __TYPE__: "StructuredTextContent"; | ||
}) | ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl"; | ||
content: { | ||
@@ -920,135 +557,3 @@ text: string; | ||
direction?: string; | ||
}) | { | ||
type: "table"; | ||
content: { | ||
type: "tableRow"; | ||
content: ({ | ||
type: "tableHeader"; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
content: { | ||
text: string; | ||
} & { | ||
spans?: ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[]; | ||
}; | ||
} & { | ||
label?: string; | ||
direction?: string; | ||
})[]; | ||
} | { | ||
type: "tableCell"; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
content: { | ||
text: string; | ||
} & { | ||
spans?: ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[]; | ||
}; | ||
} & { | ||
label?: string; | ||
direction?: string; | ||
})[]; | ||
})[]; | ||
}[]; | ||
})[]; | ||
}))[]; | ||
}, WithTypes<(({ | ||
@@ -1145,3 +650,3 @@ type: "image"; | ||
}) | ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl"; | ||
content: { | ||
@@ -1205,139 +710,2 @@ text: string; | ||
direction?: string; | ||
}) | { | ||
type: "table"; | ||
content: { | ||
type: "tableRow"; | ||
content: ({ | ||
type: "tableHeader"; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
content: { | ||
text: string; | ||
} & { | ||
spans?: ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[]; | ||
}; | ||
} & { | ||
label?: string; | ||
direction?: string; | ||
})[]; | ||
} | { | ||
type: "tableCell"; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
content: { | ||
text: string; | ||
} & { | ||
spans?: ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[]; | ||
}; | ||
} & { | ||
label?: string; | ||
direction?: string; | ||
})[]; | ||
})[]; | ||
}[]; | ||
})[]>, unknown>; | ||
export * from "./Block"; | ||
export * from "./EmbedBlock"; | ||
export * from "./ImageBlock"; | ||
export * from "./TableBlock"; | ||
export * from "./TextBlock"; | ||
}))[]>, unknown>; |
@@ -9,11 +9,12 @@ "use strict"; | ||
const utils_1 = require("../../../utils"); | ||
const Block_1 = require("./Block"); | ||
const Blocks_1 = require("./Blocks"); | ||
exports.RichTextContentType = "StructuredTextContent"; | ||
const isRichTextContent = (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.RichTextContentType; | ||
exports.isRichTextContent = isRichTextContent; | ||
const legacyReader = t.array(Block_1.BlockLegacy); | ||
const legacyReader = t.array(Blocks_1.BlockLegacy); | ||
exports.RichTextContent = t.strict({ | ||
__TYPE__: t.literal(exports.RichTextContentType), | ||
value: t.array(Block_1.Block), | ||
value: t.array(Blocks_1.Block), | ||
}); | ||
(0, tslib_1.__exportStar)(require("./Blocks"), exports); | ||
const RichTextLegacy = (ctx) => new t.Type("RichTextLegacy", exports.isRichTextContent, (u) => { | ||
@@ -28,6 +29,1 @@ return (0, function_1.pipe)(legacyReader.decode(u), fp_ts_1.either.map((r) => ({ value: r, __TYPE__: exports.RichTextContentType }))); | ||
exports.RichTextLegacy = RichTextLegacy; | ||
(0, tslib_1.__exportStar)(require("./Block"), exports); | ||
(0, tslib_1.__exportStar)(require("./EmbedBlock"), exports); | ||
(0, tslib_1.__exportStar)(require("./ImageBlock"), exports); | ||
(0, tslib_1.__exportStar)(require("./TableBlock"), exports); | ||
(0, tslib_1.__exportStar)(require("./TextBlock"), exports); |
@@ -10,3 +10,3 @@ import * as t from "io-ts"; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl"; | ||
content: { | ||
@@ -74,3 +74,3 @@ text: string; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl"; | ||
content: { | ||
@@ -143,3 +143,3 @@ text: string; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -259,3 +259,3 @@ text: t.StringC; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -377,3 +377,3 @@ text: t.StringC; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -491,3 +491,3 @@ text: t.StringC; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -604,236 +604,2 @@ text: t.StringC; | ||
}>>; | ||
export declare type TableRow = t.TypeOf<typeof TableRow>; | ||
export declare const tableContentLegacyCodec: t.ExactC<t.TypeC<{ | ||
content: t.ArrayC<t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"tableRow">; | ||
content: t.ArrayC<t.UnionC<[t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"tableHeader">; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
text: t.StringC; | ||
}>, t.PartialC<{ | ||
spans: t.Type<({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], unknown>; | ||
}>]>; | ||
}>, t.PartialC<{ | ||
label: t.StringC; | ||
direction: t.StringC; | ||
}>]>>>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"tableCell">; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
text: t.StringC; | ||
}>, t.PartialC<{ | ||
spans: t.Type<({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], unknown>; | ||
}>]>; | ||
}>, t.PartialC<{ | ||
label: t.StringC; | ||
direction: t.StringC; | ||
}>]>>>; | ||
}>>]>>; | ||
}>>>; | ||
}>>; | ||
export declare type TableLegacy = t.TypeOf<typeof tableContentLegacyCodec>; | ||
export declare const TableLegacy: (ctx: LegacyContentCtx) => t.Type<{ | ||
@@ -845,3 +611,3 @@ content: { | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl"; | ||
content: { | ||
@@ -909,3 +675,3 @@ text: string; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl"; | ||
content: { | ||
@@ -980,3 +746,3 @@ text: string; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl"; | ||
content: { | ||
@@ -1044,3 +810,3 @@ text: string; | ||
content: ({ | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header"; | ||
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl"; | ||
content: { | ||
@@ -1114,3 +880,3 @@ text: string; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -1228,3 +994,3 @@ text: t.StringC; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -1231,0 +997,0 @@ text: t.StringC; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TableContent = exports.TableLegacy = exports.tableContentLegacyCodec = exports.TableRow = exports.TableHeaderCell = exports.TableDataCell = exports.isTableContent = exports.TableContentType = void 0; | ||
exports.TableContent = exports.TableLegacy = exports.TableRow = exports.TableHeaderCell = exports.TableDataCell = exports.isTableContent = exports.TableContentType = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -9,7 +9,7 @@ const fp_ts_1 = require("fp-ts"); | ||
const utils_1 = require("../../utils"); | ||
const TextBlock_1 = require("./RichTextContent/TextBlock"); | ||
const RichTextContent_1 = require("./RichTextContent"); | ||
exports.TableContentType = "TableContent"; | ||
const isTableContent = (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.TableContentType; | ||
exports.isTableContent = isTableContent; | ||
const TableCellContent = t.array(TextBlock_1.TextBlock); | ||
const TableCellContent = t.array(RichTextContent_1.TextBlock); | ||
exports.TableDataCell = t.strict({ | ||
@@ -27,10 +27,10 @@ type: t.literal("tableCell"), | ||
}); | ||
exports.tableContentLegacyCodec = t.strict({ | ||
const legacyReader = t.strict({ | ||
content: t.array(exports.TableRow), | ||
}); | ||
const TableLegacy = (ctx) => new t.Type("TableLegacy", exports.isTableContent, (u) => { | ||
return (0, function_1.pipe)(exports.tableContentLegacyCodec.decode(u), fp_ts_1.either.map((t) => exports.TableContent.encode({ ...t, __TYPE__: exports.TableContentType }))); | ||
return (0, function_1.pipe)(legacyReader.decode(u), fp_ts_1.either.map((t) => exports.TableContent.encode({ ...t, __TYPE__: exports.TableContentType }))); | ||
}, (t) => { | ||
return { | ||
content: exports.tableContentLegacyCodec.encode(t), | ||
content: legacyReader.encode(t), | ||
types: { [ctx.keyOfType]: "Table" }, | ||
@@ -41,3 +41,3 @@ }; | ||
exports.TableContent = t.intersection([ | ||
exports.tableContentLegacyCodec, | ||
legacyReader, | ||
t.strict({ | ||
@@ -44,0 +44,0 @@ __TYPE__: t.literal(exports.TableContentType), |
import * as t from "io-ts"; | ||
import type { ContentPath, TraverseWidgetContentFn } from "../../_internal/utils"; | ||
import type { Link, NestableWidget } from "../../customtypes"; | ||
import { type Link, NestableFieldTypes, NestableWidget } from "../../customtypes"; | ||
import type { LegacyContentCtx, WithTypes } from "../LegacyContentCtx"; | ||
export declare const RepeatableContentType: "RepeatableContent"; | ||
export declare const RepeatableFieldType: "Repeatable"; | ||
export declare const RepeatableItemContent: t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"LinkContent">; | ||
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"ImageLink">; | ||
}>>, t.UnionC<[t.IntersectionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
kind: t.StringC; | ||
id: t.StringC; | ||
url: t.StringC; | ||
height: t.StringC; | ||
width: t.StringC; | ||
size: t.StringC; | ||
name: t.StringC; | ||
}>>, t.ExactC<t.PartialC<{ | ||
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"image">; | ||
text: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"FileLink">; | ||
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
kind: t.StringC; | ||
id: t.StringC; | ||
url: t.StringC; | ||
name: t.StringC; | ||
size: t.StringC; | ||
}>, t.PartialC<{ | ||
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>]>>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"file">; | ||
text: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"DocumentLink">; | ||
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
id: t.Type<string, string, unknown>; | ||
}>>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"document">; | ||
text: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"ExternalLink">; | ||
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
url: t.StringC; | ||
}>, t.PartialC<{ | ||
kind: t.LiteralC<"web">; | ||
target: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
preview: t.UnionC<[t.Type<{ | ||
title?: string; | ||
}, { | ||
title?: string; | ||
}, unknown>, t.NullC, t.UndefinedC]>; | ||
}>]>>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"web">; | ||
text: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"MediaLink">; | ||
}>>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"media">; | ||
text: t.StringC; | ||
}>>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"AnyLink">; | ||
}>>, t.ExactC<t.TypeC<{ | ||
text: t.StringC; | ||
}>>]>]>; | ||
}>>; | ||
export declare type RepeatableItemContent = t.TypeOf<typeof RepeatableItemContent>; | ||
export declare const RepeatableContent: t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"RepeatableContent">; | ||
type: t.LiteralC<"Link">; | ||
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
key: t.Type<string, string, unknown>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
type: t.UnionC<[t.LiteralC<"Color">, t.LiteralC<"Boolean">, t.LiteralC<"Embed">, t.LiteralC<"GeoPoint">, t.LiteralC<"Date">, t.LiteralC<"Number">, t.LiteralC<"Range">, t.LiteralC<"StructuredText">, t.LiteralC<"Select">, t.LiteralC<"Separator">, t.LiteralC<"Text">, t.LiteralC<"Timestamp">, t.LiteralC<"Link">, t.LiteralC<"Image">, t.LiteralC<"IntegrationFields">]>; | ||
value: t.ArrayC<t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"LinkContent">; | ||
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"ImageLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
kind: t.Type<"image", "image", unknown>; | ||
}>>, t.UnionC<[t.IntersectionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
kind: t.StringC; | ||
id: t.StringC; | ||
@@ -24,10 +96,11 @@ url: t.StringC; | ||
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"image">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"FileLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
kind: t.Type<"file", "file", unknown>; | ||
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
kind: t.StringC; | ||
id: t.StringC; | ||
@@ -39,17 +112,19 @@ url: t.StringC; | ||
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>]>>, t.ExactC<t.TypeC<{ | ||
}>]>>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"file">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"DocumentLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.TypeC<{ | ||
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
id: t.Type<string, string, unknown>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
}>>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"document">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"ExternalLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
url: t.StringC; | ||
@@ -64,20 +139,18 @@ }>, t.PartialC<{ | ||
}, unknown>, t.NullC, t.UndefinedC]>; | ||
}>]>>, t.ExactC<t.TypeC<{ | ||
}>]>>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"web">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"MediaLink">; | ||
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
}>>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"media">; | ||
}>>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
}>>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"AnyLink">; | ||
}>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
kind: t.LiteralC<"any">; | ||
}>, t.PartialC<{ | ||
}>>, t.ExactC<t.TypeC<{ | ||
text: t.StringC; | ||
}>]>>]>]>; | ||
}>>]>>; | ||
}>>]>]>; | ||
}>>>; | ||
}>>; | ||
@@ -87,11 +160,9 @@ export declare type RepeatableContent = t.TypeOf<typeof RepeatableContent>; | ||
__TYPE__: "RepeatableContent"; | ||
type: "Link"; | ||
value: ({ | ||
key: string; | ||
} & { | ||
type: "Boolean" | "Color" | "Date" | "Embed" | "GeoPoint" | "Image" | "IntegrationFields" | "Link" | "Number" | "Range" | "StructuredText" | "Select" | "Separator" | "Text" | "Timestamp"; | ||
value: { | ||
__TYPE__: "LinkContent"; | ||
value: ({ | ||
__TYPE__: "ImageLink"; | ||
} & ((({ | ||
kind: "image"; | ||
} & (({ | ||
kind: string; | ||
id: string; | ||
@@ -105,10 +176,11 @@ url: string; | ||
date?: string | null | undefined; | ||
} & { | ||
text?: string; | ||
}) | { | ||
kind: "image"; | ||
}) & { | ||
text?: string; | ||
text: string; | ||
})) | ({ | ||
__TYPE__: "FileLink"; | ||
} & ((({ | ||
kind: "file"; | ||
} & (({ | ||
kind: string; | ||
id: string; | ||
@@ -120,6 +192,7 @@ url: string; | ||
date?: string | null | undefined; | ||
} & { | ||
text?: string; | ||
}) | { | ||
kind: "file"; | ||
}) & { | ||
text?: string; | ||
text: string; | ||
})) | ({ | ||
@@ -129,4 +202,3 @@ __TYPE__: "MediaLink"; | ||
kind: "media"; | ||
} & { | ||
text?: string; | ||
text: string; | ||
}) | ({ | ||
@@ -136,9 +208,10 @@ __TYPE__: "DocumentLink"; | ||
id: string; | ||
} | { | ||
} & { | ||
text?: string; | ||
}) | { | ||
kind: "document"; | ||
}) & { | ||
text?: string; | ||
text: string; | ||
})) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & ((({ | ||
} & (({ | ||
url: string; | ||
@@ -151,16 +224,15 @@ } & { | ||
} | null | undefined; | ||
} & { | ||
text?: string; | ||
}) | { | ||
kind: "web"; | ||
}) & { | ||
text?: string; | ||
text: string; | ||
})) | ({ | ||
__TYPE__: "AnyLink"; | ||
} & { | ||
kind: "any"; | ||
} & { | ||
text?: string; | ||
text: string; | ||
}); | ||
})[]; | ||
}[]; | ||
}>; | ||
export declare const RepeatableLegacy: (ctx: LegacyContentCtx, fieldType: "Link") => t.Type<RepeatableContent, WithTypes<Array<unknown>>, unknown>; | ||
export declare const RepeatableLegacy: (ctx: LegacyContentCtx, fieldType: NestableFieldTypes) => t.Type<RepeatableContent, WithTypes<Array<unknown>>, unknown>; | ||
export declare type RepeatableCustomType = Link; | ||
@@ -167,0 +239,0 @@ export declare function traverseRepeatableContent({ path, key, apiId, model, content, }: { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.traverseRepeatableContent = exports.RepeatableLegacy = exports.isRepeatableContent = exports.RepeatableContent = void 0; | ||
exports.traverseRepeatableContent = exports.RepeatableLegacy = exports.isRepeatableContent = exports.RepeatableContent = exports.RepeatableItemContent = exports.RepeatableFieldType = exports.RepeatableContentType = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -9,12 +9,19 @@ const fp_ts_1 = require("fp-ts"); | ||
const t = (0, tslib_1.__importStar)(require("io-ts")); | ||
const customtypes_1 = require("../../customtypes"); | ||
const nestable_1 = require("./nestable"); | ||
exports.RepeatableContentType = "RepeatableContent"; | ||
exports.RepeatableFieldType = "Repeatable"; | ||
exports.RepeatableItemContent = nestable_1.LinkContent; | ||
exports.RepeatableContent = t.strict({ | ||
__TYPE__: t.literal("RepeatableContent"), | ||
type: t.literal("Link"), | ||
value: t.array(nestable_1.LinkContent), | ||
__TYPE__: t.literal(exports.RepeatableContentType), | ||
type: customtypes_1.NestableFieldTypes, | ||
// TODO: How to ensure it's an array of only one type | ||
value: t.array(exports.RepeatableItemContent), | ||
}); | ||
exports.isRepeatableContent = exports.RepeatableContent.is; | ||
const RepeatableLegacy = (ctx, fieldType) => { | ||
const codecDecode = t.array(t.unknown); | ||
const codecEncode = t.array(exports.RepeatableItemContent); | ||
return new t.Type("RepeatableLegacy", exports.isRepeatableContent, (items) => { | ||
const parsed = (0, function_1.pipe)(t.array(t.unknown).decode(items), fp_ts_1.either.map((items) => { | ||
const parsed = (0, function_1.pipe)(codecDecode.decode(items), fp_ts_1.either.map((items) => { | ||
const parsedItems = items.reduce((acc, item) => { | ||
@@ -36,3 +43,3 @@ let result; | ||
type: fieldType, | ||
__TYPE__: "RepeatableContent", | ||
__TYPE__: exports.RepeatableContentType, | ||
}; | ||
@@ -42,3 +49,3 @@ })); | ||
}, (r) => { | ||
const res = t.array(nestable_1.LinkContent).encode(r.value); | ||
const res = codecEncode.encode(r.value); | ||
const encodedItems = res.reduce((acc, item) => { | ||
@@ -78,5 +85,2 @@ let encoded; | ||
return acc; | ||
// If the transformed field is not a link content, we don't include it | ||
if (!(0, nestable_1.isLinkContent)(transformedField)) | ||
return acc; | ||
return acc.concat(transformedField); | ||
@@ -83,0 +87,0 @@ }, []); |
@@ -325,3 +325,3 @@ import * as t from "io-ts"; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -435,318 +435,5 @@ text: t.StringC; | ||
direction: t.StringC; | ||
}>]>>, t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"table">; | ||
content: t.ArrayC<t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"tableRow">; | ||
content: t.ArrayC<t.UnionC<[t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"tableHeader">; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
text: t.StringC; | ||
}>, t.PartialC<{ | ||
spans: t.Type<({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], unknown>; | ||
}>]>; | ||
}>, t.PartialC<{ | ||
label: t.StringC; | ||
direction: t.StringC; | ||
}>]>>>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
type: t.LiteralC<"tableCell">; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
text: t.StringC; | ||
}>, t.PartialC<{ | ||
spans: t.Type<({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], ({ | ||
data: ({ | ||
__TYPE__: "ImageLink"; | ||
} & { | ||
kind: "image"; | ||
id: string; | ||
url: string; | ||
height: string; | ||
width: string; | ||
size: string; | ||
name: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "FileLink"; | ||
} & { | ||
kind: "file"; | ||
id: string; | ||
url: string; | ||
name: string; | ||
size: string; | ||
} & { | ||
date?: string | null | undefined; | ||
}) | ({ | ||
__TYPE__: "DocumentLink"; | ||
} & { | ||
id: string; | ||
}) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & { | ||
url: string; | ||
} & { | ||
kind?: "web"; | ||
target?: string | null | undefined; | ||
preview?: { | ||
title?: string; | ||
} | null | undefined; | ||
}); | ||
start: number; | ||
end: number; | ||
type: "hyperlink"; | ||
} | { | ||
data: string; | ||
start: number; | ||
end: number; | ||
type: "label"; | ||
} | { | ||
start: number; | ||
end: number; | ||
type: "strong" | "em" | "list-item"; | ||
})[], unknown>; | ||
}>]>; | ||
}>, t.PartialC<{ | ||
label: t.StringC; | ||
direction: t.StringC; | ||
}>]>>>; | ||
}>>]>>; | ||
}>>>; | ||
}>>]>>; | ||
}>]>>]>>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"SeparatorContent">; | ||
}>>, t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"RepeatableContent">; | ||
type: t.LiteralC<"Link">; | ||
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
key: t.Type<string, string, unknown>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"LinkContent">; | ||
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"ImageLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
kind: t.Type<"image", "image", unknown>; | ||
id: t.StringC; | ||
url: t.StringC; | ||
height: t.StringC; | ||
width: t.StringC; | ||
size: t.StringC; | ||
name: t.StringC; | ||
}>>, t.ExactC<t.PartialC<{ | ||
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"image">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"FileLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
kind: t.Type<"file", "file", unknown>; | ||
id: t.StringC; | ||
url: t.StringC; | ||
name: t.StringC; | ||
size: t.StringC; | ||
}>, t.PartialC<{ | ||
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>]>>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"file">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"DocumentLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.TypeC<{ | ||
id: t.Type<string, string, unknown>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"document">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"ExternalLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
url: t.StringC; | ||
}>, t.PartialC<{ | ||
kind: t.LiteralC<"web">; | ||
target: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
preview: t.UnionC<[t.Type<{ | ||
title?: string; | ||
}, { | ||
title?: string; | ||
}, unknown>, t.NullC, t.UndefinedC]>; | ||
}>]>>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"web">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"MediaLink">; | ||
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"media">; | ||
}>>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"AnyLink">; | ||
}>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
kind: t.LiteralC<"any">; | ||
}>, t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>]>>]>]>; | ||
}>>]>>; | ||
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
@@ -758,3 +445,3 @@ content: t.ArrayC<t.ExactC<t.TypeC<{ | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -872,3 +559,3 @@ text: t.StringC; | ||
content: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl" | "table" | "table-row" | "table-cell" | "table-header", unknown>; | ||
type: t.Type<"image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>; | ||
content: t.IntersectionC<[t.TypeC<{ | ||
@@ -987,3 +674,84 @@ text: t.StringC; | ||
__TYPE__: t.LiteralC<"TableContent">; | ||
}>>]>]>, t.Type<GroupContent, GroupContent, unknown>]>]>>; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"RepeatableContent">; | ||
type: t.LiteralC<"Link">; | ||
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
key: t.Type<string, string, unknown>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"LinkContent">; | ||
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"ImageLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
kind: t.Type<"image", "image", unknown>; | ||
id: t.StringC; | ||
url: t.StringC; | ||
height: t.StringC; | ||
width: t.StringC; | ||
size: t.StringC; | ||
name: t.StringC; | ||
}>>, t.ExactC<t.PartialC<{ | ||
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>]>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"image">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"FileLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
kind: t.Type<"file", "file", unknown>; | ||
id: t.StringC; | ||
url: t.StringC; | ||
name: t.StringC; | ||
size: t.StringC; | ||
}>, t.PartialC<{ | ||
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>]>>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"file">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"DocumentLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.TypeC<{ | ||
id: t.Type<string, string, unknown>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"document">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"ExternalLink">; | ||
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
url: t.StringC; | ||
}>, t.PartialC<{ | ||
kind: t.LiteralC<"web">; | ||
target: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
preview: t.UnionC<[t.Type<{ | ||
title?: string; | ||
}, { | ||
title?: string; | ||
}, unknown>, t.NullC, t.UndefinedC]>; | ||
}>]>>, t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"web">; | ||
}>>]>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"MediaLink">; | ||
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
kind: t.LiteralC<"media">; | ||
}>>, t.ExactC<t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
__TYPE__: t.LiteralC<"AnyLink">; | ||
}>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
kind: t.LiteralC<"any">; | ||
}>, t.PartialC<{ | ||
text: t.StringC; | ||
variant: t.StringC; | ||
}>]>>]>]>; | ||
}>>]>>; | ||
}>>]>, t.Type<GroupContent, GroupContent, unknown>]>]>>; | ||
}>>>; |
@@ -162,2 +162,8 @@ import type { Variation } from "../widgets/slices"; | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -332,2 +338,8 @@ } & { | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -502,2 +514,8 @@ } & { | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -671,2 +689,8 @@ } & { | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -843,2 +867,8 @@ } & { | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -1013,2 +1043,8 @@ } & { | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -1183,2 +1219,8 @@ } & { | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -1352,2 +1394,8 @@ } & { | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -1354,0 +1402,0 @@ } & { |
@@ -104,2 +104,8 @@ import * as t from "io-ts"; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -276,2 +282,8 @@ }>, t.PartialC<{ | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -443,2 +455,8 @@ }>, t.PartialC<{ | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -612,2 +630,8 @@ }>, t.PartialC<{ | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -786,2 +810,8 @@ }>, t.PartialC<{ | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -955,2 +985,8 @@ }>, t.PartialC<{ | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -957,0 +993,0 @@ }>, t.PartialC<{ |
@@ -100,2 +100,8 @@ import * as t from "io-ts"; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -102,0 +108,0 @@ }>, t.PartialC<{ |
@@ -19,2 +19,3 @@ "use strict"; | ||
const Separator_1 = require("./Separator"); | ||
const Table_1 = require("./Table"); | ||
const Text_1 = require("./Text"); | ||
@@ -33,2 +34,3 @@ const Timestamp_1 = require("./Timestamp"); | ||
Separator_1.Separator, | ||
Table_1.Table, | ||
Text_1.Text, | ||
@@ -35,0 +37,0 @@ Timestamp_1.Timestamp, |
@@ -22,6 +22,2 @@ import * as t from "io-ts"; | ||
readonly rtl: "rtl"; | ||
readonly table: "table"; | ||
readonly tableRow: "table-row"; | ||
readonly tableCell: "table-cell"; | ||
readonly tableHeader: "table-header"; | ||
}; | ||
@@ -45,6 +41,2 @@ export declare const RichTextNodeTypeCodec: t.KeyofC<{ | ||
rtl: null; | ||
table: null; | ||
"table-row": null; | ||
"table-cell": null; | ||
"table-header": null; | ||
}>; | ||
@@ -51,0 +43,0 @@ export declare const RichTextConfig: t.ExactC<t.PartialC<{ |
@@ -30,6 +30,2 @@ "use strict"; | ||
rtl: "rtl", | ||
table: "table", | ||
tableRow: "table-row", | ||
tableCell: "table-cell", | ||
tableHeader: "table-header", | ||
}; | ||
@@ -53,6 +49,2 @@ exports.RichTextNodeTypeCodec = t.keyof({ | ||
[exports.RichTextNodeType.rtl]: null, | ||
[exports.RichTextNodeType.table]: null, | ||
[exports.RichTextNodeType.tableRow]: null, | ||
[exports.RichTextNodeType.tableCell]: null, | ||
[exports.RichTextNodeType.tableHeader]: null, | ||
}); | ||
@@ -59,0 +51,0 @@ const RichTextOptions = new t.Type("RichTextOptions", (u) => typeof u === "string", (u) => { |
@@ -113,2 +113,8 @@ import * as t from "io-ts"; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -274,2 +280,8 @@ }>, t.PartialC<{ | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -276,0 +288,0 @@ }>, t.PartialC<{ |
@@ -101,2 +101,8 @@ import * as t from "io-ts"; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -270,2 +276,8 @@ }>, t.PartialC<{ | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -272,0 +284,0 @@ }>, t.PartialC<{ |
@@ -100,2 +100,8 @@ import * as t from "io-ts"; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -269,2 +275,8 @@ }>, t.PartialC<{ | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -438,2 +450,8 @@ }>, t.PartialC<{ | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Table">; | ||
}>, t.PartialC<{ | ||
config: t.ExactC<t.PartialC<{ | ||
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>; | ||
}>>; | ||
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
type: t.LiteralC<"Text">; | ||
@@ -649,2 +667,8 @@ }>, t.PartialC<{ | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -819,2 +843,8 @@ } & { | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -989,2 +1019,8 @@ } & { | ||
}) | ({ | ||
type: "Table"; | ||
} & { | ||
config?: { | ||
label?: string | null | undefined; | ||
}; | ||
}) | ({ | ||
type: "Text"; | ||
@@ -991,0 +1027,0 @@ } & { |
{ | ||
"name": "@prismicio/types-internal", | ||
"version": "3.4.0-alpha.10", | ||
"version": "3.4.0-alpha.11", | ||
"description": "Prismic types for Custom Types and Prismic Data", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -7,3 +7,2 @@ import { isRight } from "fp-ts/lib/Either" | ||
import { EmptyContent, EmptyLegacy, isEmptyContent } from "../EmptyContent" | ||
import { isTableContent } from "." | ||
import { | ||
@@ -88,3 +87,8 @@ BooleanContent, | ||
} from "./SeparatorContent" | ||
import { TableContent, TableContentType, TableLegacy } from "./TableContent" | ||
import { | ||
isTableContent, | ||
TableContent, | ||
TableContentType, | ||
TableLegacy, | ||
} from "./TableContent" | ||
@@ -108,4 +112,4 @@ export const NestableContent = t.union([ | ||
SeparatorContent, | ||
TableContent, | ||
RepeatableContent, | ||
TableContent, | ||
]) | ||
@@ -144,5 +148,5 @@ export type NestableContent = t.TypeOf<typeof NestableContent> | ||
isSeparatorContent(u) || | ||
isTableContent(u) || | ||
isEmptyContent(u) || | ||
isRepeatableContent(u) || | ||
isTableContent(u) | ||
isRepeatableContent(u) | ||
@@ -189,6 +193,6 @@ export const NestableLegacy = (ctx: LegacyContentCtx) => { | ||
return SeparatorLegacy(ctx) | ||
case "Table": | ||
return TableLegacy(ctx) | ||
case "Repeatable.Link": | ||
return RepeatableLegacy(ctx, "Link") | ||
case "Table": | ||
return TableLegacy(ctx) | ||
default: | ||
@@ -232,6 +236,6 @@ return | ||
return SeparatorLegacy(ctx).encode(value) | ||
case TableContentType: | ||
return TableLegacy(ctx).encode(value) | ||
case "RepeatableContent": | ||
return RepeatableLegacy(ctx, value.type).encode(value) | ||
case TableContentType: | ||
return TableLegacy(ctx).encode(value) | ||
@@ -238,0 +242,0 @@ default: |
@@ -7,3 +7,3 @@ import { either } from "fp-ts" | ||
import { hasContentType } from "../../../utils" | ||
import { Block, BlockLegacy } from "./Block" | ||
import { Block, BlockLegacy } from "./Blocks" | ||
@@ -23,2 +23,4 @@ export const RichTextContentType = "StructuredTextContent" | ||
export * from "./Blocks" | ||
export const RichTextLegacy = (ctx: LegacyContentCtx) => | ||
@@ -42,7 +44,1 @@ new t.Type<RichTextContent, WithTypes<RichTextLegacy>, unknown>( | ||
) | ||
export * from "./Block" | ||
export * from "./EmbedBlock" | ||
export * from "./ImageBlock" | ||
export * from "./TableBlock" | ||
export * from "./TextBlock" |
@@ -7,3 +7,3 @@ import { either } from "fp-ts" | ||
import { hasContentType } from "../../utils" | ||
import { TextBlock } from "./RichTextContent/TextBlock" | ||
import { TextBlock } from "./RichTextContent" | ||
@@ -33,9 +33,8 @@ export const TableContentType = "TableContent" | ||
}) | ||
export type TableRow = t.TypeOf<typeof TableRow> | ||
export const tableContentLegacyCodec = t.strict({ | ||
const legacyReader = t.strict({ | ||
content: t.array(TableRow), | ||
}) | ||
export type TableLegacy = t.TypeOf<typeof tableContentLegacyCodec> | ||
type TableLegacy = t.TypeOf<typeof legacyReader> | ||
@@ -48,3 +47,3 @@ export const TableLegacy = (ctx: LegacyContentCtx) => | ||
return pipe( | ||
tableContentLegacyCodec.decode(u), | ||
legacyReader.decode(u), | ||
either.map((t) => | ||
@@ -58,3 +57,3 @@ TableContent.encode({ ...t, __TYPE__: TableContentType }), | ||
return { | ||
content: tableContentLegacyCodec.encode(t), | ||
content: legacyReader.encode(t), | ||
types: { [ctx.keyOfType]: "Table" }, | ||
@@ -66,3 +65,3 @@ } | ||
export const TableContent = t.intersection([ | ||
tableContentLegacyCodec, | ||
legacyReader, | ||
t.strict({ | ||
@@ -69,0 +68,0 @@ __TYPE__: t.literal(TableContentType), |
@@ -16,2 +16,3 @@ import * as t from "io-ts" | ||
import { Separator } from "./Separator" | ||
import { Table } from "./Table" | ||
import { Text } from "./Text" | ||
@@ -31,2 +32,3 @@ import { Timestamp } from "./Timestamp" | ||
Separator, | ||
Table, | ||
Text, | ||
@@ -33,0 +35,0 @@ Timestamp, |
@@ -32,6 +32,2 @@ import { either } from "fp-ts/" | ||
rtl: "rtl", | ||
table: "table", | ||
tableRow: "table-row", | ||
tableCell: "table-cell", | ||
tableHeader: "table-header", | ||
} as const | ||
@@ -56,6 +52,2 @@ | ||
[RichTextNodeType.rtl]: null, | ||
[RichTextNodeType.table]: null, | ||
[RichTextNodeType.tableRow]: null, | ||
[RichTextNodeType.tableCell]: null, | ||
[RichTextNodeType.tableHeader]: null, | ||
}) | ||
@@ -62,0 +54,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
4243279
335
98251