How to use the @sanity/util/paths.js.FOCUS_TERMINATOR function in @sanity/util

To help you get started, we’ve selected a few @sanity/util 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 / form-builder / src / FormBuilderInput.tsx View on Github external
No input resolved for type {type.name ? JSON.stringify(type.name) : ''}
        
      )
    }
    const rootProps = isRoot ? {isRoot} : {}
    let childMarkers = markers
    if (!isRoot) {
      childMarkers = markers
        .filter(marker => PathUtils.startsWith(path, marker.path))
        .map(marker => ({
          ...marker,
          path: trimChildPath(path, marker.path)
        }))
    }
    const childFocusPath = this.getChildFocusPath()
    const isLeaf = childFocusPath.length === 0 || childFocusPath[0] === PathUtils.FOCUS_TERMINATOR
    const leafProps = isLeaf ? {} : {focusPath: childFocusPath}
    return (
      <div data-focus-path="{PathUtils.toString(path)}">
        </div>