New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@prismicio/types-internal

Package Overview
Dependencies
Maintainers
26
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prismicio/types-internal - npm Package Compare versions

Comparing version 3.4.0-alpha.11 to 3.4.0-alpha.12

lib/content/fields/nestable/RichTextContent/Block.d.ts

15

lib/content/fields/nestable/NestableContent.js

@@ -8,2 +8,3 @@ "use strict";

const EmptyContent_1 = require("../EmptyContent");
const _1 = require(".");
const BooleanContent_1 = require("./BooleanContent");

@@ -38,4 +39,4 @@ const EmbedContent_1 = require("./EmbedContent");

SeparatorContent_1.SeparatorContent,
RepeatableContent_1.RepeatableContent,
TableContent_1.TableContent,
RepeatableContent_1.RepeatableContent,
]);

@@ -68,5 +69,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, RepeatableContent_1.isRepeatableContent)(u) ||
(0, _1.isTableContent)(u);
exports.isNestableContent = isNestableContent;

@@ -113,6 +114,6 @@ const NestableLegacy = (ctx) => {

return (0, SeparatorContent_1.SeparatorLegacy)(ctx);
case "Repeatable.Link":
return (0, RepeatableContent_1.RepeatableLegacy)(ctx, "Link");
case "Table":
return (0, TableContent_1.TableLegacy)(ctx);
case "Repeatable.Link":
return (0, RepeatableContent_1.RepeatableLegacy)(ctx, "Link");
default:

@@ -161,6 +162,6 @@ return;

return (0, SeparatorContent_1.SeparatorLegacy)(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);
case "RepeatableContent":
return (0, RepeatableContent_1.RepeatableLegacy)(ctx, value.type).encode(value);
default:

@@ -167,0 +168,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";
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: {

@@ -157,3 +157,135 @@ 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;
})[];
})[];
}[];
})[];
};

