@prismicio/types-internal
Advanced tools
Comparing version 3.1.0-alpha.5 to 3.1.0
@@ -1,3 +0,2 @@ | ||
import type { SharedSliceItemContent, SliceItemContent, WidgetContent } from "../content"; | ||
import type { RepeatableContent } from "../content/fields/RepeatableContent"; | ||
import type { RepeatableContent, SharedSliceItemContent, SliceItemContent, WidgetContent } from "../content"; | ||
import type { CompositeSlice, Group, NestableWidget, StaticSlices, UID, VariationFields } from "../customtypes"; | ||
@@ -4,0 +3,0 @@ export declare type TraverseSliceContentFn = <S extends SliceItemContent | SharedSliceItemContent, D extends VariationFields | CompositeSlice | Group | NestableWidget>({ path, key, apiId, model, content, }: { |
@@ -13,3 +13,2 @@ "use strict"; | ||
const nestable_1 = require("./nestable"); | ||
const RepeatableContent_1 = require("./RepeatableContent"); | ||
const withDefaultValues_1 = require("./withDefaultValues"); | ||
@@ -150,3 +149,3 @@ exports.GroupItemContentType = "GroupItemContent"; | ||
fieldContent.__TYPE__ === "RepeatableContent") { | ||
transformedField = (0, RepeatableContent_1.traverseRepeatableContent)({ | ||
transformedField = (0, nestable_1.traverseRepeatableContent)({ | ||
path: groupItemPath.concat([{ key: fieldKey, type: "Widget" }]), | ||
@@ -153,0 +152,0 @@ key: fieldKey, |
export * from "./EmptyContent"; | ||
export * from "./GroupContent"; | ||
export * from "./nestable"; | ||
export * from "./RepeatableContent"; | ||
export * from "./slices"; | ||
export * from "./UIDContent"; | ||
export * from "./WidgetContent"; |
@@ -7,5 +7,4 @@ "use strict"; | ||
(0, tslib_1.__exportStar)(require("./nestable"), exports); | ||
(0, tslib_1.__exportStar)(require("./RepeatableContent"), exports); | ||
(0, tslib_1.__exportStar)(require("./slices"), exports); | ||
(0, tslib_1.__exportStar)(require("./UIDContent"), exports); | ||
(0, tslib_1.__exportStar)(require("./WidgetContent"), exports); |
@@ -9,3 +9,4 @@ export * from "./BooleanContent"; | ||
export * from "./NestableContent"; | ||
export * from "./RepeatableContent"; | ||
export * from "./RichTextContent"; | ||
export * from "./SeparatorContent"; |
@@ -12,3 +12,4 @@ "use strict"; | ||
(0, tslib_1.__exportStar)(require("./NestableContent"), exports); | ||
(0, tslib_1.__exportStar)(require("./RepeatableContent"), exports); | ||
(0, tslib_1.__exportStar)(require("./RichTextContent"), exports); | ||
(0, tslib_1.__exportStar)(require("./SeparatorContent"), exports); |
@@ -8,3 +8,2 @@ "use strict"; | ||
const EmptyContent_1 = require("../EmptyContent"); | ||
const RepeatableContent_1 = require("../RepeatableContent"); | ||
const BooleanContent_1 = require("./BooleanContent"); | ||
@@ -18,2 +17,3 @@ const EmbedContent_1 = require("./EmbedContent"); | ||
const LinkContent_1 = require("./LinkContent"); | ||
const RepeatableContent_1 = require("./RepeatableContent"); | ||
const RichTextContent_1 = require("./RichTextContent"); | ||
@@ -20,0 +20,0 @@ const SeparatorContent_1 = require("./SeparatorContent"); |
@@ -8,10 +8,8 @@ import * as t from "io-ts"; | ||
type: t.LiteralC<"Link">; | ||
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{ | ||
key: t.Type<string, string, unknown>; | ||
}>>, t.ExactC<t.TypeC<{ | ||
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; | ||
@@ -25,10 +23,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; | ||
@@ -40,17 +39,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; | ||
@@ -65,20 +66,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; | ||
}>]>>]>]>; | ||
}>>]>>; | ||
}>>]>]>; | ||
}>>>; | ||
}>>; | ||
@@ -89,10 +88,8 @@ export declare type RepeatableContent = t.TypeOf<typeof RepeatableContent>; | ||
type: "Link"; | ||
value: ({ | ||
key: string; | ||
} & { | ||
value: { | ||
__TYPE__: "LinkContent"; | ||
value: ({ | ||
__TYPE__: "ImageLink"; | ||
} & ((({ | ||
kind: "image"; | ||
} & (({ | ||
kind: string; | ||
id: string; | ||
@@ -106,10 +103,11 @@ url: string; | ||
date?: string | null | undefined; | ||
} & { | ||
text?: string; | ||
}) | { | ||
kind: "image"; | ||
}) & { | ||
text?: string; | ||
text: string; | ||
})) | ({ | ||
__TYPE__: "FileLink"; | ||
} & ((({ | ||
kind: "file"; | ||
} & (({ | ||
kind: string; | ||
id: string; | ||
@@ -121,6 +119,7 @@ url: string; | ||
date?: string | null | undefined; | ||
} & { | ||
text?: string; | ||
}) | { | ||
kind: "file"; | ||
}) & { | ||
text?: string; | ||
text: string; | ||
})) | ({ | ||
@@ -130,4 +129,3 @@ __TYPE__: "MediaLink"; | ||
kind: "media"; | ||
} & { | ||
text?: string; | ||
text: string; | ||
}) | ({ | ||
@@ -137,9 +135,10 @@ __TYPE__: "DocumentLink"; | ||
id: string; | ||
} | { | ||
} & { | ||
text?: string; | ||
}) | { | ||
kind: "document"; | ||
}) & { | ||
text?: string; | ||
text: string; | ||
})) | ({ | ||
__TYPE__: "ExternalLink"; | ||
} & ((({ | ||
} & (({ | ||
url: string; | ||
@@ -152,14 +151,13 @@ } & { | ||
} | null | undefined; | ||
} & { | ||
text?: string; | ||
}) | { | ||
kind: "web"; | ||
}) & { | ||
text?: string; | ||
text: string; | ||
})) | ({ | ||
__TYPE__: "AnyLink"; | ||
} & { | ||
kind: "any"; | ||
} & { | ||
text?: string; | ||
text: string; | ||
}); | ||
})[]; | ||
}[]; | ||
}>; | ||
@@ -166,0 +164,0 @@ export declare const RepeatableLegacy: (ctx: LegacyContentCtx, fieldType: "Link") => t.Type<RepeatableContent, WithTypes<Array<unknown>>, unknown>; |
@@ -15,5 +15,4 @@ "use strict"; | ||
const nestable_1 = require("../../nestable"); | ||
const RepeatableContent_1 = require("../../RepeatableContent"); | ||
const withDefaultValues_1 = require("../../withDefaultValues"); | ||
const RepeatableContent_2 = require("./RepeatableContent"); | ||
const RepeatableContent_1 = require("./RepeatableContent"); | ||
const SlicePrimaryContent_1 = require("./SlicePrimaryContent"); | ||
@@ -36,3 +35,3 @@ exports.SharedSliceContentType = "SharedSliceContent"; | ||
]); | ||
const result = (0, RepeatableContent_2.RepeatableWidgetsLegacy)(itemsCtx).decode(parsedSlice.items); | ||
const result = (0, RepeatableContent_1.RepeatableWidgetsLegacy)(itemsCtx).decode(parsedSlice.items); | ||
if (!result || (0, Either_1.isLeft)(result)) | ||
@@ -82,3 +81,3 @@ return; | ||
]); | ||
const result = (0, RepeatableContent_2.RepeatableWidgetsLegacy)(itemsCtx).encode(s.items); | ||
const result = (0, RepeatableContent_1.RepeatableWidgetsLegacy)(itemsCtx).encode(s.items); | ||
return result; | ||
@@ -105,3 +104,3 @@ })() || []; | ||
primary: t.record(t.string, SlicePrimaryContent_1.SlicePrimaryContent), | ||
items: RepeatableContent_2.RepeatableWidgets, | ||
items: RepeatableContent_1.RepeatableWidgets, | ||
}); | ||
@@ -141,4 +140,4 @@ function sharedSliceContentWithDefaultValues(customType, content) { | ||
} | ||
else if ((0, RepeatableContent_1.isRepeatableContent)(fieldContent)) { | ||
return (0, RepeatableContent_1.traverseRepeatableContent)({ | ||
else if ((0, nestable_1.isRepeatableContent)(fieldContent)) { | ||
return (0, nestable_1.traverseRepeatableContent)({ | ||
path: path.concat([ | ||
@@ -145,0 +144,0 @@ { key: "primary", type: "primary" }, |
{ | ||
"name": "@prismicio/types-internal", | ||
"version": "3.1.0-alpha.5", | ||
"version": "3.1.0", | ||
"description": "Prismic types for Custom Types and Prismic Data", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
import type { | ||
RepeatableContent, | ||
SharedSliceItemContent, | ||
@@ -6,3 +7,2 @@ SliceItemContent, | ||
} from "../content" | ||
import type { RepeatableContent } from "../content/fields/RepeatableContent" | ||
import type { | ||
@@ -9,0 +9,0 @@ CompositeSlice, |
@@ -22,4 +22,8 @@ import { either } from "fp-ts" | ||
import { hasContentType } from "../utils" | ||
import { isNestableContent, NestableContent, NestableLegacy } from "./nestable" | ||
import { traverseRepeatableContent } from "./RepeatableContent" | ||
import { | ||
isNestableContent, | ||
NestableContent, | ||
NestableLegacy, | ||
traverseRepeatableContent, | ||
} from "./nestable" | ||
import { repeatableContentWithDefaultNestableContentValues } from "./withDefaultValues" | ||
@@ -26,0 +30,0 @@ |
export * from "./EmptyContent" | ||
export * from "./GroupContent" | ||
export * from "./nestable" | ||
export * from "./RepeatableContent" | ||
export * from "./slices" | ||
export * from "./UIDContent" | ||
export * from "./WidgetContent" |
@@ -9,3 +9,4 @@ export * from "./BooleanContent" | ||
export * from "./NestableContent" | ||
export * from "./RepeatableContent" | ||
export * from "./RichTextContent" | ||
export * from "./SeparatorContent" |
@@ -8,7 +8,2 @@ import { isRight } from "fp-ts/lib/Either" | ||
import { | ||
isRepeatableContent, | ||
RepeatableContent, | ||
RepeatableLegacy, | ||
} from "../RepeatableContent" | ||
import { | ||
BooleanContent, | ||
@@ -76,2 +71,7 @@ BooleanContentDefaultValue, | ||
import { | ||
isRepeatableContent, | ||
RepeatableContent, | ||
RepeatableLegacy, | ||
} from "./RepeatableContent" | ||
import { | ||
isRichTextContent, | ||
@@ -78,0 +78,0 @@ RichTextContent, |
@@ -28,7 +28,7 @@ import { either } from "fp-ts" | ||
} from "../../GroupContent" | ||
import { isNestableContent } from "../../nestable" | ||
import { | ||
isNestableContent, | ||
isRepeatableContent, | ||
traverseRepeatableContent, | ||
} from "../../RepeatableContent" | ||
} from "../../nestable" | ||
import { | ||
@@ -35,0 +35,0 @@ repeatableContentWithDefaultNestableContentValues, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3331325
333
80001
1
6