@prismicio/types-internal 3.17.0 → 4.0.0-canary.72def6d
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.
- package/README.md +41 -25
- package/dist/common/asset.d.ts +22 -0
- package/dist/common/asset.d.ts.map +1 -0
- package/dist/common/asset.js +21 -0
- package/dist/common/asset.js.map +1 -0
- package/dist/common/embed.d.ts +21 -0
- package/dist/common/embed.d.ts.map +1 -0
- package/dist/common/embed.js +20 -0
- package/dist/common/embed.js.map +1 -0
- package/dist/common/hexaColorCode.d.ts +8 -0
- package/dist/common/hexaColorCode.d.ts.map +1 -0
- package/dist/common/hexaColorCode.js +8 -0
- package/dist/common/hexaColorCode.js.map +1 -0
- package/dist/common/nonEmptyString.d.ts +8 -0
- package/dist/common/nonEmptyString.d.ts.map +1 -0
- package/dist/common/nonEmptyString.js +7 -0
- package/dist/common/nonEmptyString.js.map +1 -0
- package/dist/common/widgetKey.d.ts +8 -0
- package/dist/common/widgetKey.d.ts.map +1 -0
- package/dist/common/widgetKey.js +8 -0
- package/dist/common/widgetKey.js.map +1 -0
- package/dist/content/boolean.d.ts +11 -0
- package/dist/content/boolean.d.ts.map +1 -0
- package/dist/content/boolean.js +11 -0
- package/dist/content/boolean.js.map +1 -0
- package/dist/content/codec/boolean.js +31 -0
- package/dist/content/codec/boolean.js.map +1 -0
- package/dist/content/codec/document.js +49 -0
- package/dist/content/codec/document.js.map +1 -0
- package/dist/content/codec/embed.js +42 -0
- package/dist/content/codec/embed.js.map +1 -0
- package/dist/content/codec/empty.js +35 -0
- package/dist/content/codec/empty.js.map +1 -0
- package/dist/content/codec/field.js +41 -0
- package/dist/content/codec/field.js.map +1 -0
- package/dist/content/codec/geopoint.js +32 -0
- package/dist/content/codec/geopoint.js.map +1 -0
- package/dist/content/codec/group.js +127 -0
- package/dist/content/codec/group.js.map +1 -0
- package/dist/content/codec/image.js +44 -0
- package/dist/content/codec/image.js.map +1 -0
- package/dist/content/codec/integrationField.js +31 -0
- package/dist/content/codec/integrationField.js.map +1 -0
- package/dist/content/codec/legacyContentCtx.d.ts +72 -0
- package/dist/content/codec/legacyContentCtx.d.ts.map +1 -0
- package/dist/content/codec/legacyContentCtx.js +76 -0
- package/dist/content/codec/legacyContentCtx.js.map +1 -0
- package/dist/content/codec/link.js +93 -0
- package/dist/content/codec/link.js.map +1 -0
- package/dist/content/codec/nestable.js +91 -0
- package/dist/content/codec/nestable.js.map +1 -0
- package/dist/content/codec/repeatable.js +56 -0
- package/dist/content/codec/repeatable.js.map +1 -0
- package/dist/content/codec/richText.js +87 -0
- package/dist/content/codec/richText.js.map +1 -0
- package/dist/content/codec/separator.js +26 -0
- package/dist/content/codec/separator.js.map +1 -0
- package/dist/content/codec/slice.js +220 -0
- package/dist/content/codec/slice.js.map +1 -0
- package/dist/content/codec/slices.js +106 -0
- package/dist/content/codec/slices.js.map +1 -0
- package/dist/content/codec/table.js +56 -0
- package/dist/content/codec/table.js.map +1 -0
- package/dist/content/codec/uid.js +31 -0
- package/dist/content/codec/uid.js.map +1 -0
- package/dist/content/codec/widget.js +39 -0
- package/dist/content/codec/widget.js.map +1 -0
- package/dist/content/document.d.ts +3026 -0
- package/dist/content/document.d.ts.map +1 -0
- package/dist/content/document.js +9 -0
- package/dist/content/document.js.map +1 -0
- package/dist/content/embed.d.ts +24 -0
- package/dist/content/embed.d.ts.map +1 -0
- package/dist/content/embed.js +12 -0
- package/dist/content/embed.js.map +1 -0
- package/dist/content/empty.d.ts +11 -0
- package/dist/content/empty.d.ts.map +1 -0
- package/dist/content/empty.js +11 -0
- package/dist/content/empty.js.map +1 -0
- package/dist/content/field.d.ts +78 -0
- package/dist/content/field.d.ts.map +1 -0
- package/dist/content/field.js +52 -0
- package/dist/content/field.js.map +1 -0
- package/dist/content/geopoint.d.ts +14 -0
- package/dist/content/geopoint.d.ts.map +1 -0
- package/dist/content/geopoint.js +9 -0
- package/dist/content/geopoint.js.map +1 -0
- package/dist/content/group.d.ts +18 -0
- package/dist/content/group.d.ts.map +1 -0
- package/dist/content/group.js +19 -0
- package/dist/content/group.js.map +1 -0
- package/dist/content/image.d.ts +52 -0
- package/dist/content/image.d.ts.map +1 -0
- package/dist/content/image.js +10 -0
- package/dist/content/image.js.map +1 -0
- package/dist/content/integrationField.d.ts +11 -0
- package/dist/content/integrationField.d.ts.map +1 -0
- package/dist/content/integrationField.js +11 -0
- package/dist/content/integrationField.js.map +1 -0
- package/dist/content/legacy/boolean.js +7 -0
- package/dist/content/legacy/boolean.js.map +1 -0
- package/dist/content/legacy/document.js +15 -0
- package/dist/content/legacy/document.js.map +1 -0
- package/dist/content/legacy/embed.js +23 -0
- package/dist/content/legacy/embed.js.map +1 -0
- package/dist/content/legacy/empty.js +7 -0
- package/dist/content/legacy/empty.js.map +1 -0
- package/dist/content/legacy/field.js +7 -0
- package/dist/content/legacy/field.js.map +1 -0
- package/dist/content/legacy/geopoint.js +10 -0
- package/dist/content/legacy/geopoint.js.map +1 -0
- package/dist/content/legacy/group.js +10 -0
- package/dist/content/legacy/group.js.map +1 -0
- package/dist/content/legacy/image.d.ts +1 -0
- package/dist/content/legacy/image.js +33 -0
- package/dist/content/legacy/image.js.map +1 -0
- package/dist/content/legacy/integrationField.js +7 -0
- package/dist/content/legacy/integrationField.js.map +1 -0
- package/dist/content/legacy/link.js +88 -0
- package/dist/content/legacy/link.js.map +1 -0
- package/dist/content/legacy/nestable.js +32 -0
- package/dist/content/legacy/nestable.js.map +1 -0
- package/dist/content/legacy/repeatable.js +13 -0
- package/dist/content/legacy/repeatable.js.map +1 -0
- package/dist/content/legacy/richText.js +100 -0
- package/dist/content/legacy/richText.js.map +1 -0
- package/dist/content/legacy/separator.js +7 -0
- package/dist/content/legacy/separator.js.map +1 -0
- package/dist/content/legacy/slice.js +23 -0
- package/dist/content/legacy/slice.js.map +1 -0
- package/dist/content/legacy/slices.js +13 -0
- package/dist/content/legacy/slices.js.map +1 -0
- package/dist/content/legacy/table.js +19 -0
- package/dist/content/legacy/table.js.map +1 -0
- package/dist/content/legacy/uid.js +7 -0
- package/dist/content/legacy/uid.js.map +1 -0
- package/dist/content/link.d.ts +188 -0
- package/dist/content/link.d.ts.map +1 -0
- package/dist/content/link.js +50 -0
- package/dist/content/link.js.map +1 -0
- package/dist/content/nestable.d.ts +755 -0
- package/dist/content/nestable.d.ts.map +1 -0
- package/dist/content/nestable.js +38 -0
- package/dist/content/nestable.js.map +1 -0
- package/dist/content/repeatable.d.ts +192 -0
- package/dist/content/repeatable.d.ts.map +1 -0
- package/dist/content/repeatable.js +13 -0
- package/dist/content/repeatable.js.map +1 -0
- package/dist/content/richText.d.ts +141 -0
- package/dist/content/richText.d.ts.map +1 -0
- package/dist/content/richText.js +23 -0
- package/dist/content/richText.js.map +1 -0
- package/dist/content/separator.d.ts +10 -0
- package/dist/content/separator.d.ts.map +1 -0
- package/dist/content/separator.js +8 -0
- package/dist/content/separator.js.map +1 -0
- package/dist/content/slice.d.ts +4527 -0
- package/dist/content/slice.d.ts.map +1 -0
- package/dist/content/slice.js +27 -0
- package/dist/content/slice.js.map +1 -0
- package/dist/content/slices.d.ts +4536 -0
- package/dist/content/slices.d.ts.map +1 -0
- package/dist/content/slices.js +18 -0
- package/dist/content/slices.js.map +1 -0
- package/dist/content/table.d.ts +153 -0
- package/dist/content/table.d.ts.map +1 -0
- package/dist/content/table.js +13 -0
- package/dist/content/table.js.map +1 -0
- package/dist/content/uid.d.ts +11 -0
- package/dist/content/uid.d.ts.map +1 -0
- package/dist/content/uid.js +11 -0
- package/dist/content/uid.js.map +1 -0
- package/dist/content/widget.d.ts +3026 -0
- package/dist/content/widget.d.ts.map +1 -0
- package/dist/content/widget.js +16 -0
- package/dist/content/widget.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +2 -0
- package/dist/io-ts.d.ts +68728 -0
- package/dist/io-ts.d.ts.map +1 -0
- package/dist/io-ts.js +215 -0
- package/dist/io-ts.js.map +1 -0
- package/dist/model/boolean.d.ts +16 -0
- package/dist/model/boolean.d.ts.map +1 -0
- package/dist/model/boolean.js +16 -0
- package/dist/model/boolean.js.map +1 -0
- package/dist/model/color.d.ts +15 -0
- package/dist/model/color.d.ts.map +1 -0
- package/dist/model/color.js +15 -0
- package/dist/model/color.js.map +1 -0
- package/dist/model/customType.d.ts +3357 -0
- package/dist/model/customType.d.ts.map +1 -0
- package/dist/model/customType.js +18 -0
- package/dist/model/customType.js.map +1 -0
- package/dist/model/date.d.ts +16 -0
- package/dist/model/date.d.ts.map +1 -0
- package/dist/model/date.js +16 -0
- package/dist/model/date.js.map +1 -0
- package/dist/model/embed.d.ts +16 -0
- package/dist/model/embed.d.ts.map +1 -0
- package/dist/model/embed.js +16 -0
- package/dist/model/embed.js.map +1 -0
- package/dist/model/geopoint.d.ts +14 -0
- package/dist/model/geopoint.d.ts.map +1 -0
- package/dist/model/geopoint.js +12 -0
- package/dist/model/geopoint.js.map +1 -0
- package/dist/model/group.d.ts +568 -0
- package/dist/model/group.d.ts.map +1 -0
- package/dist/model/group.js +23 -0
- package/dist/model/group.js.map +1 -0
- package/dist/model/image.d.ts +24 -0
- package/dist/model/image.d.ts.map +1 -0
- package/dist/model/image.js +41 -0
- package/dist/model/image.js.map +1 -0
- package/dist/model/integrationField.d.ts +16 -0
- package/dist/model/integrationField.d.ts.map +1 -0
- package/dist/model/integrationField.js +16 -0
- package/dist/model/integrationField.js.map +1 -0
- package/dist/model/link.d.ts +48 -0
- package/dist/model/link.d.ts.map +1 -0
- package/dist/model/link.js +94 -0
- package/dist/model/link.js.map +1 -0
- package/dist/model/nestable.d.ts +184 -0
- package/dist/model/nestable.d.ts.map +1 -0
- package/dist/model/nestable.js +40 -0
- package/dist/model/nestable.js.map +1 -0
- package/dist/model/number.d.ts +18 -0
- package/dist/model/number.d.ts.map +1 -0
- package/dist/model/number.js +19 -0
- package/dist/model/number.js.map +1 -0
- package/dist/model/range.d.ts +18 -0
- package/dist/model/range.d.ts.map +1 -0
- package/dist/model/range.js +19 -0
- package/dist/model/range.js.map +1 -0
- package/dist/model/richText.d.ts +28 -0
- package/dist/model/richText.d.ts.map +1 -0
- package/dist/model/richText.js +72 -0
- package/dist/model/richText.js.map +1 -0
- package/dist/model/section.d.ts +3337 -0
- package/dist/model/section.d.ts.map +1 -0
- package/dist/model/section.js +10 -0
- package/dist/model/section.js.map +1 -0
- package/dist/model/select.d.ts +17 -0
- package/dist/model/select.d.ts.map +1 -0
- package/dist/model/select.js +22 -0
- package/dist/model/select.js.map +1 -0
- package/dist/model/separator.d.ts +13 -0
- package/dist/model/separator.d.ts.map +1 -0
- package/dist/model/separator.js +11 -0
- package/dist/model/separator.js.map +1 -0
- package/dist/model/slice.d.ts +3681 -0
- package/dist/model/slice.d.ts.map +1 -0
- package/dist/model/slice.js +54 -0
- package/dist/model/slice.js.map +1 -0
- package/dist/model/slices.d.ts +2225 -0
- package/dist/model/slices.d.ts.map +1 -0
- package/dist/model/slices.js +29 -0
- package/dist/model/slices.js.map +1 -0
- package/dist/model/table.d.ts +13 -0
- package/dist/model/table.d.ts.map +1 -0
- package/dist/model/table.js +17 -0
- package/dist/model/table.js.map +1 -0
- package/dist/model/text.d.ts +16 -0
- package/dist/model/text.d.ts.map +1 -0
- package/dist/model/text.js +16 -0
- package/dist/model/text.js.map +1 -0
- package/dist/model/timestamp.d.ts +16 -0
- package/dist/model/timestamp.d.ts.map +1 -0
- package/dist/model/timestamp.js +16 -0
- package/dist/model/timestamp.js.map +1 -0
- package/dist/model/uid.d.ts +16 -0
- package/dist/model/uid.d.ts.map +1 -0
- package/dist/model/uid.js +16 -0
- package/dist/model/uid.js.map +1 -0
- package/dist/model/widget.d.ts +3360 -0
- package/dist/model/widget.d.ts.map +1 -0
- package/dist/model/widget.js +44 -0
- package/dist/model/widget.js.map +1 -0
- package/dist/zod4.d.ts +33521 -0
- package/dist/zod4.d.ts.map +1 -0
- package/dist/zod4.js +127 -0
- package/dist/zod4.js.map +1 -0
- package/package.json +54 -58
- package/src/common/asset.ts +29 -0
- package/src/common/embed.ts +27 -0
- package/src/common/hexaColorCode.ts +11 -0
- package/src/common/nonEmptyString.ts +9 -0
- package/src/common/widgetKey.ts +11 -0
- package/src/content/boolean.ts +23 -0
- package/src/content/codec/boolean.ts +38 -0
- package/src/content/codec/document.ts +60 -0
- package/src/content/codec/embed.ts +55 -0
- package/src/content/codec/empty.ts +49 -0
- package/src/content/codec/field.ts +96 -0
- package/src/content/codec/geopoint.ts +40 -0
- package/src/content/codec/group.ts +163 -0
- package/src/content/codec/image.ts +50 -0
- package/src/content/codec/integrationField.ts +38 -0
- package/src/content/{LegacyContentCtx.ts → codec/legacyContentCtx.ts} +25 -15
- package/src/content/codec/link.ts +103 -0
- package/src/content/codec/nestable.ts +146 -0
- package/src/content/codec/repeatable.ts +68 -0
- package/src/content/codec/richText.ts +113 -0
- package/src/content/codec/separator.ts +33 -0
- package/src/content/codec/slice.ts +274 -0
- package/src/content/codec/slices.ts +130 -0
- package/src/content/codec/table.ts +65 -0
- package/src/content/codec/uid.ts +36 -0
- package/src/content/codec/widget.ts +58 -0
- package/src/content/document.ts +8 -0
- package/src/content/embed.ts +12 -0
- package/src/content/empty.ts +10 -0
- package/src/content/field.ts +87 -0
- package/src/content/geopoint.ts +11 -0
- package/src/content/group.ts +96 -0
- package/src/content/image.ts +103 -0
- package/src/content/integrationField.ts +10 -0
- package/src/content/legacy/boolean.ts +5 -0
- package/src/content/legacy/document.ts +25 -0
- package/src/content/legacy/embed.ts +23 -0
- package/src/content/legacy/empty.ts +10 -0
- package/src/content/legacy/field.ts +8 -0
- package/src/content/legacy/geopoint.ts +10 -0
- package/src/content/legacy/group.ts +15 -0
- package/src/content/legacy/image.ts +43 -0
- package/src/content/legacy/integrationField.ts +5 -0
- package/src/content/legacy/link.ts +171 -0
- package/src/content/legacy/nestable.ts +31 -0
- package/src/content/legacy/repeatable.ts +20 -0
- package/src/content/legacy/richText.ts +165 -0
- package/src/content/legacy/separator.ts +6 -0
- package/src/content/legacy/slice.ts +37 -0
- package/src/content/legacy/slices.ts +17 -0
- package/src/content/legacy/table.ts +39 -0
- package/src/content/legacy/uid.ts +6 -0
- package/src/content/legacy/widget.ts +15 -0
- package/src/content/link.ts +131 -0
- package/src/content/nestable.ts +64 -0
- package/src/content/repeatable.ts +13 -0
- package/src/content/richText.ts +32 -0
- package/src/content/separator.ts +9 -0
- package/src/content/slice.ts +41 -0
- package/src/content/slices.ts +23 -0
- package/src/content/table.ts +14 -0
- package/src/content/uid.ts +10 -0
- package/src/content/utils.ts +37 -105
- package/src/content/widget.ts +17 -0
- package/src/content/{fields/withDefaultValues.ts → withDefaultValues.ts} +34 -39
- package/src/index.ts +78 -0
- package/src/io-ts.ts +313 -0
- package/src/model/boolean.ts +15 -0
- package/src/model/color.ts +14 -0
- package/src/model/customType.ts +26 -0
- package/src/model/date.ts +15 -0
- package/src/model/diff/index.ts +4 -0
- package/src/{customtypes/diff/SharedSlice.ts → model/diff/sharedSlice.ts} +16 -18
- package/src/model/diff/utils.ts +45 -0
- package/src/model/diff/variation.ts +152 -0
- package/src/model/diff/widgets.ts +15 -0
- package/src/model/embed.ts +15 -0
- package/src/model/geopoint.ts +13 -0
- package/src/model/group.ts +36 -0
- package/src/model/image.ts +54 -0
- package/src/model/integrationField.ts +15 -0
- package/src/model/link.ts +147 -0
- package/src/model/nestable.ts +39 -0
- package/src/model/number.ts +26 -0
- package/src/model/range.ts +26 -0
- package/src/model/richText.ts +106 -0
- package/src/model/section.ts +12 -0
- package/src/model/select.ts +30 -0
- package/src/model/separator.ts +12 -0
- package/src/model/slice.ts +94 -0
- package/src/model/slices.ts +54 -0
- package/src/model/table.ts +20 -0
- package/src/model/text.ts +15 -0
- package/src/model/timestamp.ts +15 -0
- package/src/model/uid.ts +15 -0
- package/src/model/widget.ts +52 -0
- package/src/zod4.ts +153 -0
- package/lib/common/Asset.d.ts +0 -16
- package/lib/common/Asset.js +0 -11
- package/lib/common/Embed.d.ts +0 -15
- package/lib/common/Embed.js +0 -10
- package/lib/common/HexaColorCode.d.ts +0 -4
- package/lib/common/HexaColorCode.js +0 -7
- package/lib/common/UUID.d.ts +0 -6
- package/lib/common/UUID.js +0 -8
- package/lib/common/WidgetKey.d.ts +0 -3
- package/lib/common/WidgetKey.js +0 -8
- package/lib/common/index.d.ts +0 -3
- package/lib/common/index.js +0 -6
- package/lib/content/Document.d.ts +0 -11813
- package/lib/content/Document.js +0 -364
- package/lib/content/LegacyContentCtx.d.ts +0 -64
- package/lib/content/LegacyContentCtx.js +0 -130
- package/lib/content/fields/EmptyContent.d.ts +0 -16
- package/lib/content/fields/EmptyContent.js +0 -30
- package/lib/content/fields/GroupContent.d.ts +0 -53
- package/lib/content/fields/GroupContent.js +0 -307
- package/lib/content/fields/UIDContent.d.ts +0 -16
- package/lib/content/fields/UIDContent.js +0 -25
- package/lib/content/fields/WidgetContent.d.ts +0 -11749
- package/lib/content/fields/WidgetContent.js +0 -57
- package/lib/content/fields/index.d.ts +0 -6
- package/lib/content/fields/index.js +0 -9
- package/lib/content/fields/nestable/BooleanContent.d.ts +0 -18
- package/lib/content/fields/nestable/BooleanContent.js +0 -35
- package/lib/content/fields/nestable/EmbedContent.d.ts +0 -78
- package/lib/content/fields/nestable/EmbedContent.js +0 -56
- package/lib/content/fields/nestable/FieldContent/ColorContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/ColorContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/DateContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/DateContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/NumberContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/NumberContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/RangeContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/RangeContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/SelectContent.d.ts +0 -20
- package/lib/content/fields/nestable/FieldContent/SelectContent.js +0 -46
- package/lib/content/fields/nestable/FieldContent/TextContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/TextContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/TimestampContent.d.ts +0 -18
- package/lib/content/fields/nestable/FieldContent/TimestampContent.js +0 -35
- package/lib/content/fields/nestable/FieldContent/common.d.ts +0 -1
- package/lib/content/fields/nestable/FieldContent/common.js +0 -4
- package/lib/content/fields/nestable/FieldContent/index.d.ts +0 -49
- package/lib/content/fields/nestable/FieldContent/index.js +0 -38
- package/lib/content/fields/nestable/GeoPointContent.d.ts +0 -33
- package/lib/content/fields/nestable/GeoPointContent.js +0 -31
- package/lib/content/fields/nestable/ImageContent.d.ts +0 -252
- package/lib/content/fields/nestable/ImageContent.js +0 -122
- package/lib/content/fields/nestable/IntegrationFieldContent.d.ts +0 -16
- package/lib/content/fields/nestable/IntegrationFieldContent.js +0 -28
- package/lib/content/fields/nestable/LinkContent.d.ts +0 -919
- package/lib/content/fields/nestable/LinkContent.js +0 -399
- package/lib/content/fields/nestable/NestableContent.d.ts +0 -1953
- package/lib/content/fields/nestable/NestableContent.js +0 -167
- package/lib/content/fields/nestable/RepeatableContent.d.ts +0 -182
- package/lib/content/fields/nestable/RepeatableContent.js +0 -146
- package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +0 -1261
- package/lib/content/fields/nestable/RichTextContent/Blocks.js +0 -170
- package/lib/content/fields/nestable/RichTextContent/index.d.ts +0 -1004
- package/lib/content/fields/nestable/RichTextContent/index.js +0 -28
- package/lib/content/fields/nestable/SeparatorContent.d.ts +0 -13
- package/lib/content/fields/nestable/SeparatorContent.js +0 -22
- package/lib/content/fields/nestable/TableContent.d.ts +0 -776
- package/lib/content/fields/nestable/TableContent.js +0 -167
- package/lib/content/fields/nestable/index.d.ts +0 -12
- package/lib/content/fields/nestable/index.js +0 -15
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +0 -3934
- package/lib/content/fields/slices/Slice/CompositeSliceContent.js +0 -195
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +0 -774
- package/lib/content/fields/slices/Slice/RepeatableContent.js +0 -21
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +0 -3937
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +0 -215
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +0 -1962
- package/lib/content/fields/slices/Slice/SimpleSliceContent.js +0 -130
- package/lib/content/fields/slices/Slice/SlicePrimaryContent.d.ts +0 -1952
- package/lib/content/fields/slices/Slice/SlicePrimaryContent.js +0 -30
- package/lib/content/fields/slices/Slice/index.d.ts +0 -6810
- package/lib/content/fields/slices/Slice/index.js +0 -45
- package/lib/content/fields/slices/SliceItem.d.ts +0 -6846
- package/lib/content/fields/slices/SliceItem.js +0 -116
- package/lib/content/fields/slices/SlicesContent.d.ts +0 -9827
- package/lib/content/fields/slices/SlicesContent.js +0 -465
- package/lib/content/fields/slices/index.d.ts +0 -3
- package/lib/content/fields/slices/index.js +0 -6
- package/lib/content/fields/withDefaultValues.d.ts +0 -9
- package/lib/content/fields/withDefaultValues.js +0 -79
- package/lib/content/helpers.d.ts +0 -9
- package/lib/content/helpers.js +0 -22
- package/lib/content/index.d.ts +0 -4
- package/lib/content/index.js +0 -7
- package/lib/content/utils.d.ts +0 -50
- package/lib/content/utils.js +0 -35
- package/lib/customtypes/CustomType.d.ts +0 -3680
- package/lib/customtypes/CustomType.js +0 -184
- package/lib/customtypes/Section.d.ts +0 -3635
- package/lib/customtypes/Section.js +0 -66
- package/lib/customtypes/diff/Changes.d.ts +0 -17
- package/lib/customtypes/diff/Changes.js +0 -9
- package/lib/customtypes/diff/SharedSlice.d.ts +0 -1624
- package/lib/customtypes/diff/SharedSlice.js +0 -55
- package/lib/customtypes/diff/Variation.d.ts +0 -1605
- package/lib/customtypes/diff/Variation.js +0 -113
- package/lib/customtypes/diff/Widgets.d.ts +0 -11
- package/lib/customtypes/diff/Widgets.js +0 -2
- package/lib/customtypes/diff/index.d.ts +0 -4
- package/lib/customtypes/diff/index.js +0 -7
- package/lib/customtypes/index.d.ts +0 -4
- package/lib/customtypes/index.js +0 -7
- package/lib/customtypes/widgets/Group.d.ts +0 -1352
- package/lib/customtypes/widgets/Group.js +0 -92
- package/lib/customtypes/widgets/UID.d.ts +0 -19
- package/lib/customtypes/widgets/UID.js +0 -21
- package/lib/customtypes/widgets/Widget.d.ts +0 -4457
- package/lib/customtypes/widgets/Widget.js +0 -49
- package/lib/customtypes/widgets/index.d.ts +0 -6
- package/lib/customtypes/widgets/index.js +0 -9
- package/lib/customtypes/widgets/nestable/BooleanField.d.ts +0 -20
- package/lib/customtypes/widgets/nestable/BooleanField.js +0 -21
- package/lib/customtypes/widgets/nestable/Color.d.ts +0 -17
- package/lib/customtypes/widgets/nestable/Color.js +0 -20
- package/lib/customtypes/widgets/nestable/Date.d.ts +0 -19
- package/lib/customtypes/widgets/nestable/Date.js +0 -21
- package/lib/customtypes/widgets/nestable/Embed.d.ts +0 -19
- package/lib/customtypes/widgets/nestable/Embed.js +0 -21
- package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +0 -15
- package/lib/customtypes/widgets/nestable/GeoPoint.js +0 -19
- package/lib/customtypes/widgets/nestable/Image.d.ts +0 -44
- package/lib/customtypes/widgets/nestable/Image.js +0 -29
- package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +0 -19
- package/lib/customtypes/widgets/nestable/IntegrationField.js +0 -21
- package/lib/customtypes/widgets/nestable/Link.d.ts +0 -196
- package/lib/customtypes/widgets/nestable/Link.js +0 -167
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +0 -217
- package/lib/customtypes/widgets/nestable/NestableWidget.js +0 -39
- package/lib/customtypes/widgets/nestable/Number.d.ts +0 -23
- package/lib/customtypes/widgets/nestable/Number.js +0 -24
- package/lib/customtypes/widgets/nestable/Range.d.ts +0 -23
- package/lib/customtypes/widgets/nestable/Range.js +0 -24
- package/lib/customtypes/widgets/nestable/RichText.d.ts +0 -73
- package/lib/customtypes/widgets/nestable/RichText.js +0 -131
- package/lib/customtypes/widgets/nestable/Select.d.ts +0 -21
- package/lib/customtypes/widgets/nestable/Select.js +0 -22
- package/lib/customtypes/widgets/nestable/Separator.d.ts +0 -14
- package/lib/customtypes/widgets/nestable/Separator.js +0 -18
- package/lib/customtypes/widgets/nestable/Table.d.ts +0 -21
- package/lib/customtypes/widgets/nestable/Table.js +0 -30
- package/lib/customtypes/widgets/nestable/Text.d.ts +0 -19
- package/lib/customtypes/widgets/nestable/Text.js +0 -21
- package/lib/customtypes/widgets/nestable/Timestamp.d.ts +0 -19
- package/lib/customtypes/widgets/nestable/Timestamp.js +0 -21
- package/lib/customtypes/widgets/nestable/index.d.ts +0 -17
- package/lib/customtypes/widgets/nestable/index.js +0 -20
- package/lib/customtypes/widgets/shared/ImageConstraint.d.ts +0 -7
- package/lib/customtypes/widgets/shared/ImageConstraint.js +0 -31
- package/lib/customtypes/widgets/shared/index.d.ts +0 -1
- package/lib/customtypes/widgets/shared/index.js +0 -8
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +0 -455
- package/lib/customtypes/widgets/slices/CompositeSlice.js +0 -63
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +0 -442
- package/lib/customtypes/widgets/slices/LegacySlice.js +0 -12
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +0 -1807
- package/lib/customtypes/widgets/slices/SharedSlice.js +0 -118
- package/lib/customtypes/widgets/slices/SharedSliceRef.d.ts +0 -5
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +0 -9
- package/lib/customtypes/widgets/slices/Slice.d.ts +0 -6
- package/lib/customtypes/widgets/slices/Slice.js +0 -2
- package/lib/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +0 -1259
- package/lib/customtypes/widgets/slices/SlicePrimaryWidget.js +0 -10
- package/lib/customtypes/widgets/slices/Slices.d.ts +0 -5917
- package/lib/customtypes/widgets/slices/Slices.js +0 -146
- package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +0 -6
- package/lib/customtypes/widgets/slices/SlicesTypes.js +0 -11
- package/lib/customtypes/widgets/slices/index.d.ts +0 -8
- package/lib/customtypes/widgets/slices/index.js +0 -11
- package/lib/utils/Arrays.d.ts +0 -1
- package/lib/utils/Arrays.js +0 -13
- package/lib/utils/DocumentId.d.ts +0 -2
- package/lib/utils/DocumentId.js +0 -7
- package/lib/utils/Fields.d.ts +0 -6
- package/lib/utils/Fields.js +0 -2
- package/lib/utils/Objects.d.ts +0 -8
- package/lib/utils/Objects.js +0 -42
- package/lib/utils/index.d.ts +0 -4
- package/lib/utils/index.js +0 -8
- package/lib/validators/BasicTypes.d.ts +0 -10
- package/lib/validators/BasicTypes.js +0 -25
- package/lib/validators/DateFromString.d.ts +0 -3
- package/lib/validators/DateFromString.js +0 -11
- package/lib/validators/DateFromStringOrNumber.d.ts +0 -3
- package/lib/validators/DateFromStringOrNumber.js +0 -10
- package/lib/validators/DateFromTsMs.d.ts +0 -3
- package/lib/validators/DateFromTsMs.js +0 -10
- package/lib/validators/DefaultOrElse.d.ts +0 -5
- package/lib/validators/DefaultOrElse.js +0 -21
- package/lib/validators/IntFromNumber.d.ts +0 -5
- package/lib/validators/IntFromNumber.js +0 -14
- package/lib/validators/IntFromPixels.d.ts +0 -8
- package/lib/validators/IntFromPixels.js +0 -24
- package/lib/validators/NonEmptyString.d.ts +0 -3
- package/lib/validators/NonEmptyString.js +0 -6
- package/lib/validators/NonEmptyStringOrNull.d.ts +0 -3
- package/lib/validators/NonEmptyStringOrNull.js +0 -15
- package/lib/validators/NumberOrNull.d.ts +0 -3
- package/lib/validators/NumberOrNull.js +0 -6
- package/lib/validators/NumberRange.d.ts +0 -32
- package/lib/validators/NumberRange.js +0 -40
- package/lib/validators/StringFromBoolean.d.ts +0 -5
- package/lib/validators/StringFromBoolean.js +0 -10
- package/lib/validators/StringFromNumber.d.ts +0 -5
- package/lib/validators/StringFromNumber.js +0 -10
- package/lib/validators/StringOrNull.d.ts +0 -3
- package/lib/validators/StringOrNull.js +0 -6
- package/lib/validators/TrimmedString.d.ts +0 -5
- package/lib/validators/TrimmedString.js +0 -23
- package/lib/validators/function.d.ts +0 -34
- package/lib/validators/function.js +0 -100
- package/lib/validators/index.d.ts +0 -15
- package/lib/validators/index.js +0 -31
- package/src/common/Asset.ts +0 -25
- package/src/common/Embed.ts +0 -22
- package/src/common/HexaColorCode.ts +0 -11
- package/src/common/UUID.ts +0 -19
- package/src/common/WidgetKey.ts +0 -13
- package/src/common/index.ts +0 -3
- package/src/content/Document.ts +0 -539
- package/src/content/fields/EmptyContent.ts +0 -45
- package/src/content/fields/GroupContent.ts +0 -466
- package/src/content/fields/UIDContent.ts +0 -42
- package/src/content/fields/WidgetContent.ts +0 -76
- package/src/content/fields/index.ts +0 -6
- package/src/content/fields/nestable/BooleanContent.ts +0 -52
- package/src/content/fields/nestable/EmbedContent.ts +0 -74
- package/src/content/fields/nestable/FieldContent/ColorContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/DateContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/NumberContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/RangeContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/SelectContent.ts +0 -60
- package/src/content/fields/nestable/FieldContent/TextContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/TimestampContent.ts +0 -49
- package/src/content/fields/nestable/FieldContent/common.ts +0 -1
- package/src/content/fields/nestable/FieldContent/index.ts +0 -40
- package/src/content/fields/nestable/GeoPointContent.ts +0 -48
- package/src/content/fields/nestable/ImageContent.ts +0 -196
- package/src/content/fields/nestable/IntegrationFieldContent.ts +0 -51
- package/src/content/fields/nestable/LinkContent.ts +0 -651
- package/src/content/fields/nestable/NestableContent.ts +0 -241
- package/src/content/fields/nestable/RepeatableContent.ts +0 -224
- package/src/content/fields/nestable/RichTextContent/Blocks.ts +0 -238
- package/src/content/fields/nestable/RichTextContent/index.ts +0 -42
- package/src/content/fields/nestable/SeparatorContent.ts +0 -34
- package/src/content/fields/nestable/TableContent.ts +0 -234
- package/src/content/fields/nestable/index.ts +0 -12
- package/src/content/fields/slices/Slice/CompositeSliceContent.ts +0 -293
- package/src/content/fields/slices/Slice/RepeatableContent.ts +0 -29
- package/src/content/fields/slices/Slice/SharedSliceContent.ts +0 -305
- package/src/content/fields/slices/Slice/SimpleSliceContent.ts +0 -180
- package/src/content/fields/slices/Slice/SlicePrimaryContent.ts +0 -40
- package/src/content/fields/slices/Slice/index.ts +0 -52
- package/src/content/fields/slices/SliceItem.ts +0 -184
- package/src/content/fields/slices/SlicesContent.ts +0 -677
- package/src/content/fields/slices/index.ts +0 -3
- package/src/content/helpers.ts +0 -25
- package/src/content/index.ts +0 -4
- package/src/customtypes/CustomType.ts +0 -280
- package/src/customtypes/Section.ts +0 -98
- package/src/customtypes/diff/Variation.ts +0 -167
- package/src/customtypes/diff/Widgets.ts +0 -17
- package/src/customtypes/diff/index.ts +0 -4
- package/src/customtypes/index.ts +0 -4
- package/src/customtypes/widgets/Group.ts +0 -120
- package/src/customtypes/widgets/UID.ts +0 -27
- package/src/customtypes/widgets/Widget.ts +0 -83
- package/src/customtypes/widgets/index.ts +0 -6
- package/src/customtypes/widgets/nestable/BooleanField.ts +0 -29
- package/src/customtypes/widgets/nestable/Color.ts +0 -25
- package/src/customtypes/widgets/nestable/Date.ts +0 -27
- package/src/customtypes/widgets/nestable/Embed.ts +0 -27
- package/src/customtypes/widgets/nestable/GeoPoint.ts +0 -25
- package/src/customtypes/widgets/nestable/Image.ts +0 -39
- package/src/customtypes/widgets/nestable/IntegrationField.ts +0 -26
- package/src/customtypes/widgets/nestable/Link.ts +0 -313
- package/src/customtypes/widgets/nestable/NestableWidget.ts +0 -40
- package/src/customtypes/widgets/nestable/Number.ts +0 -30
- package/src/customtypes/widgets/nestable/Range.ts +0 -30
- package/src/customtypes/widgets/nestable/RichText.ts +0 -215
- package/src/customtypes/widgets/nestable/Select.ts +0 -34
- package/src/customtypes/widgets/nestable/Separator.ts +0 -24
- package/src/customtypes/widgets/nestable/Table.ts +0 -38
- package/src/customtypes/widgets/nestable/Text.ts +0 -27
- package/src/customtypes/widgets/nestable/Timestamp.ts +0 -27
- package/src/customtypes/widgets/nestable/index.ts +0 -17
- package/src/customtypes/widgets/shared/ImageConstraint.ts +0 -41
- package/src/customtypes/widgets/shared/index.ts +0 -1
- package/src/customtypes/widgets/slices/CompositeSlice.ts +0 -79
- package/src/customtypes/widgets/slices/LegacySlice.ts +0 -15
- package/src/customtypes/widgets/slices/SharedSlice.ts +0 -152
- package/src/customtypes/widgets/slices/SharedSliceRef.ts +0 -10
- package/src/customtypes/widgets/slices/Slice.ts +0 -7
- package/src/customtypes/widgets/slices/SlicePrimaryWidget.ts +0 -12
- package/src/customtypes/widgets/slices/Slices.ts +0 -184
- package/src/customtypes/widgets/slices/SlicesTypes.ts +0 -11
- package/src/customtypes/widgets/slices/index.ts +0 -8
- package/src/utils/Arrays.ts +0 -12
- package/src/utils/DocumentId.ts +0 -8
- package/src/utils/Fields.ts +0 -4
- package/src/utils/Objects.ts +0 -53
- package/src/utils/index.ts +0 -4
- package/src/validators/BasicTypes.ts +0 -55
- package/src/validators/DateFromString.ts +0 -19
- package/src/validators/DateFromStringOrNumber.ts +0 -17
- package/src/validators/DateFromTsMs.ts +0 -17
- package/src/validators/DefaultOrElse.ts +0 -24
- package/src/validators/IntFromNumber.ts +0 -22
- package/src/validators/IntFromPixels.ts +0 -32
- package/src/validators/NonEmptyString.ts +0 -8
- package/src/validators/NonEmptyStringOrNull.ts +0 -22
- package/src/validators/NumberOrNull.ts +0 -5
- package/src/validators/NumberRange.ts +0 -51
- package/src/validators/StringFromBoolean.ts +0 -19
- package/src/validators/StringFromNumber.ts +0 -19
- package/src/validators/StringOrNull.ts +0 -5
- package/src/validators/TrimmedString.ts +0 -33
- package/src/validators/function.ts +0 -115
- package/src/validators/index.ts +0 -15
- /package/src/{customtypes/diff/Changes.ts → model/diff/changes.ts} +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { StringOrNull } from "../../validators"
|
|
4
|
-
|
|
5
|
-
export const UIDFieldType = "UID"
|
|
6
|
-
|
|
7
|
-
export const UIDConfig = t.exact(
|
|
8
|
-
t.partial({
|
|
9
|
-
label: StringOrNull,
|
|
10
|
-
useAsTitle: t.boolean,
|
|
11
|
-
placeholder: t.string,
|
|
12
|
-
}),
|
|
13
|
-
)
|
|
14
|
-
export type UIDConfig = t.TypeOf<typeof UIDConfig>
|
|
15
|
-
|
|
16
|
-
export const UID = t.exact(
|
|
17
|
-
t.intersection([
|
|
18
|
-
t.type({
|
|
19
|
-
type: t.literal(UIDFieldType),
|
|
20
|
-
}),
|
|
21
|
-
t.partial({
|
|
22
|
-
fieldset: StringOrNull,
|
|
23
|
-
config: UIDConfig,
|
|
24
|
-
}),
|
|
25
|
-
]),
|
|
26
|
-
)
|
|
27
|
-
export type UID = t.TypeOf<typeof UID>
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { Group, GroupFieldType } from "./Group"
|
|
4
|
-
import {
|
|
5
|
-
BooleanFieldType,
|
|
6
|
-
ColorFieldType,
|
|
7
|
-
DateFieldType,
|
|
8
|
-
EmbedFieldType,
|
|
9
|
-
GeoPointFieldType,
|
|
10
|
-
ImageFieldType,
|
|
11
|
-
IntegrationFieldType,
|
|
12
|
-
LinkFieldType,
|
|
13
|
-
NumberFieldType,
|
|
14
|
-
RangeFieldType,
|
|
15
|
-
RichTextFieldType,
|
|
16
|
-
SelectFieldType,
|
|
17
|
-
SeparatorFieldType,
|
|
18
|
-
TableFieldType,
|
|
19
|
-
TextFieldType,
|
|
20
|
-
TimestampFieldType,
|
|
21
|
-
} from "./nestable"
|
|
22
|
-
import { NestableWidget } from "./nestable/NestableWidget"
|
|
23
|
-
import type { SharedSlice } from "./slices/SharedSlice"
|
|
24
|
-
import {
|
|
25
|
-
DynamicSlices,
|
|
26
|
-
LegacySlicesFieldType,
|
|
27
|
-
Slices,
|
|
28
|
-
SlicesFieldType,
|
|
29
|
-
StaticSlices,
|
|
30
|
-
} from "./slices/Slices"
|
|
31
|
-
import { UID, UIDFieldType } from "./UID"
|
|
32
|
-
|
|
33
|
-
export function widgetReader<T extends StaticSlices | DynamicSlices>(
|
|
34
|
-
codec: t.Type<T, unknown>,
|
|
35
|
-
) {
|
|
36
|
-
return t.union([UID, NestableWidget, Group, codec])
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const StaticWidget = widgetReader(StaticSlices)
|
|
40
|
-
export type StaticWidget = t.TypeOf<typeof StaticWidget>
|
|
41
|
-
|
|
42
|
-
export const DynamicWidget = widgetReader(DynamicSlices)
|
|
43
|
-
export type DynamicWidget = t.TypeOf<typeof DynamicWidget>
|
|
44
|
-
|
|
45
|
-
export const FieldType = t.keyof({
|
|
46
|
-
[ColorFieldType]: null,
|
|
47
|
-
[BooleanFieldType]: null,
|
|
48
|
-
[NumberFieldType]: null,
|
|
49
|
-
[EmbedFieldType]: null,
|
|
50
|
-
[GeoPointFieldType]: null,
|
|
51
|
-
[DateFieldType]: null,
|
|
52
|
-
[RangeFieldType]: null,
|
|
53
|
-
[RichTextFieldType]: null,
|
|
54
|
-
[SelectFieldType]: null,
|
|
55
|
-
[SeparatorFieldType]: null,
|
|
56
|
-
[TableFieldType]: null,
|
|
57
|
-
[TextFieldType]: null,
|
|
58
|
-
[TimestampFieldType]: null,
|
|
59
|
-
[LinkFieldType]: null,
|
|
60
|
-
[ImageFieldType]: null,
|
|
61
|
-
[IntegrationFieldType]: null,
|
|
62
|
-
[UIDFieldType]: null,
|
|
63
|
-
[GroupFieldType]: null,
|
|
64
|
-
[SlicesFieldType]: null,
|
|
65
|
-
[LegacySlicesFieldType]: null,
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
export type FieldType = t.TypeOf<typeof FieldType>
|
|
69
|
-
|
|
70
|
-
export const Widgets = {
|
|
71
|
-
toStatic(
|
|
72
|
-
widget: DynamicWidget,
|
|
73
|
-
sharedSlices: Map<string, SharedSlice>,
|
|
74
|
-
): StaticWidget {
|
|
75
|
-
switch (widget.type) {
|
|
76
|
-
case "Choice":
|
|
77
|
-
case "Slices":
|
|
78
|
-
return Slices.toStatic(widget, sharedSlices)
|
|
79
|
-
default:
|
|
80
|
-
return widget
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { StringOrNull } from "../../../validators"
|
|
4
|
-
|
|
5
|
-
export const BooleanFieldType = "Boolean"
|
|
6
|
-
|
|
7
|
-
export const BooleanConfig = t.exact(
|
|
8
|
-
t.partial({
|
|
9
|
-
label: StringOrNull,
|
|
10
|
-
default_value: t.boolean,
|
|
11
|
-
placeholder_true: t.string,
|
|
12
|
-
placeholder_false: t.string,
|
|
13
|
-
}),
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
export type BooleanConfig = t.TypeOf<typeof BooleanConfig>
|
|
17
|
-
|
|
18
|
-
export const BooleanField = t.exact(
|
|
19
|
-
t.intersection([
|
|
20
|
-
t.type({
|
|
21
|
-
type: t.literal(BooleanFieldType),
|
|
22
|
-
}),
|
|
23
|
-
t.partial({
|
|
24
|
-
config: BooleanConfig,
|
|
25
|
-
}),
|
|
26
|
-
]),
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
export type BooleanField = t.TypeOf<typeof BooleanField>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { StringOrNull } from "../../../validators"
|
|
4
|
-
|
|
5
|
-
export const ColorFieldType = "Color"
|
|
6
|
-
export const ColorConfig = t.exact(
|
|
7
|
-
t.partial({
|
|
8
|
-
label: StringOrNull,
|
|
9
|
-
placeholder: t.string,
|
|
10
|
-
}),
|
|
11
|
-
)
|
|
12
|
-
export type ColorConfig = t.TypeOf<typeof ColorConfig>
|
|
13
|
-
|
|
14
|
-
export const Color = t.exact(
|
|
15
|
-
t.intersection([
|
|
16
|
-
t.type({
|
|
17
|
-
type: t.literal(ColorFieldType),
|
|
18
|
-
}),
|
|
19
|
-
t.partial({
|
|
20
|
-
fieldset: StringOrNull,
|
|
21
|
-
config: ColorConfig,
|
|
22
|
-
}),
|
|
23
|
-
]),
|
|
24
|
-
)
|
|
25
|
-
export type Color = t.TypeOf<typeof Color>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { StringOrNull } from "../../../validators"
|
|
4
|
-
|
|
5
|
-
export const DateFieldType = "Date"
|
|
6
|
-
|
|
7
|
-
export const DateConfig = t.exact(
|
|
8
|
-
t.partial({
|
|
9
|
-
label: StringOrNull,
|
|
10
|
-
placeholder: t.string,
|
|
11
|
-
default: t.string,
|
|
12
|
-
}),
|
|
13
|
-
)
|
|
14
|
-
export type DateConfig = t.TypeOf<typeof DateConfig>
|
|
15
|
-
|
|
16
|
-
export const Date = t.exact(
|
|
17
|
-
t.intersection([
|
|
18
|
-
t.type({
|
|
19
|
-
type: t.literal(DateFieldType),
|
|
20
|
-
}),
|
|
21
|
-
t.partial({
|
|
22
|
-
fieldset: StringOrNull,
|
|
23
|
-
config: DateConfig,
|
|
24
|
-
}),
|
|
25
|
-
]),
|
|
26
|
-
)
|
|
27
|
-
export type Date = t.TypeOf<typeof Date>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { StringOrNull } from "../../../validators"
|
|
4
|
-
|
|
5
|
-
export const EmbedFieldType = "Embed"
|
|
6
|
-
|
|
7
|
-
export const EmbedConfig = t.exact(
|
|
8
|
-
t.partial({
|
|
9
|
-
label: StringOrNull,
|
|
10
|
-
placeholder: t.string,
|
|
11
|
-
useAsTitle: t.boolean,
|
|
12
|
-
}),
|
|
13
|
-
)
|
|
14
|
-
export type EmbedConfig = t.TypeOf<typeof EmbedConfig>
|
|
15
|
-
|
|
16
|
-
export const Embed = t.exact(
|
|
17
|
-
t.intersection([
|
|
18
|
-
t.type({
|
|
19
|
-
type: t.literal(EmbedFieldType),
|
|
20
|
-
}),
|
|
21
|
-
t.partial({
|
|
22
|
-
fieldset: StringOrNull,
|
|
23
|
-
config: EmbedConfig,
|
|
24
|
-
}),
|
|
25
|
-
]),
|
|
26
|
-
)
|
|
27
|
-
export type Embed = t.TypeOf<typeof Embed>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { StringOrNull } from "../../../validators"
|
|
4
|
-
|
|
5
|
-
export const GeoPointFieldType = "GeoPoint"
|
|
6
|
-
|
|
7
|
-
export const GeoPointConfig = t.exact(
|
|
8
|
-
t.partial({
|
|
9
|
-
label: StringOrNull,
|
|
10
|
-
}),
|
|
11
|
-
)
|
|
12
|
-
export type GeoPointConfig = t.TypeOf<typeof GeoPointConfig>
|
|
13
|
-
|
|
14
|
-
export const GeoPoint = t.exact(
|
|
15
|
-
t.intersection([
|
|
16
|
-
t.type({
|
|
17
|
-
type: t.literal(GeoPointFieldType),
|
|
18
|
-
}),
|
|
19
|
-
t.partial({
|
|
20
|
-
fieldset: StringOrNull,
|
|
21
|
-
config: GeoPointConfig,
|
|
22
|
-
}),
|
|
23
|
-
]),
|
|
24
|
-
)
|
|
25
|
-
export type GeoPoint = t.TypeOf<typeof GeoPoint>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { StringOrNull } from "../../../validators"
|
|
4
|
-
import ImageConstraint from "../shared/ImageConstraint"
|
|
5
|
-
|
|
6
|
-
export const ImageFieldType = "Image"
|
|
7
|
-
|
|
8
|
-
export const Thumbnail = t.exact(
|
|
9
|
-
t.intersection([
|
|
10
|
-
t.type({
|
|
11
|
-
name: t.string,
|
|
12
|
-
}),
|
|
13
|
-
ImageConstraint,
|
|
14
|
-
]),
|
|
15
|
-
)
|
|
16
|
-
export type Thumbnail = t.TypeOf<typeof Thumbnail>
|
|
17
|
-
|
|
18
|
-
export const ImageConfig = t.exact(
|
|
19
|
-
t.partial({
|
|
20
|
-
label: StringOrNull,
|
|
21
|
-
placeholder: t.string,
|
|
22
|
-
constraint: ImageConstraint,
|
|
23
|
-
thumbnails: t.readonlyArray(Thumbnail),
|
|
24
|
-
}),
|
|
25
|
-
)
|
|
26
|
-
export type ImageConfig = t.TypeOf<typeof ImageConfig>
|
|
27
|
-
|
|
28
|
-
export const Image = t.exact(
|
|
29
|
-
t.intersection([
|
|
30
|
-
t.type({
|
|
31
|
-
type: t.literal(ImageFieldType),
|
|
32
|
-
}),
|
|
33
|
-
t.partial({
|
|
34
|
-
fieldset: StringOrNull,
|
|
35
|
-
config: ImageConfig,
|
|
36
|
-
}),
|
|
37
|
-
]),
|
|
38
|
-
)
|
|
39
|
-
export type Image = t.TypeOf<typeof Image>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { StringOrNull } from "../../../validators"
|
|
4
|
-
|
|
5
|
-
export const IntegrationFieldType = "IntegrationFields"
|
|
6
|
-
export const IntegrationFieldConfig = t.exact(
|
|
7
|
-
t.partial({
|
|
8
|
-
label: StringOrNull,
|
|
9
|
-
placeholder: t.string,
|
|
10
|
-
catalog: t.string,
|
|
11
|
-
}),
|
|
12
|
-
)
|
|
13
|
-
export type IntegrationFieldConfig = t.TypeOf<typeof IntegrationFieldConfig>
|
|
14
|
-
|
|
15
|
-
export const IntegrationField = t.exact(
|
|
16
|
-
t.intersection([
|
|
17
|
-
t.type({
|
|
18
|
-
type: t.literal(IntegrationFieldType),
|
|
19
|
-
}),
|
|
20
|
-
t.partial({
|
|
21
|
-
fieldset: StringOrNull,
|
|
22
|
-
config: IntegrationFieldConfig,
|
|
23
|
-
}),
|
|
24
|
-
]),
|
|
25
|
-
)
|
|
26
|
-
export type IntegrationField = t.TypeOf<typeof IntegrationField>
|
|
@@ -1,313 +0,0 @@
|
|
|
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
|
-
|
|
5
|
-
import { StringOrNull } from "../../../validators"
|
|
6
|
-
|
|
7
|
-
const arrayString = (
|
|
8
|
-
entries:
|
|
9
|
-
| string
|
|
10
|
-
| string[]
|
|
11
|
-
| {
|
|
12
|
-
[x: string]: {
|
|
13
|
-
name: string
|
|
14
|
-
}[]
|
|
15
|
-
}
|
|
16
|
-
| undefined,
|
|
17
|
-
) => {
|
|
18
|
-
if (entries instanceof Array) {
|
|
19
|
-
const isValidEntries = entries.reduce(
|
|
20
|
-
(acc, l) => acc && typeof l === "string",
|
|
21
|
-
true,
|
|
22
|
-
)
|
|
23
|
-
if (isValidEntries) return t.success(entries)
|
|
24
|
-
}
|
|
25
|
-
return
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const plainString = (
|
|
29
|
-
entries:
|
|
30
|
-
| string
|
|
31
|
-
| string[]
|
|
32
|
-
| {
|
|
33
|
-
[x: string]: {
|
|
34
|
-
name: string
|
|
35
|
-
}[]
|
|
36
|
-
}
|
|
37
|
-
| undefined,
|
|
38
|
-
) => {
|
|
39
|
-
if (typeof entries === "string") {
|
|
40
|
-
return t.success([entries])
|
|
41
|
-
}
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const MasksArrayString = new t.Type<ReadonlyArray<string>, object, unknown>(
|
|
46
|
-
"MasksArrayString",
|
|
47
|
-
(u: unknown): u is ReadonlyArray<string> => {
|
|
48
|
-
return u instanceof Array
|
|
49
|
-
},
|
|
50
|
-
(u: unknown, context: t.Context) => {
|
|
51
|
-
return either.chain(
|
|
52
|
-
t.union([t.array(t.string), t.string]).validate(u, context),
|
|
53
|
-
(masks) => {
|
|
54
|
-
return arrayString(masks) || plainString(masks) || t.failure(u, context)
|
|
55
|
-
},
|
|
56
|
-
)
|
|
57
|
-
},
|
|
58
|
-
(res) => res,
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
// Field selection in content relationship fields doesn't support nested groups.
|
|
62
|
-
|
|
63
|
-
const CustomTypeLevel2FieldGroupFields = new t.Type<
|
|
64
|
-
readonly string[],
|
|
65
|
-
readonly string[]
|
|
66
|
-
>(
|
|
67
|
-
"CustomTypeLevel2FieldGroupFields",
|
|
68
|
-
(u: unknown): u is readonly string[] =>
|
|
69
|
-
Array.isArray(u) && u.every((item) => typeof item === "string"),
|
|
70
|
-
(u: unknown, context: t.Context) =>
|
|
71
|
-
either.chain(t.array(t.string).validate(u, context), (fields) => {
|
|
72
|
-
// duplicates not allowed
|
|
73
|
-
const filtered = new Set(fields)
|
|
74
|
-
return filtered.size === fields.length
|
|
75
|
-
? t.success(fields)
|
|
76
|
-
: t.failure(u, context, "Fields have duplicates.")
|
|
77
|
-
}),
|
|
78
|
-
(a) => a,
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
const CustomTypeLevel2Field = t.union([
|
|
82
|
-
t.strict({
|
|
83
|
-
id: t.string,
|
|
84
|
-
fields: CustomTypeLevel2FieldGroupFields,
|
|
85
|
-
}),
|
|
86
|
-
t.string,
|
|
87
|
-
])
|
|
88
|
-
|
|
89
|
-
const CustomTypeLevel2Fields = new t.Type<
|
|
90
|
-
readonly t.TypeOf<typeof CustomTypeLevel2Field>[],
|
|
91
|
-
readonly t.OutputOf<typeof CustomTypeLevel2Field>[]
|
|
92
|
-
>(
|
|
93
|
-
"CustomTypeLevel2Fields",
|
|
94
|
-
(u: unknown): u is readonly t.TypeOf<typeof CustomTypeLevel2Field>[] =>
|
|
95
|
-
Array.isArray(u) && u.every((item) => CustomTypeLevel2Field.is(item)),
|
|
96
|
-
(u: unknown, context: t.Context) =>
|
|
97
|
-
either.chain(
|
|
98
|
-
t.array(CustomTypeLevel2Field).validate(u, context),
|
|
99
|
-
(fields) => {
|
|
100
|
-
// duplicates not allowed
|
|
101
|
-
const filtered = new Set(
|
|
102
|
-
fields.map((field) => (typeof field === "string" ? field : field.id)),
|
|
103
|
-
)
|
|
104
|
-
return filtered.size === fields.length
|
|
105
|
-
? t.success(fields)
|
|
106
|
-
: t.failure(u, context, "Fields have duplicates.")
|
|
107
|
-
},
|
|
108
|
-
),
|
|
109
|
-
(a) => a,
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
const CustomTypeLevel2 = t.union([
|
|
113
|
-
t.string,
|
|
114
|
-
t.strict({
|
|
115
|
-
id: t.string,
|
|
116
|
-
fields: CustomTypeLevel2Fields,
|
|
117
|
-
}),
|
|
118
|
-
])
|
|
119
|
-
|
|
120
|
-
const CustomTypesLevel2 = new t.Type<
|
|
121
|
-
readonly t.TypeOf<typeof CustomTypeLevel2>[],
|
|
122
|
-
readonly t.OutputOf<typeof CustomTypeLevel2>[]
|
|
123
|
-
>(
|
|
124
|
-
"CustomTypesLevel2",
|
|
125
|
-
(u: unknown): u is readonly t.TypeOf<typeof CustomTypeLevel2>[] =>
|
|
126
|
-
Array.isArray(u) && u.every((item) => CustomTypeLevel2.is(item)),
|
|
127
|
-
(u: unknown, context: t.Context) =>
|
|
128
|
-
either.chain(t.array(CustomTypeLevel2).validate(u, context), (cts) => {
|
|
129
|
-
// duplicates not allowed
|
|
130
|
-
const filtered = new Set(
|
|
131
|
-
cts.map((ct) => (typeof ct === "string" ? ct : ct.id)),
|
|
132
|
-
)
|
|
133
|
-
return filtered.size === cts.length
|
|
134
|
-
? t.success(cts)
|
|
135
|
-
: t.failure(u, context, "Custom types have duplicates.")
|
|
136
|
-
}),
|
|
137
|
-
(a) => a,
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
const CustomTypeLevel1FieldCustomTypes = t.strict({
|
|
141
|
-
id: t.string,
|
|
142
|
-
customtypes: CustomTypesLevel2,
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
const CustomTypeLevel1FieldGroupField = t.union([
|
|
146
|
-
CustomTypeLevel1FieldCustomTypes,
|
|
147
|
-
t.string,
|
|
148
|
-
])
|
|
149
|
-
|
|
150
|
-
const CustomTypeLevel1FieldGroupFields = new t.Type<
|
|
151
|
-
readonly t.TypeOf<typeof CustomTypeLevel1FieldGroupField>[],
|
|
152
|
-
readonly t.OutputOf<typeof CustomTypeLevel1FieldGroupField>[]
|
|
153
|
-
>(
|
|
154
|
-
"CustomTypeLevel1FieldGroupFields",
|
|
155
|
-
(
|
|
156
|
-
u: unknown,
|
|
157
|
-
): u is readonly t.TypeOf<typeof CustomTypeLevel1FieldGroupField>[] =>
|
|
158
|
-
Array.isArray(u) &&
|
|
159
|
-
u.every((item) => CustomTypeLevel1FieldGroupField.is(item)),
|
|
160
|
-
(u: unknown, context: t.Context) =>
|
|
161
|
-
either.chain(
|
|
162
|
-
t.array(CustomTypeLevel1FieldGroupField).validate(u, context),
|
|
163
|
-
(fields) => {
|
|
164
|
-
// duplicates not allowed
|
|
165
|
-
const filtered = new Set(
|
|
166
|
-
fields.map((field) => (typeof field === "string" ? field : field.id)),
|
|
167
|
-
)
|
|
168
|
-
return filtered.size === fields.length
|
|
169
|
-
? t.success(fields)
|
|
170
|
-
: t.failure(u, context, "Fields have duplicates.")
|
|
171
|
-
},
|
|
172
|
-
),
|
|
173
|
-
(a) => a,
|
|
174
|
-
)
|
|
175
|
-
|
|
176
|
-
const CustomTypeLevel1Field = t.union([
|
|
177
|
-
t.strict({
|
|
178
|
-
id: t.string,
|
|
179
|
-
fields: CustomTypeLevel1FieldGroupFields,
|
|
180
|
-
}),
|
|
181
|
-
CustomTypeLevel1FieldCustomTypes,
|
|
182
|
-
t.string,
|
|
183
|
-
])
|
|
184
|
-
|
|
185
|
-
const CustomTypeLevel1Fields = new t.Type<
|
|
186
|
-
readonly t.TypeOf<typeof CustomTypeLevel1Field>[],
|
|
187
|
-
readonly t.OutputOf<typeof CustomTypeLevel1Field>[]
|
|
188
|
-
>(
|
|
189
|
-
"CustomTypeLevel1Fields",
|
|
190
|
-
(u: unknown): u is readonly t.TypeOf<typeof CustomTypeLevel1Field>[] =>
|
|
191
|
-
Array.isArray(u) && u.every((item) => CustomTypeLevel1Field.is(item)),
|
|
192
|
-
(u: unknown, context: t.Context) =>
|
|
193
|
-
either.chain(
|
|
194
|
-
t.array(CustomTypeLevel1Field).validate(u, context),
|
|
195
|
-
(fields) => {
|
|
196
|
-
// duplicates not allowed
|
|
197
|
-
const filtered = new Set(
|
|
198
|
-
fields.map((field) => (typeof field === "string" ? field : field.id)),
|
|
199
|
-
)
|
|
200
|
-
return filtered.size === fields.length
|
|
201
|
-
? t.success(fields)
|
|
202
|
-
: t.failure(u, context, "Fields have duplicates.")
|
|
203
|
-
},
|
|
204
|
-
),
|
|
205
|
-
(a) => a,
|
|
206
|
-
)
|
|
207
|
-
|
|
208
|
-
const CustomTypeLevel1 = t.union([
|
|
209
|
-
t.string,
|
|
210
|
-
t.strict({
|
|
211
|
-
id: t.string,
|
|
212
|
-
fields: CustomTypeLevel1Fields,
|
|
213
|
-
}),
|
|
214
|
-
])
|
|
215
|
-
|
|
216
|
-
export const CustomTypes = new t.Type<
|
|
217
|
-
readonly t.TypeOf<typeof CustomTypeLevel1>[],
|
|
218
|
-
readonly t.OutputOf<typeof CustomTypeLevel1>[]
|
|
219
|
-
>(
|
|
220
|
-
"CustomTypes",
|
|
221
|
-
(u: unknown): u is readonly t.TypeOf<typeof CustomTypeLevel1>[] =>
|
|
222
|
-
Array.isArray(u) && u.every((item) => CustomTypeLevel1.is(item)),
|
|
223
|
-
(u: unknown, context: t.Context) =>
|
|
224
|
-
either.chain(t.array(CustomTypeLevel1).validate(u, context), (cts) => {
|
|
225
|
-
// if a ct appears more than once as a string, we allow it (legacy)
|
|
226
|
-
// if a ct appears once as a string and then again via object (or vice versa), we don't allow it
|
|
227
|
-
// if a ct appears more than once as an object, we don't allow it
|
|
228
|
-
const strings = new Set<string>()
|
|
229
|
-
const objects = new Set<string>()
|
|
230
|
-
for (const ct of cts) {
|
|
231
|
-
let failed = false
|
|
232
|
-
if (typeof ct === "string") {
|
|
233
|
-
failed = objects.has(ct)
|
|
234
|
-
strings.add(ct)
|
|
235
|
-
} else {
|
|
236
|
-
const { id } = ct
|
|
237
|
-
failed = strings.has(id) || objects.has(id)
|
|
238
|
-
objects.add(id)
|
|
239
|
-
}
|
|
240
|
-
if (failed)
|
|
241
|
-
return t.failure(u, context, "Custom types have duplicates.")
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
if (objects.size > 1) {
|
|
245
|
-
return t.failure(
|
|
246
|
-
u,
|
|
247
|
-
context,
|
|
248
|
-
"Cannot have multiple custom types with fields selection.",
|
|
249
|
-
)
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
if (strings.size > 0 && objects.size > 0) {
|
|
253
|
-
return t.failure(
|
|
254
|
-
u,
|
|
255
|
-
context,
|
|
256
|
-
"Cannot mix custom types as strings and objects with fields.",
|
|
257
|
-
)
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
return t.success(cts)
|
|
261
|
-
}),
|
|
262
|
-
(a) => a,
|
|
263
|
-
)
|
|
264
|
-
|
|
265
|
-
export const LinkFieldType = "Link"
|
|
266
|
-
|
|
267
|
-
export const LinkConfig = t.exact(
|
|
268
|
-
t.partial({
|
|
269
|
-
label: StringOrNull,
|
|
270
|
-
useAsTitle: t.boolean,
|
|
271
|
-
placeholder: t.string,
|
|
272
|
-
select: withFallback(
|
|
273
|
-
t.union([
|
|
274
|
-
t.literal("media"),
|
|
275
|
-
t.literal("document"),
|
|
276
|
-
t.literal("web"),
|
|
277
|
-
t.null,
|
|
278
|
-
]),
|
|
279
|
-
null,
|
|
280
|
-
),
|
|
281
|
-
customtypes: CustomTypes,
|
|
282
|
-
masks: MasksArrayString, // legacy definition of the custom types allowed
|
|
283
|
-
tags: MasksArrayString,
|
|
284
|
-
allowTargetBlank: t.boolean,
|
|
285
|
-
allowText: t.boolean,
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* `repeat` property is used to allow multiple links to be added.
|
|
289
|
-
* `undefined` means that the field is not repeatable (hence repeat = false).
|
|
290
|
-
*/
|
|
291
|
-
repeat: t.boolean,
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* `variants` allows an option to be picked from a list (e.g. "primary"). To
|
|
295
|
-
* be considered, the list must have at least one item.
|
|
296
|
-
*/
|
|
297
|
-
variants: t.array(t.string),
|
|
298
|
-
}),
|
|
299
|
-
)
|
|
300
|
-
export type LinkConfig = t.TypeOf<typeof LinkConfig>
|
|
301
|
-
|
|
302
|
-
export const Link = t.exact(
|
|
303
|
-
t.intersection([
|
|
304
|
-
t.type({
|
|
305
|
-
type: t.literal(LinkFieldType),
|
|
306
|
-
}),
|
|
307
|
-
t.partial({
|
|
308
|
-
fieldset: StringOrNull,
|
|
309
|
-
config: LinkConfig,
|
|
310
|
-
}),
|
|
311
|
-
]),
|
|
312
|
-
)
|
|
313
|
-
export type Link = t.TypeOf<typeof Link>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { BooleanField } from "./BooleanField"
|
|
4
|
-
import { Color } from "./Color"
|
|
5
|
-
import { Date } from "./Date"
|
|
6
|
-
import { Embed } from "./Embed"
|
|
7
|
-
import { GeoPoint } from "./GeoPoint"
|
|
8
|
-
import { Image } from "./Image"
|
|
9
|
-
import { IntegrationField } from "./IntegrationField"
|
|
10
|
-
import { Link } from "./Link"
|
|
11
|
-
import { Number } from "./Number"
|
|
12
|
-
import { Range } from "./Range"
|
|
13
|
-
import { RichText } from "./RichText"
|
|
14
|
-
import { Select } from "./Select"
|
|
15
|
-
import { Separator } from "./Separator"
|
|
16
|
-
import { Table } from "./Table"
|
|
17
|
-
import { Text } from "./Text"
|
|
18
|
-
import { Timestamp } from "./Timestamp"
|
|
19
|
-
|
|
20
|
-
export const NestableWidget = t.union([
|
|
21
|
-
Color,
|
|
22
|
-
BooleanField,
|
|
23
|
-
Embed,
|
|
24
|
-
GeoPoint,
|
|
25
|
-
Date,
|
|
26
|
-
Number,
|
|
27
|
-
Range,
|
|
28
|
-
RichText,
|
|
29
|
-
Select,
|
|
30
|
-
Separator,
|
|
31
|
-
Table,
|
|
32
|
-
Text,
|
|
33
|
-
Timestamp,
|
|
34
|
-
Link,
|
|
35
|
-
Image,
|
|
36
|
-
IntegrationField,
|
|
37
|
-
])
|
|
38
|
-
|
|
39
|
-
export type NestableWidget = t.TypeOf<typeof NestableWidget>
|
|
40
|
-
export type NestableFieldTypes = NestableWidget["type"]
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
import { NumberFromString } from "io-ts-types/lib/NumberFromString"
|
|
3
|
-
|
|
4
|
-
import { StringOrNull } from "../../../validators"
|
|
5
|
-
|
|
6
|
-
export const NumberFieldType = "Number"
|
|
7
|
-
|
|
8
|
-
export const NumberConfig = t.exact(
|
|
9
|
-
t.partial({
|
|
10
|
-
label: StringOrNull,
|
|
11
|
-
placeholder: t.string,
|
|
12
|
-
min: t.union([t.number, NumberFromString]),
|
|
13
|
-
max: t.union([t.number, NumberFromString]),
|
|
14
|
-
step: t.union([t.number, NumberFromString]),
|
|
15
|
-
}),
|
|
16
|
-
)
|
|
17
|
-
export type NumberConfig = t.TypeOf<typeof NumberConfig>
|
|
18
|
-
|
|
19
|
-
export const Number = t.exact(
|
|
20
|
-
t.intersection([
|
|
21
|
-
t.type({
|
|
22
|
-
type: t.literal(NumberFieldType),
|
|
23
|
-
}),
|
|
24
|
-
t.partial({
|
|
25
|
-
fieldset: StringOrNull,
|
|
26
|
-
config: NumberConfig,
|
|
27
|
-
}),
|
|
28
|
-
]),
|
|
29
|
-
)
|
|
30
|
-
export type Number = t.TypeOf<typeof Number>
|