@@ -289,3 +421,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", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
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<{

@@ -399,6 +531,237 @@ 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<{

@@ -497,3 +860,3 @@ __TYPE__: "StructuredTextContent";

}) | ({
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl";
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: {

@@ -557,3 +920,135 @@ 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<(({

@@ -650,3 +1145,3 @@ type: "image";

}) | ({
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl";
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: {

@@ -710,2 +1205,139 @@ text: string;

direction?: string;
}))[]>, unknown>;
}) | {
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";

@@ -9,12 +9,11 @@ "use strict";

const utils_1 = require("../../../utils");
const Blocks_1 = require("./Blocks");
const Block_1 = require("./Block");
exports.RichTextContentType = "StructuredTextContent";
const isRichTextContent = (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.RichTextContentType;
exports.isRichTextContent = isRichTextContent;
const legacyReader = t.array(Blocks_1.BlockLegacy);
const legacyReader = t.array(Block_1.BlockLegacy);
exports.RichTextContent = t.strict({
__TYPE__: t.literal(exports.RichTextContentType),
value: t.array(Blocks_1.Block),
value: t.array(Block_1.Block),
});
(0, tslib_1.__exportStar)(require("./Blocks"), exports);
const RichTextLegacy = (ctx) => new t.Type("RichTextLegacy", exports.isRichTextContent, (u) => {

@@ -29,1 +28,6 @@ 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";
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: {

@@ -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";
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: {

@@ -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", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
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<{

@@ -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", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
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<{

@@ -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", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
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<{

@@ -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", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
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<{

@@ -604,2 +604,236 @@ 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<{

@@ -611,3 +845,3 @@ content: {

content: ({
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl";
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: {

@@ -675,3 +909,3 @@ text: string;

content: ({
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl";
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: {

@@ -746,3 +980,3 @@ text: string;

content: ({
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl";
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: {

@@ -810,3 +1044,3 @@ text: string;

content: ({
type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl";
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: {

@@ -880,3 +1114,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", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
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<{

@@ -994,3 +1228,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", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
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<{

@@ -997,0 +1231,0 @@ text: t.StringC;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TableContent = exports.TableLegacy = exports.TableRow = exports.TableHeaderCell = exports.TableDataCell = exports.isTableContent = exports.TableContentType = void 0;
exports.TableContent = exports.TableLegacy = exports.tableContentLegacyCodec = 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 RichTextContent_1 = require("./RichTextContent");
const TextBlock_1 = require("./RichTextContent/TextBlock");
exports.TableContentType = "TableContent";
const isTableContent = (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.TableContentType;
exports.isTableContent = isTableContent;
const TableCellContent = t.array(RichTextContent_1.TextBlock);
const TableCellContent = t.array(TextBlock_1.TextBlock);
exports.TableDataCell = t.strict({

@@ -27,10 +27,10 @@ type: t.literal("tableCell"),

});
const legacyReader = t.strict({
exports.tableContentLegacyCodec = t.strict({
content: t.array(exports.TableRow),
});
const TableLegacy = (ctx) => new t.Type("TableLegacy", exports.isTableContent, (u) => {
return (0, function_1.pipe)(legacyReader.decode(u), fp_ts_1.either.map((t) => exports.TableContent.encode({ ...t, __TYPE__: exports.TableContentType })));
return (0, function_1.pipe)(exports.tableContentLegacyCodec.decode(u), fp_ts_1.either.map((t) => exports.TableContent.encode({ ...t, __TYPE__: exports.TableContentType })));
}, (t) => {
return {
content: legacyReader.encode(t),
content: exports.tableContentLegacyCodec.encode(t),
types: { [ctx.keyOfType]: "Table" },

@@ -41,3 +41,3 @@ };

exports.TableContent = t.intersection([
legacyReader,
exports.tableContentLegacyCodec,
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, NestableFieldTypes, NestableWidget } from "../../customtypes";
import type { Link, 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.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<"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.UnionC<[t.IntersectionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
kind: t.StringC;
}>>, t.IntersectionC<[t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
kind: t.Type<"image", "image", unknown>;
id: t.StringC;

@@ -96,11 +24,10 @@ 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.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
kind: t.StringC;
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
kind: t.Type<"file", "file", unknown>;
id: t.StringC;

@@ -112,19 +39,17 @@ 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<{
}>]>>, 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.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.TypeC<{
id: t.Type<string, string, unknown>;
}>>, t.ExactC<t.PartialC<{
text: t.StringC;
}>>]>, t.ExactC<t.TypeC<{
}>>, 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.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
url: t.StringC;

@@ -139,18 +64,20 @@ }>, t.PartialC<{

}, unknown>, t.NullC, t.UndefinedC]>;
}>]>>, t.ExactC<t.PartialC<{
text: t.StringC;
}>>]>, t.ExactC<t.TypeC<{
}>]>>, 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.ExactC<t.TypeC<{
}>>, t.IntersectionC<[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.TypeC<{
}>>, t.ExactC<t.IntersectionC<[t.TypeC<{
kind: t.LiteralC<"any">;
}>, t.PartialC<{
text: t.StringC;
}>>]>]>;
}>>>;
}>]>>]>]>;
}>>]>>;
}>>;

@@ -160,9 +87,11 @@ export declare type RepeatableContent = t.TypeOf<typeof RepeatableContent>;

__TYPE__: "RepeatableContent";
type: "Boolean" | "Color" | "Date" | "Embed" | "GeoPoint" | "Image" | "IntegrationFields" | "Link" | "Number" | "Range" | "StructuredText" | "Select" | "Separator" | "Text" | "Timestamp";
value: {
type: "Link";
value: ({
key: string;
} & {
__TYPE__: "LinkContent";
value: ({
__TYPE__: "ImageLink";
} & (({
kind: string;
} & ((({
kind: "image";
id: string;

@@ -176,11 +105,10 @@ url: string;

date?: string | null | undefined;
} & {
text?: string;
}) | {
kind: "image";
text: string;
}) & {
text?: string;
})) | ({
__TYPE__: "FileLink";
} & (({
kind: string;
} & ((({
kind: "file";
id: string;

@@ -192,7 +120,6 @@ url: string;

date?: string | null | undefined;
} & {
text?: string;
}) | {
kind: "file";
text: string;
}) & {
text?: string;
})) | ({

@@ -202,3 +129,4 @@ __TYPE__: "MediaLink";

kind: "media";
text: string;
} & {
text?: string;
}) | ({

@@ -208,10 +136,9 @@ __TYPE__: "DocumentLink";

id: string;
} & {
} | {
kind: "document";
}) & {
text?: string;
}) | {
kind: "document";
text: string;
})) | ({
__TYPE__: "ExternalLink";
} & (({
} & ((({
url: string;

@@ -224,15 +151,16 @@ } & {

} | null | undefined;
} & {
text?: string;
}) | {
kind: "web";
text: string;
}) & {
text?: string;
})) | ({
__TYPE__: "AnyLink";
} & {
text: string;
kind: "any";
} & {
text?: string;
});
}[];
})[];
}>;
export declare const RepeatableLegacy: (ctx: LegacyContentCtx, fieldType: NestableFieldTypes) => t.Type<RepeatableContent, WithTypes<Array<unknown>>, unknown>;
export declare const RepeatableLegacy: (ctx: LegacyContentCtx, fieldType: "Link") => t.Type<RepeatableContent, WithTypes<Array<unknown>>, unknown>;
export declare type RepeatableCustomType = Link;

@@ -239,0 +167,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 = exports.RepeatableItemContent = exports.RepeatableFieldType = exports.RepeatableContentType = void 0;
exports.traverseRepeatableContent = exports.RepeatableLegacy = exports.isRepeatableContent = exports.RepeatableContent = void 0;
const tslib_1 = require("tslib");

@@ -9,19 +9,12 @@ 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(exports.RepeatableContentType),
type: customtypes_1.NestableFieldTypes,
// TODO: How to ensure it's an array of only one type
value: t.array(exports.RepeatableItemContent),
__TYPE__: t.literal("RepeatableContent"),
type: t.literal("Link"),
value: t.array(nestable_1.LinkContent),
});
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)(codecDecode.decode(items), fp_ts_1.either.map((items) => {
const parsed = (0, function_1.pipe)(t.array(t.unknown).decode(items), fp_ts_1.either.map((items) => {
const parsedItems = items.reduce((acc, item) => {

@@ -43,3 +36,3 @@ let result;

type: fieldType,
__TYPE__: exports.RepeatableContentType,
__TYPE__: "RepeatableContent",
};

@@ -49,3 +42,3 @@ }));

}, (r) => {
const res = codecEncode.encode(r.value);
const res = t.array(nestable_1.LinkContent).encode(r.value);
const encodedItems = res.reduce((acc, item) => {

@@ -85,2 +78,5 @@ 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);

@@ -87,0 +83,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", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
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<{

@@ -435,5 +435,318 @@ 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<{

@@ -445,3 +758,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", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
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<{

@@ -559,3 +872,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", "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
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<{

@@ -674,84 +987,3 @@ text: t.StringC;

__TYPE__: t.LiteralC<"TableContent">;
}>>]>, 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>]>]>>;
}>>]>]>, t.Type<GroupContent, GroupContent, unknown>]>]>>;
}>>>;

@@ -104,8 +104,2 @@ 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">;

@@ -172,2 +166,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]>;
}>>;
}>]>>]>>;

@@ -283,8 +283,2 @@ }>>;

}>]>>, 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">;

@@ -351,2 +345,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]>;
}>>;
}>]>>]>>;

@@ -457,8 +457,2 @@ }>>;

}>]>>, 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">;

