Files
webstudio/packages/sdk-components-react
Oleg Isonen a8572e7917 Experimental universal input (#1732)
## Description

New Text control for props is using a new UniversalInput component which
allows us to dynamically decide if we need a single-line input or a
multi-line textarea.

Problem it is solving is that we don't know from data type string if
user needs a textarea or an input, so we render a universal input.

We can still set rows to a number in the meta, so that a certain field
is always multiline initially, by default:
- empty field will be single-line input
- multi-line text will automatically turn into multi-line input

Single-line mode:
- enter saves
- shift + enter - adds newline and saves

Multiline-mode:
- enter saves and ads newline
- cmd+enter - saves, no newline


## Steps for reproduction

1. add any component
2. open properties panel and playwith any text input

## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-06-12 20:00:44 +02:00
..
2023-06-12 20:00:44 +02:00
2023-06-09 11:03:23 +03:00

Webstudio SDK Components

Webstudio SDK is a TypeScript API that lets you use your Webstudio site or some components in your custom codebase or just render a complete Remix Document.