How to use @sanity/form-builder - 4 common examples

To help you get started, we’ve selected a few @sanity/form-builder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanity-io / sanity / packages / @sanity / code-input / src / CodeInput.js View on Github external
handleCodeChange = code => {
    const {type, onChange} = this.props
    const path = ['code']

    const fixedLanguage = get(type, 'options.language')

    onChange(PatchEvent.from([
      setIfMissing({_type: type.name, language: fixedLanguage}),
      code ? set(code, path) : unset(path)
    ]))
  }
github sanity-io / sanity / packages / @sanity / code-input / src / CodeInput.js View on Github external
handleLanguageChange = item => {
    const {type, onChange} = this.props
    const path = ['language']
    onChange(PatchEvent.from([
      setIfMissing({_type: type.name}),
      item ? set(item.value, path) : unset(path)
    ]))
  }
github sanity-io / sanity / packages / @sanity / code-input / src / CodeInput.js View on Github external
handleToggleSelectLine = line => {
    const {type, onChange} = this.props
    const path = ['highlightedLines']

    const highlightedLines = xor(this.props.value.highlightedLines, [line]).sort(compareNumbers)

    onChange(PatchEvent.from([
      setIfMissing({_type: type.name, highlightedLines: []}),
      line ? set(highlightedLines, path) : unset(path)
    ]))

  }
github sanity-io / sanity / packages / @sanity / code-input / src / CodeInput.js View on Github external
handleCodeChange = code => {
    const {type, onChange} = this.props
    const path = ['code']

    const fixedLanguage = get(type, 'options.language')

    onChange(PatchEvent.from([
      setIfMissing({_type: type.name, language: fixedLanguage}),
      code ? set(code, path) : unset(path)
    ]))
  }

@sanity/form-builder

Sanity form builder

MIT
Latest version published 1 year ago

Package Health Score

79 / 100
Full package analysis