@@ -525,2 +519,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<{

@@ -633,8 +633,2 @@ type: t.LiteralC<"Group">;

}>]>>, 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">;

@@ -701,2 +695,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]>;
}>>;
}>]>>]>>;

@@ -814,8 +814,2 @@ }>>;

}>]>>, 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">;

@@ -882,2 +876,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<{

@@ -990,8 +990,2 @@ type: t.LiteralC<"Group">;

}>]>>, 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">;

@@ -1058,2 +1052,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]>;
}>>;
}>]>>]>>;

@@ -1060,0 +1060,0 @@ }>>;

@@ -100,8 +100,2 @@ 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">;

@@ -168,4 +162,10 @@ }>, 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]>;
}>>;
}>]>>]>;
export declare type NestableWidget = t.TypeOf<typeof NestableWidget>;
export declare type NestableFieldTypes = NestableWidget["type"];

@@ -33,3 +33,2 @@ "use strict";

Separator_1.Separator,
Table_1.Table,
Text_1.Text,

@@ -40,2 +39,3 @@ Timestamp_1.Timestamp,

IntegrationField_1.IntegrationField,
Table_1.Table,
]);

@@ -22,2 +22,6 @@ import * as t from "io-ts";

readonly rtl: "rtl";
readonly table: "table";
readonly tableRow: "table-row";
readonly tableCell: "table-cell";
readonly tableHeader: "table-header";
};

@@ -41,2 +45,6 @@ export declare const RichTextNodeTypeCodec: t.KeyofC<{

rtl: null;
table: null;
"table-row": null;
"table-cell": null;
"table-header": null;
}>;

@@ -43,0 +51,0 @@ export declare const RichTextConfig: t.ExactC<t.PartialC<{

@@ -30,2 +30,6 @@ "use strict";

rtl: "rtl",
table: "table",
tableRow: "table-row",
tableCell: "table-cell",
tableHeader: "table-header",
};

@@ -49,2 +53,6 @@ exports.RichTextNodeTypeCodec = t.keyof({

[exports.RichTextNodeType.rtl]: null,
[exports.RichTextNodeType.table]: null,
[exports.RichTextNodeType.tableRow]: null,
[exports.RichTextNodeType.tableCell]: null,
[exports.RichTextNodeType.tableHeader]: null,
});

@@ -51,0 +59,0 @@ const RichTextOptions = new t.Type("RichTextOptions", (u) => typeof u === "string", (u) => {

@@ -113,8 +113,2 @@ 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">;

@@ -181,2 +175,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]>;
}>>;
}>]>>]>>;

@@ -281,8 +281,2 @@ repeat: t.RecordC<t.Type<string, string, unknown>, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{

}>]>>, 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">;

@@ -349,2 +343,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]>;
}>>;
}>]>>]>>;

@@ -351,0 +351,0 @@ config: t.ExactC<t.PartialC<{

@@ -101,8 +101,2 @@ 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">;

@@ -169,2 +163,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<{

@@ -277,8 +277,2 @@ type: t.LiteralC<"Group">;

}>]>>, 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">;

@@ -345,2 +339,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]>;
}>>;
}>]>>]>>;

@@ -347,0 +347,0 @@ }>>;

@@ -100,8 +100,2 @@ 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">;

@@ -168,2 +162,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<{

@@ -276,8 +276,2 @@ type: t.LiteralC<"Group">;

}>]>>, 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">;

@@ -344,2 +338,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<{

@@ -452,8 +452,2 @@ type: t.LiteralC<"Group">;

}>]>>, 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">;

@@ -520,2 +514,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]>;
}>>;
}>]>>]>>;

@@ -522,0 +522,0 @@ }>>;

{
"name": "@prismicio/types-internal",
"version": "3.4.0-alpha.11",
"version": "3.4.0-alpha.12",
"description": "Prismic types for Custom Types and Prismic Data",

@@ -5,0 +5,0 @@ "keywords": [

@@ -7,2 +7,3 @@ import { isRight } from "fp-ts/lib/Either"

import { EmptyContent, EmptyLegacy, isEmptyContent } from "../EmptyContent"
import { isTableContent } from "."
import {

@@ -87,8 +88,3 @@ BooleanContent,

} from "./SeparatorContent"
import {
isTableContent,
TableContent,
TableContentType,
TableLegacy,
} from "./TableContent"
import { TableContent, TableContentType, TableLegacy } from "./TableContent"

@@ -112,4 +108,4 @@ export const NestableContent = t.union([

SeparatorContent,
RepeatableContent,
TableContent,
RepeatableContent,
])

@@ -148,5 +144,5 @@ export type NestableContent = t.TypeOf<typeof NestableContent>

isSeparatorContent(u) ||
isTableContent(u) ||
isEmptyContent(u) ||
isRepeatableContent(u)
isRepeatableContent(u) ||
isTableContent(u)

@@ -193,6 +189,6 @@ export const NestableLegacy = (ctx: LegacyContentCtx) => {

return SeparatorLegacy(ctx)
case "Repeatable.Link":
return RepeatableLegacy(ctx, "Link")
case "Table":
return TableLegacy(ctx)
case "Repeatable.Link":
return RepeatableLegacy(ctx, "Link")
default:

@@ -236,6 +232,6 @@ return

return SeparatorLegacy(ctx).encode(value)
case "RepeatableContent":
return RepeatableLegacy(ctx, value.type).encode(value)
case TableContentType:
return TableLegacy(ctx).encode(value)
case "RepeatableContent":
return RepeatableLegacy(ctx, value.type).encode(value)

@@ -242,0 +238,0 @@ default:

@@ -7,3 +7,3 @@ import { either } from "fp-ts"

import { hasContentType } from "../../../utils"
import { Block, BlockLegacy } from "./Blocks"
import { Block, BlockLegacy } from "./Block"

@@ -23,4 +23,2 @@ export const RichTextContentType = "StructuredTextContent"

export * from "./Blocks"
export const RichTextLegacy = (ctx: LegacyContentCtx) =>

@@ -44,1 +42,7 @@ 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"
import { TextBlock } from "./RichTextContent/TextBlock"

@@ -33,8 +33,9 @@ export const TableContentType = "TableContent"

})
export type TableRow = t.TypeOf<typeof TableRow>
const legacyReader = t.strict({
export const tableContentLegacyCodec = t.strict({
content: t.array(TableRow),
})
type TableLegacy = t.TypeOf<typeof legacyReader>
export type TableLegacy = t.TypeOf<typeof tableContentLegacyCodec>

@@ -47,3 +48,3 @@ export const TableLegacy = (ctx: LegacyContentCtx) =>

return pipe(
legacyReader.decode(u),
tableContentLegacyCodec.decode(u),
either.map((t) =>

@@ -57,3 +58,3 @@ TableContent.encode({ ...t, __TYPE__: TableContentType }),

return {
content: legacyReader.encode(t),
content: tableContentLegacyCodec.encode(t),
types: { [ctx.keyOfType]: "Table" },

@@ -65,3 +66,3 @@ }

export const TableContent = t.intersection([
legacyReader,
tableContentLegacyCodec,
t.strict({

@@ -68,0 +69,0 @@ __TYPE__: t.literal(TableContentType),

@@ -31,3 +31,2 @@ import * as t from "io-ts"

Separator,
Table,
Text,

@@ -38,2 +37,3 @@ Timestamp,

IntegrationField,
Table,
])

@@ -40,0 +40,0 @@

@@ -32,2 +32,6 @@ import { either } from "fp-ts/"

rtl: "rtl",
table: "table",
tableRow: "table-row",
tableCell: "table-cell",
tableHeader: "table-header",
} as const

@@ -52,2 +56,6 @@

[RichTextNodeType.rtl]: null,
[RichTextNodeType.table]: null,
[RichTextNodeType.tableRow]: null,
[RichTextNodeType.tableCell]: null,
[RichTextNodeType.tableHeader]: null,
})

@@ -54,0 +62,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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc