-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[form-builder] Simplify input resolving (#234)
- Loading branch information
Showing
16 changed files
with
185 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
packages/@sanity/form-builder/src/defaultInputComponents.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import ObjectInput from './inputs/Object/Object' | ||
import ArrayInput from './inputs/Array/Array' | ||
import BooleanInput from './inputs/Boolean' | ||
import NumberInput from './inputs/Number' | ||
import TextInput from './inputs/Text' | ||
|
||
export const fallbackInputs = { | ||
object: ObjectInput, | ||
array: ArrayInput, | ||
boolean: BooleanInput, | ||
number: NumberInput, | ||
string: TextInput | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/@sanity/form-builder/src/sanity/inputResolver/customInputs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// These are inputs that may be implemented by provided parts | ||
import BooleanInput from 'part:@sanity/form-builder/input/boolean?' | ||
import EmailInput from 'part:@sanity/form-builder/input/email?' | ||
import GeoPointInput from 'part:@sanity/form-builder/input/geopoint?' | ||
import NumberInput from 'part:@sanity/form-builder/input/number?' | ||
import ObjectInput from 'part:@sanity/form-builder/input/object?' | ||
import ReferenceInput from 'part:@sanity/form-builder/input/reference?' | ||
import RichDateInput from 'part:@sanity/form-builder/input/rich-date?' | ||
import StringInput from 'part:@sanity/form-builder/input/string?' | ||
import TextInput from 'part:@sanity/form-builder/input/text?' | ||
import UrlInput from 'part:@sanity/form-builder/input/url?' | ||
import CodeInput from 'part:@sanity/form-builder/input/code?' | ||
|
||
const DeprecatedDateInput = RichDateInput | ||
|
||
export default { | ||
object: ObjectInput, | ||
boolean: BooleanInput, | ||
number: NumberInput, | ||
string: StringInput, | ||
text: TextInput, | ||
reference: ReferenceInput, | ||
date: DeprecatedDateInput, | ||
richDate: RichDateInput, | ||
email: EmailInput, | ||
geopoint: GeoPointInput, | ||
code: CodeInput, | ||
url: UrlInput | ||
} |
27 changes: 27 additions & 0 deletions
27
packages/@sanity/form-builder/src/sanity/inputResolver/defaultInputs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
import BooleanInput from '../../inputs/Boolean' | ||
import EmailInput from '../../inputs/Email' | ||
import NumberInput from '../../inputs/Number' | ||
import ObjectInput from '../../inputs/Object' | ||
import StringInput from '../../inputs/String' | ||
import TextInput from '../../inputs/Text' | ||
import UrlInput from '../../inputs/Url' | ||
|
||
import SanityArrayInput from '../inputs/SanityArray' | ||
import Image from '../inputs/Image' | ||
import File from '../inputs/File' | ||
import Slug from '../inputs/Slug' | ||
|
||
export default { | ||
object: ObjectInput, | ||
array: SanityArrayInput, | ||
boolean: BooleanInput, | ||
number: NumberInput, | ||
text: TextInput, | ||
email: EmailInput, | ||
url: UrlInput, | ||
image: Image, | ||
file: File, | ||
string: StringInput, | ||
slug: Slug | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.