Skip to content

New properties for Zod .editor() to improve content-editor UI #400

@TotomInc

Description

@TotomInc

Is your feature request related to a problem? Please describe

Zod schemas can be technical and confusing for content-editors.

Given this schema:

const linkSchema = z.object({
  label: z.string(),
  link: z.string(),
});

const topbarSchema = z.object({
  lowPowerMode: z.object({ label: z.string() }),
  darkMode: z.object({ label: z.string() }),
  accessibility: z.object({ label: z.string() }),
});

export const headerSchema = z.object({
  navigationItems: z.array(linkSchema),
  contact: linkSchema,
  search: z.object({ label: z.string() }),
  topbar: topbarSchema,
});

Some parts in the content-editor UI will be displayed as LowPowerMode or doesn't make sense for content-editors.

Image

Describe the solution you'd like

Add new properties to z.editor() which improves the UI for content-editors:

Describe alternatives you've considered

No alternatives possible.

Additional context

I will work on a PR soon for this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions