@prismicio/types-internal 0.2.0 → 0.2.2

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.
Files changed (98) hide show
  1. package/lib/customtypes/CustomType.d.ts +2 -2
  2. package/lib/customtypes/CustomType.js +38 -56
  3. package/lib/customtypes/Format.js +2 -5
  4. package/lib/customtypes/Section.d.ts +1 -1
  5. package/lib/customtypes/Section.js +9 -32
  6. package/lib/customtypes/index.js +4 -30
  7. package/lib/customtypes/widgets/Group.js +9 -33
  8. package/lib/customtypes/widgets/UID.js +7 -31
  9. package/lib/customtypes/widgets/Widget.d.ts +1 -1
  10. package/lib/customtypes/widgets/Widget.js +14 -40
  11. package/lib/customtypes/widgets/WidgetTypes.js +1 -3
  12. package/lib/customtypes/widgets/index.js +7 -35
  13. package/lib/customtypes/widgets/nestable/BooleanField.js +6 -30
  14. package/lib/customtypes/widgets/nestable/Color.js +7 -31
  15. package/lib/customtypes/widgets/nestable/Date.js +7 -31
  16. package/lib/customtypes/widgets/nestable/Embed.js +7 -31
  17. package/lib/customtypes/widgets/nestable/GeoPoint.js +7 -31
  18. package/lib/customtypes/widgets/nestable/Image.js +10 -34
  19. package/lib/customtypes/widgets/nestable/IntegrationField.js +7 -31
  20. package/lib/customtypes/widgets/nestable/Link.js +13 -35
  21. package/lib/customtypes/widgets/nestable/NestableWidget.js +32 -56
  22. package/lib/customtypes/widgets/nestable/Number.js +11 -35
  23. package/lib/customtypes/widgets/nestable/Range.js +11 -35
  24. package/lib/customtypes/widgets/nestable/RichText.js +16 -36
  25. package/lib/customtypes/widgets/nestable/Select.js +8 -32
  26. package/lib/customtypes/widgets/nestable/Separator.js +6 -30
  27. package/lib/customtypes/widgets/nestable/Text.js +7 -31
  28. package/lib/customtypes/widgets/nestable/Timestamp.js +7 -31
  29. package/lib/customtypes/widgets/nestable/index.js +15 -36
  30. package/lib/customtypes/widgets/shared/ImageConstraint.js +9 -30
  31. package/lib/customtypes/widgets/shared/index.js +1 -8
  32. package/lib/customtypes/widgets/slices/CompositeSlice.js +10 -34
  33. package/lib/customtypes/widgets/slices/LegacySlice.js +6 -30
  34. package/lib/customtypes/widgets/slices/SharedSlice.js +9 -33
  35. package/lib/customtypes/widgets/slices/SharedSliceRef.js +4 -28
  36. package/lib/customtypes/widgets/slices/Slice.d.ts +4 -4
  37. package/lib/customtypes/widgets/slices/Slice.js +1 -2
  38. package/lib/customtypes/widgets/slices/Slices.js +27 -54
  39. package/lib/customtypes/widgets/slices/SlicesTypes.js +1 -3
  40. package/lib/customtypes/widgets/slices/index.js +7 -37
  41. package/lib/documents/DocumentData.js +4 -25
  42. package/lib/documents/index.js +2 -28
  43. package/lib/documents/widgets/EmptyContent.js +3 -6
  44. package/lib/documents/widgets/GroupContent.js +10 -32
  45. package/lib/documents/widgets/SimpleWidgetContent.d.ts +2 -2
  46. package/lib/documents/widgets/SimpleWidgetContent.js +27 -53
  47. package/lib/documents/widgets/StaticWidgetContent.js +8 -29
  48. package/lib/documents/widgets/UIDContent.js +4 -26
  49. package/lib/documents/widgets/index.js +22 -51
  50. package/lib/documents/widgets/nestable/BooleanContent.js +6 -28
  51. package/lib/documents/widgets/nestable/EmbedContent.d.ts +4 -4
  52. package/lib/documents/widgets/nestable/EmbedContent.js +20 -42
  53. package/lib/documents/widgets/nestable/FieldContent.js +8 -28
  54. package/lib/documents/widgets/nestable/GeoPointContent.js +5 -27
  55. package/lib/documents/widgets/nestable/ImageContent.d.ts +14 -14
  56. package/lib/documents/widgets/nestable/ImageContent.js +12 -34
  57. package/lib/documents/widgets/nestable/IntegrationFieldsContent.js +6 -28
  58. package/lib/documents/widgets/nestable/Link/DocumentLink.js +7 -30
  59. package/lib/documents/widgets/nestable/Link/ExternalLink.d.ts +4 -4
  60. package/lib/documents/widgets/nestable/Link/ExternalLink.js +10 -33
  61. package/lib/documents/widgets/nestable/Link/FileLink.js +10 -33
  62. package/lib/documents/widgets/nestable/Link/ImageLink.js +9 -32
  63. package/lib/documents/widgets/nestable/Link/LinkContent.d.ts +2 -2
  64. package/lib/documents/widgets/nestable/Link/LinkContent.js +9 -31
  65. package/lib/documents/widgets/nestable/Link/index.d.ts +8 -8
  66. package/lib/documents/widgets/nestable/Link/index.js +24 -51
  67. package/lib/documents/widgets/nestable/SeparatorContent.js +2 -5
  68. package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +8 -8
  69. package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +33 -60
  70. package/lib/documents/widgets/nestable/StructuredTextContent/index.js +7 -29
  71. package/lib/documents/widgets/nestable/index.d.ts +2 -2
  72. package/lib/documents/widgets/nestable/index.js +28 -63
  73. package/lib/documents/widgets/slices/CompositeSliceContent.d.ts +1 -1
  74. package/lib/documents/widgets/slices/CompositeSliceContent.js +9 -31
  75. package/lib/documents/widgets/slices/SharedSliceContent.d.ts +1 -1
  76. package/lib/documents/widgets/slices/SharedSliceContent.js +12 -34
  77. package/lib/documents/widgets/slices/SimpleSliceContent.js +2 -8
  78. package/lib/documents/widgets/slices/SliceWidgetContent.d.ts +1 -1
  79. package/lib/documents/widgets/slices/SliceWidgetContent.js +8 -33
  80. package/lib/documents/widgets/slices/SlicesContent.js +13 -35
  81. package/lib/documents/widgets/slices/index.js +5 -17
  82. package/lib/index.js +3 -25
  83. package/lib/validators/DateFromString.js +4 -25
  84. package/lib/validators/DateFromStringOrNumber.js +4 -25
  85. package/lib/validators/DateFromTsMs.js +4 -25
  86. package/lib/validators/IntFromNumber.js +4 -25
  87. package/lib/validators/IntFromPixels.js +7 -29
  88. package/lib/validators/NonEmptyString.js +3 -24
  89. package/lib/validators/NonEmptyStringOrNull.js +7 -12
  90. package/lib/validators/NumberOrNull.js +3 -24
  91. package/lib/validators/StringFromBoolean.js +4 -25
  92. package/lib/validators/StringFromNumber.js +4 -25
  93. package/lib/validators/StringOrNull.js +3 -24
  94. package/lib/validators/function.js +17 -47
  95. package/lib/validators/index.js +12 -48
  96. package/package.json +1 -1
  97. package/lib/documents/widgets/Widget.d.ts +0 -0
  98. package/lib/documents/widgets/Widget.js +0 -1
