@prismicio/types-internal 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,25 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrateSimpleSlice = exports.traverseSimpleSliceContent = exports.SimpleSliceLegacy = exports.isSimpleSliceContent = exports.SimpleSliceContent = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const t = (0, tslib_1.__importStar)(require("io-ts"));
6
+ const GroupContent_1 = require("../../GroupContent");
6
7
  const nestable_1 = require("../../nestable");
7
- const RepeatableContent_1 = require("./RepeatableContent");
8
- exports.SimpleSliceContent = t.union([
9
- nestable_1.NestableContent,
10
- RepeatableContent_1.RepeatableWidgetContent,
11
- ]);
12
- const isSimpleSliceContent = (u) => (0, nestable_1.isNestableContent)(u) || (0, RepeatableContent_1.isRepeatableWidgetContent)(u);
8
+ exports.SimpleSliceContent = t.union([nestable_1.NestableContent, GroupContent_1.GroupContent]);
9
+ const isSimpleSliceContent = (u) => (0, nestable_1.isNestableContent)(u) || (0, GroupContent_1.isGroupContent)(u);
13
10
  exports.isSimpleSliceContent = isSimpleSliceContent;
14
11
  const SimpleSliceLegacy = (ctx) => {
15
12
  return {
16
13
  decode: (() => {
17
14
  if (ctx.fieldType === "Group")
18
- return (0, RepeatableContent_1.RepeatableWidgetLegacy)(ctx).decode.bind(null);
15
+ return (0, GroupContent_1.GroupLegacy)(ctx).decode.bind(null);
19
16
  return (0, nestable_1.NestableLegacy)(ctx).decode.bind(null);
20
17
  })(),
21
18
  encode: (value) => {
22
19
  switch (value.__TYPE__) {
23
20
  case "GroupContentType":
24
- return (0, RepeatableContent_1.RepeatableWidgetLegacy)(ctx).encode(value);
21
+ return (0, GroupContent_1.GroupLegacy)(ctx).encode(value);
25
22
  default:
26
23
  return (0, nestable_1.NestableLegacy)(ctx).encode(value);
27
24
  }
@@ -31,8 +28,8 @@ const SimpleSliceLegacy = (ctx) => {
31
28
  exports.SimpleSliceLegacy = SimpleSliceLegacy;
32
29
  function traverseSimpleSliceContent({ path, sliceKey, sliceName, model, content, }) {
33
30
  return (transformWidget, transformSlice) => {
34
- if ((0, RepeatableContent_1.isRepeatableWidgetContent)(content.widget)) {
35
- const convertedGroupWidget = (0, RepeatableContent_1.traverseRepeatableWidgetContent)({
31
+ if ((0, GroupContent_1.isGroupContent)(content.widget)) {
32
+ const convertedGroupWidget = (0, GroupContent_1.traverseGroupContent)({
36
33
  path,
37
34
  key: content.key,
38
35
  apiId: content.name,