@prismicio/types-internal 0.3.0 → 0.3.1

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,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Sections = exports.DynamicSection = exports.StaticSection = exports.sectionReader = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const t = (0, tslib_1.__importStar)(require("io-ts"));
6
+ const widgets_1 = require("../documents/widgets");
6
7
  const Widget_1 = require("./widgets/Widget");
7
8
  function sectionReader(codec) {
8
- return t.record(t.string, codec);
9
+ return t.record(widgets_1.WidgetKey, codec); // WidgetId -> Widget Data
9
10
  }
10
11
  exports.sectionReader = sectionReader;
11
12
  exports.StaticSection = sectionReader(Widget_1.StaticWidget);
@@ -9,7 +9,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
9
9
  config: t.ExactC<t.PartialC<{
10
10
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
11
11
  repeat: t.BooleanC;
12
- fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
12
+ fields: t.RecordC<t.Type<string, string, unknown>, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
13
13
  type: t.LiteralC<WidgetTypes.Color>;
14
14
  }>, t.PartialC<{
15
15
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
@@ -2,13 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const t = (0, tslib_1.__importStar)(require("io-ts"));
5
+ const widgets_1 = require("../../documents/widgets");
5
6
  const validators_1 = require("../../validators");
6
7
  const NestableWidget_1 = (0, tslib_1.__importDefault)(require("./nestable/NestableWidget"));
7
8
  const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("./WidgetTypes"));
8
9
  const GroupConfig = t.exact(t.partial({
9
10
  label: validators_1.StringOrNull,
10
11
  repeat: t.boolean,
11
- fields: t.record(t.string, NestableWidget_1.default),
12
+ fields: t.record(widgets_1.WidgetKey, NestableWidget_1.default),
12
13
  }));
13
14
  const Group = t.exact(t.intersection([
14
15
  t.type({