@@ -1,42 +1,18 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- const t = __importStar(require("io-ts"));
26
- const validators_1 = require("../../../validators");
27
- const WidgetTypes_1 = __importDefault(require("../WidgetTypes"));
1
+ import * as t from "io-ts";
2
+ import { StringOrNull } from "../../../validators";
3
+ import WidgetTypes from "../WidgetTypes";
28
4
  const DateConfig = t.exact(t.partial({
29
- label: validators_1.StringOrNull,
5
+ label: StringOrNull,
30
6
  placeholder: t.string,
31
7
  default: t.string,
32
8
  }));
33
9
  const Date = t.exact(t.intersection([
34
10
  t.type({
35
- type: t.literal(WidgetTypes_1.default.Date),
11
+ type: t.literal(WidgetTypes.Date),
36
12
  }),
37
13
  t.partial({
38
- fieldset: validators_1.StringOrNull,
14
+ fieldset: StringOrNull,
39
15
  config: DateConfig,
40
16
  }),
41
17
  ]));
42
- exports.default = Date;
18
+ export default Date;
@@ -1,42 +1,18 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- const t = __importStar(require("io-ts"));
26
- const validators_1 = require("../../../validators");
27
- const WidgetTypes_1 = __importDefault(require("../WidgetTypes"));
1
+ import * as t from "io-ts";
2
+ import { StringOrNull } from "../../../validators";
3
+ import WidgetTypes from "../WidgetTypes";
28
4
  const EmbedConfig = t.exact(t.partial({
29
- label: validators_1.StringOrNull,
5
+ label: StringOrNull,
30
6
  placeholder: t.string,
31
7
  useAsTitle: t.boolean,
32
8
  }));
