@prismicio/types-internal
Advanced tools
Comparing version 3.3.0-alpha.0 to 3.3.0-alpha.1
@@ -161,3 +161,2 @@ "use strict"; | ||
const transformedWidget = (() => { | ||
var _a; | ||
switch (content.__TYPE__) { | ||
@@ -186,5 +185,3 @@ case "SliceContentType": | ||
apiId: key, | ||
model: (fieldModel === null || fieldModel === void 0 ? void 0 : fieldModel.type) === "Link" && ((_a = fieldModel.config) === null || _a === void 0 ? void 0 : _a.repeat) | ||
? fieldModel | ||
: undefined, | ||
model: (fieldModel === null || fieldModel === void 0 ? void 0 : fieldModel.type) === "Link" ? fieldModel : undefined, | ||
content, | ||
@@ -191,0 +188,0 @@ })(transformWidget); |
@@ -132,3 +132,2 @@ "use strict"; | ||
const groupItemFields = groupItem.value.reduce((acc, [fieldKey, fieldContent]) => { | ||
var _a; | ||
const fieldDef = model === null || model === void 0 ? void 0 : model[fieldKey]; | ||
@@ -146,4 +145,3 @@ let transformedField; | ||
} | ||
else if ((!fieldDef || | ||
((fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.type) === "Link" && ((_a = fieldDef.config) === null || _a === void 0 ? void 0 : _a.repeat))) && | ||
else if ((!fieldDef || (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.type) === "Link") && | ||
fieldContent.__TYPE__ === "RepeatableContent") { | ||
@@ -150,0 +148,0 @@ transformedField = (0, nestable_1.traverseRepeatableContent)({ |
@@ -65,2 +65,9 @@ "use strict"; | ||
]); | ||
// Content inside repeatable can't be repeatable. | ||
const newModel = (model === null || model === void 0 ? void 0 : model.type) === "Link" && model.config | ||
? { | ||
...model, | ||
config: { ...model.config, repeat: false }, | ||
} | ||
: model; | ||
const transformedField = transform({ | ||
@@ -70,3 +77,3 @@ path: itemPath, | ||
apiId: apiId, | ||
model: model, | ||
model: newModel, | ||
content: fieldContent, | ||
@@ -73,0 +80,0 @@ }); |
@@ -123,3 +123,2 @@ "use strict"; | ||
const transformedField = (() => { | ||
var _a; | ||
if ((0, GroupContent_1.isGroupContent)(fieldContent)) { | ||
@@ -146,5 +145,3 @@ return (0, GroupContent_1.traverseGroupContent)({ | ||
content: fieldContent, | ||
model: (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.type) === "Link" && ((_a = fieldDef.config) === null || _a === void 0 ? void 0 : _a.repeat) | ||
? fieldDef | ||
: undefined, | ||
model: (fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.type) === "Link" ? fieldDef : undefined, | ||
})(transformWidget); | ||
@@ -151,0 +148,0 @@ } |
@@ -104,6 +104,3 @@ import type { Variation } from "../widgets/slices"; | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -277,6 +274,3 @@ }) | ({ | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -450,6 +444,3 @@ }) | ({ | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -622,6 +613,3 @@ }) | ({ | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -797,6 +785,3 @@ }) | ({ | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -970,6 +955,3 @@ }) | ({ | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -1143,6 +1125,3 @@ }) | ({ | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -1315,6 +1294,3 @@ }) | ({ | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -1321,0 +1297,0 @@ }) | ({ |
@@ -136,6 +136,3 @@ import * as t from "io-ts"; | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -311,6 +308,3 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -481,6 +475,3 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -653,6 +644,3 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -830,6 +818,3 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -1002,6 +987,3 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -1008,0 +990,0 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ |
@@ -18,6 +18,3 @@ import * as t from "io-ts"; | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -44,8 +41,5 @@ export declare type LinkConfig = t.TypeOf<typeof LinkConfig>; | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
}>]>>; | ||
export declare type Link = t.TypeOf<typeof Link>; |
@@ -51,6 +51,3 @@ "use strict"; | ||
repeat: t.boolean, | ||
variant: t.strict({ | ||
options: t.array(t.string), | ||
default_value: t.string, | ||
}), | ||
variant: t.array(t.string), | ||
})); | ||
@@ -57,0 +54,0 @@ exports.Link = t.exact(t.intersection([ |
@@ -132,6 +132,3 @@ import * as t from "io-ts"; | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -138,0 +135,0 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ |
@@ -145,6 +145,3 @@ import * as t from "io-ts"; | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -309,6 +306,3 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -315,0 +309,0 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ |
@@ -133,6 +133,3 @@ import * as t from "io-ts"; | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -305,6 +302,3 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -311,0 +305,0 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ |
@@ -132,6 +132,3 @@ import * as t from "io-ts"; | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -304,6 +301,3 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -476,6 +470,3 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
repeat: t.BooleanC; | ||
variant: t.ExactC<t.TypeC<{ | ||
options: t.ArrayC<t.StringC>; | ||
default_value: t.StringC; | ||
}>>; | ||
variant: t.ArrayC<t.StringC>; | ||
}>>; | ||
@@ -600,6 +591,3 @@ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{ | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -773,6 +761,3 @@ }) | ({ | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -946,6 +931,3 @@ }) | ({ | ||
repeat?: boolean; | ||
variant?: { | ||
options: string[]; | ||
default_value: string; | ||
}; | ||
variant?: string[]; | ||
}; | ||
@@ -952,0 +934,0 @@ }) | ({ |
{ | ||
"name": "@prismicio/types-internal", | ||
"version": "3.3.0-alpha.0", | ||
"version": "3.3.0-alpha.1", | ||
"description": "Prismic types for Custom Types and Prismic Data", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -302,6 +302,3 @@ import { either } from "fp-ts" | ||
apiId: key, | ||
model: | ||
fieldModel?.type === "Link" && fieldModel.config?.repeat | ||
? fieldModel | ||
: undefined, | ||
model: fieldModel?.type === "Link" ? fieldModel : undefined, | ||
content, | ||
@@ -308,0 +305,0 @@ })(transformWidget) |
@@ -244,4 +244,3 @@ import { either } from "fp-ts" | ||
} else if ( | ||
(!fieldDef || | ||
(fieldDef?.type === "Link" && fieldDef.config?.repeat)) && | ||
(!fieldDef || fieldDef?.type === "Link") && | ||
fieldContent.__TYPE__ === "RepeatableContent" | ||
@@ -248,0 +247,0 @@ ) { |
@@ -116,2 +116,11 @@ import { either } from "fp-ts" | ||
// Content inside repeatable can't be repeatable. | ||
const newModel = | ||
model?.type === "Link" && model.config | ||
? { | ||
...model, | ||
config: { ...model.config, repeat: false }, | ||
} | ||
: model | ||
const transformedField = transform({ | ||
@@ -121,3 +130,3 @@ path: itemPath, | ||
apiId: apiId, | ||
model: model, | ||
model: newModel, | ||
content: fieldContent, | ||
@@ -124,0 +133,0 @@ }) |
@@ -231,6 +231,3 @@ import { either } from "fp-ts" | ||
content: fieldContent, | ||
model: | ||
fieldDef?.type === "Link" && fieldDef.config?.repeat | ||
? fieldDef | ||
: undefined, | ||
model: fieldDef?.type === "Link" ? fieldDef : undefined, | ||
})(transformWidget) | ||
@@ -237,0 +234,0 @@ } else if (isNestableContent(fieldContent)) { |
@@ -89,6 +89,3 @@ import { either } from "fp-ts/lib/Either" | ||
variant: t.strict({ | ||
options: t.array(t.string), | ||
default_value: t.string, | ||
}), | ||
variant: t.array(t.string), | ||
}), | ||
@@ -95,0 +92,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
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
3342987
80176