33
9
  const Embed = t.exact(t.intersection([
34
10
  t.type({
35
- type: t.literal(WidgetTypes_1.default.Embed),
11
+ type: t.literal(WidgetTypes.Embed),
36
12
  }),
37
13
  t.partial({
38
- fieldset: validators_1.StringOrNull,
14
+ fieldset: StringOrNull,
39
15
  config: EmbedConfig,
40
16
  }),
41
17
  ]));
42
- exports.default = Embed;
18
+ export default Embed;
@@ -1,40 +1,16 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- const t = __importStar(require("io-ts"));
26
- const validators_1 = require("../../../validators");
27
- const WidgetTypes_1 = __importDefault(require("../WidgetTypes"));
1
+ import * as t from "io-ts";
2
+ import { StringOrNull } from "../../../validators";
3
+ import WidgetTypes from "../WidgetTypes";
28
4
  const GeoPointConfig = t.exact(t.partial({
29
- label: validators_1.StringOrNull,
5
+ label: StringOrNull,
30
6
  }));
31
7
  const GeoPoint = t.exact(t.intersection([
32
8
  t.type({
33
- type: t.literal(WidgetTypes_1.default.GeoPoint),
9
+ type: t.literal(WidgetTypes.GeoPoint),
34
10
  }),
35
11
  t.partial({
36
- fieldset: validators_1.StringOrNull,
12
+ fieldset: StringOrNull,
37
13
  config: GeoPointConfig,
38
14
  }),
39
15
  ]));
40
- exports.default = GeoPoint;
16
+ export default GeoPoint;
@@ -1,50 +1,26 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- const t = __importStar(require("io-ts"));
26
- const validators_1 = require("../../../validators");
27
- const ImageConstraint_1 = __importDefault(require("../shared/ImageConstraint"));
28
- const WidgetTypes_1 = __importDefault(require("../WidgetTypes"));
1
+ import * as t from "io-ts";
2
+ import { StringOrNull } from "../../../validators";
3
+ import ImageConstraint from "../shared/ImageConstraint";
4
+ import WidgetTypes from "../WidgetTypes";
29
5
  const Thumbnail = t.exact(t.intersection([
30
6
  t.type({
31
7
  name: t.string,
32
8
  }),
33
- ImageConstraint_1.default,
9
+ ImageConstraint,
34
10
  ]));
35
11
  const ImageConfig = t.exact(t.partial({
36
- label: validators_1.StringOrNull,
12
+ label: StringOrNull,
37
13
  placeholder: t.string,
38
- constraint: ImageConstraint_1.default,
14
+ constraint: ImageConstraint,
39
15
  thumbnails: t.array(Thumbnail),
40
16
  }));
41
17
  const Image = t.exact(t.intersection([
42
18
  t.type({
43
- type: t.literal(WidgetTypes_1.default.Image),
19
+ type: t.literal(WidgetTypes.Image),
44
20
  }),
45
21
  t.partial({
46
- fieldset: validators_1.StringOrNull,
22
+ fieldset: StringOrNull,
47
23
  config: ImageConfig,
48
24
  }),
49
25
  ]));
50
- exports.default = Image;
26
+ export default Image;
@@ -1,42 +1,18 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- const t = __importStar(require("io-ts"));
26
- const validators_1 = require("../../../validators");
27
- const WidgetTypes_1 = __importDefault(require("../WidgetTypes"));
1
+ import * as t from "io-ts";
2
+ import { StringOrNull } from "../../../validators";
3
+ import WidgetTypes from "../WidgetTypes";
28
4
  const IntegrationFieldConfig = t.exact(t.partial({
29
- label: validators_1.StringOrNull,
5
+ label: StringOrNull,
30
6
  placeholder: t.string,
31
7
  catalog: t.string,
32
8
  }));
33
9
  const IntegrationField = t.exact(t.intersection([
34
10
  t.type({
35
- type: t.literal(WidgetTypes_1.default.IntegrationField),
11
+ type: t.literal(WidgetTypes.IntegrationField),
36
12
  }),
37
13
  t.partial({
38
- fieldset: validators_1.StringOrNull,
14
+ fieldset: StringOrNull,
39
15
  config: IntegrationFieldConfig,
40
16
  }),
41
17
  ]));
42
- exports.default = IntegrationField;
18
+ export default IntegrationField;
@@ -1,56 +1,34 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- const Either_1 = require("fp-ts/lib/Either");
26
- const t = __importStar(require("io-ts"));
27
- const withFallback_1 = require("io-ts-types/lib/withFallback");
28
- const validators_1 = require("../../../validators");
29
- const WidgetTypes_1 = __importDefault(require("../WidgetTypes"));
1
+ import { either } from "fp-ts/lib/Either";
2
+ import * as t from "io-ts";
3
+ import { withFallback } from "io-ts-types/lib/withFallback";
4
+ import { StringOrNull } from "../../../validators";
5
+ import WidgetTypes from "../WidgetTypes";
30
6
  const arrayString = (entries) => {
31
7
  if (entries instanceof Array) {
32
8
  const isValidEntries = entries.reduce((acc, l) => acc && typeof l === "string", true);
33
9
  if (isValidEntries)
34
10
  return t.success(entries);
35
11
  }
12
+ return;
36
13
  };
37
14
  const plainString = (entries) => {
38
15
  if (typeof entries === "string") {
39
16
  return t.success([entries]);
40
17
  }
18
+ return;
41
19
  };
42
20
  const MasksArrayString = new t.Type("MasksArrayString", (u) => {
43
21
  return u instanceof Array;
44
22
  }, (u, context) => {
45
- return Either_1.either.chain(t.union([t.array(t.string), t.string]).validate(u, context), (masks) => {
23
+ return either.chain(t.union([t.array(t.string), t.string]).validate(u, context), (masks) => {
46
24
  return arrayString(masks) || plainString(masks) || t.failure(u, context);
47
25
  });
48
26
  }, (res) => res);
49
27
  const LinkConfig = t.exact(t.partial({
50
- label: validators_1.StringOrNull,
28
+ label: StringOrNull,
51
29
  useAsTitle: t.boolean,
52
30
  placeholder: t.string,
53
- select: (0, withFallback_1.withFallback)(t.union([
31
+ select: withFallback(t.union([
54
32
  t.literal("media"),
55
33
  t.literal("document"),
56
34
  t.literal("web"),
@@ -63,11 +41,11 @@ const LinkConfig = t.exact(t.partial({
63
41
  }));
64
42
  const Link = t.exact(t.intersection([
65
43
  t.type({
66
- type: t.literal(WidgetTypes_1.default.Link),
44
+ type: t.literal(WidgetTypes.Link),
67
45
  }),
68
46
  t.partial({
69
- fieldset: validators_1.StringOrNull,
47
+ fieldset: StringOrNull,
70
48
  config: LinkConfig,
71
49
  }),
72
50
  ]));
73
- exports.default = Link;
51
+ export default Link;
@@ -1,58 +1,34 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- const t = __importStar(require("io-ts"));
26
- const BooleanField_1 = __importDefault(require("./BooleanField"));
27
- const Color_1 = __importDefault(require("./Color"));
28
- const Date_1 = __importDefault(require("./Date"));
29
- const Embed_1 = __importDefault(require("./Embed"));
30
- const GeoPoint_1 = __importDefault(require("./GeoPoint"));
31
- const Image_1 = __importDefault(require("./Image"));
32
- const IntegrationField_1 = __importDefault(require("./IntegrationField"));
33
- const Link_1 = __importDefault(require("./Link"));
34
- const Number_1 = __importDefault(require("./Number"));
35
- const Range_1 = __importDefault(require("./Range"));
36
- const RichText_1 = __importDefault(require("./RichText"));
37
- const Select_1 = __importDefault(require("./Select"));
38
- const Separator_1 = __importDefault(require("./Separator"));
39
- const Text_1 = __importDefault(require("./Text"));
40
- const Timestamp_1 = __importDefault(require("./Timestamp"));
1
+ import * as t from "io-ts";
2
+ import BooleanField from "./BooleanField";
3
+ import Color from "./Color";
4
+ import Date from "./Date";
5
+ import Embed from "./Embed";
6
+ import GeoPoint from "./GeoPoint";
7
+ import Image from "./Image";
8
+ import IntegrationField from "./IntegrationField";
9
+ import Link from "./Link";
10
+ import Number from "./Number";
11
+ import Range from "./Range";
12
+ import RichText from "./RichText";
13
+ import Select from "./Select";
14
+ import Separator from "./Separator";
15
+ import Text from "./Text";
16
+ import Timestamp from "./Timestamp";
41
17
  const NestableWidget = t.union([
42
- Color_1.default,
43
- BooleanField_1.default,
44
- Embed_1.default,
45
- GeoPoint_1.default,
46
- Date_1.default,
47
- Number_1.default,
48
- Range_1.default,
49
- RichText_1.default,
50
- Select_1.default,
51
- Separator_1.default,
52
- Text_1.default,
53
- Timestamp_1.default,
54
- Link_1.default,
55
- Image_1.default,
56
- IntegrationField_1.default,
18
+ Color,
19
+ BooleanField,
20
+ Embed,
21
+ GeoPoint,
22
+ Date,
23
+ Number,
24
+ Range,
25
+ RichText,
26
+ Select,
27
+ Separator,
28
+ Text,
29
+ Timestamp,
30
+ Link,
31
+ Image,
32
+ IntegrationField,
57
33
  ]);
58
- exports.default = NestableWidget;
34
+ export default NestableWidget;
@@ -1,45 +1,21 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- const t = __importStar(require("io-ts"));
26
- const NumberFromString_1 = require("io-ts-types/lib/NumberFromString");
27
- const validators_1 = require("../../../validators");
28
- const WidgetTypes_1 = __importDefault(require("../WidgetTypes"));
1
+ import * as t from "io-ts";
2
+ import { NumberFromString } from "io-ts-types/lib/NumberFromString";
3
+ import { StringOrNull } from "../../../validators";
4
+ import WidgetTypes from "../WidgetTypes";
29
5
  const NumberConfig = t.exact(t.partial({
30
- label: validators_1.StringOrNull,
6
+ label: StringOrNull,
31
7
  placeholder: t.string,
32
- min: t.union([t.number, NumberFromString_1.NumberFromString]),
33
- max: t.union([t.number, NumberFromString_1.NumberFromString]),
34
- step: t.union([t.number, NumberFromString_1.NumberFromString]),
8
+ min: t.union([t.number, NumberFromString]),
9
+ max: t.union([t.number, NumberFromString]),
10
+ step: t.union([t.number, NumberFromString]),
35
11
  }));
36
12
  const Number = t.exact(t.intersection([
37
13
  t.type({
38
- type: t.literal(WidgetTypes_1.default.Number),
14
+ type: t.literal(WidgetTypes.Number),
39
15
  }),
40
16
  t.partial({
41
- fieldset: validators_1.StringOrNull,
17
+ fieldset: StringOrNull,
42
18
  config: NumberConfig,
43
19
  }),
44
20
  ]));
45
- exports.default = Number;
21
+ export default Number;
@@ -1,45 +1,21 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- const t = __importStar(require("io-ts"));
26
- const NumberFromString_1 = require("io-ts-types/lib/NumberFromString");
27
- const validators_1 = require("../../../validators");
28
- const WidgetTypes_1 = __importDefault(require("../WidgetTypes"));
1
+ import * as t from "io-ts";
2
+ import { NumberFromString } from "io-ts-types/lib/NumberFromString";
3
+ import { StringOrNull } from "../../../validators";
4
+ import WidgetTypes from "../WidgetTypes";
29
5
  const RangeConfig = t.exact(t.partial({
30
- label: validators_1.StringOrNull,
6
+ label: StringOrNull,
31
7
  placeholder: t.string,
32
- min: t.union([t.number, NumberFromString_1.NumberFromString]),
33
- max: t.union([t.number, NumberFromString_1.NumberFromString]),
34
- step: t.union([t.number, NumberFromString_1.NumberFromString]),
8
+ min: t.union([t.number, NumberFromString]),
9
+ max: t.union([t.number, NumberFromString]),
10
+ step: t.union([t.number, NumberFromString]),
35
11
  }));
36
12
  const Range = t.exact(t.intersection([
37
13
  t.type({
38
- type: t.literal(WidgetTypes_1.default.Range),
14
+ type: t.literal(WidgetTypes.Range),
39
15
  }),
40
16
  t.partial({
41
- fieldset: validators_1.StringOrNull,
17
+ fieldset: StringOrNull,
42
18
  config: RangeConfig,
43
19
  }),
44
20
  ]));
45
- exports.default = Range;
21
+ export default Range;