Commit Graph
5224 Commits
Author SHA1 Message Date
Ivan Starkov cfba6556d0 fix: AI Command Bar error processing (#2472)
## Description

Rate Limiting toasts.
Mic enable toast.
Improved Error messages toasts for debugability reasons. 


## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, 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/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-10-15 13:59:27 +03:00
Bogdan Chadkin 45aca18843 feat: select sibling after delete instance (#2476)
Quite requested improvement. Instead of selecting parent on delete
select next or previous sibling to be able to clean items within
collections with minimal amount of actions.

For testing
- delete first item in a list
- delete last item in a list
- delete the only item in a list
2023-10-15 12:49:22 +04:00
Giuseppe bcbef77d85 fix: Disable Radix components in AI (#2478) 2023-10-15 10:19:05 +02:00
Bogdan Chadkin 724ad6c9c3 feat: add attribution to images generated by ai (#2477)
Added title prop with `Credit: author` for attribution.

<img width="978" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5635476/1e984fe1-f57d-4441-ae72-8fa3314133b1">
2023-10-15 12:14:15 +04:00
Ivan Starkov 6dcddf5042 fix: Add prompt click to AI Command Bar (#2471)
## Description

Prompt click on AI Command Bar adds text to the input
Also fixed space on audio transcribing



## Steps for reproduction

Click on any prompt in prompts history, see it's text in input field


## Code Review

- [ ] hi @kof, 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/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-10-13 19:19:25 +03:00
Giuseppe acfc8c4166 fix: Improve operations detection (#2470)
After detecting a command via /rest/ai/detect we invoke the /rest/ai
endpoint with the command. If the command is not a text generation, we
run the operations chain that supports multiple operations in the same
prompt.

Instead of refactoring the entire operations chain to support
configurable operations, for now in this PR I am just prepending the
user prompt with the `command` name in order to help the AI
disambiguate.
2023-10-13 17:40:47 +02:00
Giuseppe 70cccfd0d3 fix: ai instance deletion (#2468)
Fixes instance deletion issues.
2023-10-13 17:10:58 +02:00
Bogdan Chadkin 392b6b1005 fix: prevent deleting Body (#2467)
Moved root detection logic into "deleteInstance" utility and covered
with test.
2023-10-13 17:58:13 +04:00
Ivan Starkov 2df4947ce0 build: Release 0.107.0 (#2469)
## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, 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/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
0.107.0
2023-10-13 13:48:50 +03:00
Ivan Starkov 734165b8ed fix: AI completion streaming algorithm (#2465)
## Description

Fixes few errors:
1. In some cases previous algorithm failed on every text instance
provided except last.
2. Previous algorithm was able to skip nodes.

## Steps for reproduction

1. click button
3. expect xyz

## Code Review

- [ ] hi @kof, 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/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-10-13 12:54:24 +03:00
Ivan Starkov 9034ebd464 fix: AI route maxDuration (#2466)
## Description

1. Route now is not layout or like `_index`  postfix
2. export const config instead of export const maxDuration



## Steps for reproduction

1. click button
3. expect xyz

## Code Review

- [ ] hi @kof, 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/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-10-13 12:53:55 +03:00
Ivan Starkov 388ec98e1b fix: Overflow issue with AI Command Bar prompt outline (#2464)
## Description

Fixes this
<img width="389" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/cedf5166-484d-4d52-92a4-3f28b9f5bad7">


<img width="396" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/84b0e236-1b89-4a3c-beb4-0523e2821ae5">


## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, 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/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-10-13 12:52:00 +03:00
Ivan Starkov 1ea2b0bb41 build: npm release 0.106.0 (#2463)
## Description

 npm release 0.106.0

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, 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/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
0.106.0
2023-10-13 00:46:37 +03:00
Bogdan Chadkin 3ce14f3784 fix: sync commands after builder and canvas initialized (#2455)
Found we have race condition because of handshake
which complicates synchronizatio of commands.

Here removed handshake. Instead iframe now rendered client side after
first effect and canvas sends "connect" event so builder start sending
updates.

In the future this can be simplified even more with computed updates
from current state like yjs does.

## Testing steps

- try to delete instance after selecting on canvas
- try to press enter to edit text after selecting from navigator
2023-10-13 01:41:48 +04:00
Oleg Isonen f8d4eb88bc fix: Trim the text we get from transcriptions (#2457)
## Description

Whisper often returns lots of spaces before or after text, now we are
trimming them


## Code Review

- [ ] hi @istarkov , 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/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-10-13 00:17:42 +03:00
Bogdan Chadkin 331cbea835 fix: fix drag&drop issues (#2462)
- allow dragging control and embed components
- fix placement indicator for style sources and backgrounds
- synchronize drag and drop state between builder and canvas
2023-10-13 01:08:00 +04:00
Giuseppe b2ffc4b0b6 refactor: AI improvements (#2461)
Some smaller AI prompt improvements.
2023-10-12 19:35:47 +02:00
Giuseppe 21cbb09f0e feat: Enable features via url (#2459)
Allows to enable features from the /dashboard endpoint by setting it via `features` url param
2023-10-12 19:35:18 +02:00
Oleg Isonen 581d67221f feat: loading indicator for AI bar (#2460)
## Description

Adds a loading indicator while AI is fetching



## Code Review

- [ ] hi @istarkov , 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/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-10-12 18:48:23 +02:00
Ivan Starkov 5f19f5e49b style: AI Command Bar improvements (#2456)
## Description

ref #2449
ref #2448

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, 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/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-10-12 18:56:43 +03:00
Giuseppe c069ff0d18 fix: Suggest to generate custom styles when requested (#2458)
When asking specific values that don't have a Tailwind class, the AI
should generate custom classes using Tailwind's square brackets
notation.

Tweaking the prompts to ask for this
2023-10-12 15:51:18 +02:00
Bogdan Chadkin 81e58fe1f5 feat: search images in pexels with ai (#2453)
Added basic support for generating images with ai. AI generates jsx with
`<img alt="">` and we use the alt to search images in pexels.
2023-10-12 11:57:06 +04:00
Giuseppe ec15ed4cd9 fix: AI fixes and improvements (#2451) 2023-10-11 14:05:26 +02:00
Oleg Isonen 1dfe005808 chore: Increase AI rate limit (#2447)
## Description

Increasing AI rate limit per user per 5 minute


## 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/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-10-11 09:19:49 +02:00
Ivan Starkov 19f1d5d734 feat: new AI command bar (#2445)
## Description

No Error processing.
No Cancel wroking.

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, 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/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-10-10 20:32:43 +00:00
Oleg Isonen f7cecd1835 style: Better colors for the outline (#2441)
Just better colors for collaborative outline

https://share.descript.com/view/X2nGgJUZaC2

## 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/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-10-10 19:40:40 +02:00
Oleg Isonen 54697fadeb chore: Remove css-vars package (#2446)
## Description

Implemented this RFC
https://github.com/webstudio-is/webstudio-rfcs/pull/4/

## Code Review

- [ ] hi @istarkov , 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/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-10-10 19:27:09 +02:00
Giuseppe dda50628a6 refactor: Split AI commands detection and execution (#2444)
As per title the PR splits command detection and execution in two
endpoints.

We will first make a request to the /rest/ai/detect endpoint which will
return an array with one or multiple detected commands for the prompt.
Once we have that we execute them in parallel.

Rewrote the temporary UI completion handler to do all the above. Error
handling will still have to be polished to account for special cases
like rate limiting etc.
2023-10-10 17:53:12 +02:00
Ivan Starkov f8b238e469 feat: AI Command Bar design changes (#2442)
## Description


https://github.com/webstudio-is/webstudio/issues/2418#issuecomment-1754054971

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, 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/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-10-10 19:11:18 +04:00
Oleg Isonen 8e9620721d feat: Rename webstudio-cli to webstudio as we got the shorter namespace (#2443)
## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, 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/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-10-10 12:25:00 +04:00
Ivan Starkov 3bdc315620 fix: Add right placeholders on audio transcribing, and shift-enter for new line in AI Command Bar (#2440)
## Description

Placeholder during audio:
1. On Recording start  - "Recording voice..."
2. On stop - "Transcribing voice..."

Shift-Enter now used to add newline inside AI Input

Cancel voice recording is now working well even on canvas (pointer up
during long press out of recording button)

Additionally fixes from

https://github.com/webstudio-is/webstudio/issues/2418#issuecomment-1754059088

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, 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/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-10-10 07:20:11 +00:00
Ivan Starkov 9ff675a435 feat: Audio transcribe (#2438)
## Description

Audio transcribe UI, and fast implementation of rest endpoint. No
validation etc.

NEXT PRs:
1. Send data to AI endpoint
2. Move transcription logic to AI package.
3. Implement prompt history

## Steps for reproduction


Start record anything in Command bar, see results

## Code Review

- [ ] hi @kof, 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/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-10-09 20:28:30 +04:00
Bogdan Chadkin a3b200fcda fix: listen hotkeys before first user interaction (#2436)
Here fixed the issue with initially missing hotkeys in builder. Add
queue in immerhin to collect
transactions until subscription. This let us create new transactions in
module scope without worrying
the event will not reach the other realm.
2023-10-09 18:03:26 +04:00
Ivan Starkov 0cf35fb5bd feat: Add AI command bar (#2437)
## Description

Just UI of command bar. It does nothing. 

<img width="1033" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/c615ce02-85d7-4faa-8841-ed250667474b">


## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, 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/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-10-09 17:56:44 +04:00
Giuseppe 309d178ae5 refactor: Rename StreamingTextResponse to RemixStreamingTextResponse (#2434)
As per title rename StreamingTextResponse to RemixStreamingTextResponse,
this is to it is more explicit why we have the class
2023-10-09 15:50:55 +02:00
Giuseppe a054b4cf6d fix: JSX attributes parsing (#2435)
Removes markdown code block delimiters from JSX the parser utility and
adds a new utility to extract code blocks from LLM responses.

There was a bug in the previous implementation where we were parsing the JSX stripped out of code blocks
delimiters but when extracting the props from the source string we were slicing the original string with delimiters.
2023-10-09 14:41:25 +02:00
Giuseppe 4040b8ccc2 refactor: Replace request helper with ai request handler (#2433)
The AI request helper now takes a `Promise<Response>` coming from
calling fetch() outside of the helper eg. `handleAiRequest(fetch(...))`

In this PR I also fixed the casing of GPT* types
2023-10-09 11:41:46 +02:00
Giuseppe 43b2e7e23c feat: Merge copywriter with commands (#2419)
Unifies the operations AI endpoint with the copywriter feature. Introducing a chain to do feature-detection on user prompts.
2023-10-09 10:43:14 +02:00
Bogdan Chadkin 5115875087 refactor: replace inquirer with prompts for migrations (#2432)
Replaced old version of inquirer with prompts package we already use in
cli.

Also fixed running migrations by letting prisma lazily load .env
2023-10-09 12:26:50 +04:00
Ivan Starkov 2f4c0643d0 feat: Add Media Recorder (#2431)
## Description

Media recorder hook and useLongPressToggle hook.


https://6382151c8b47d4399fb9fc69-gumktzhrtx.chromatic.com/?path=/story/library-media-recorder--media-recorder

## Steps for reproduction

See storybook for usage.

## Code Review

- [ ] hi @kof, 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/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-10-09 07:29:12 +00:00
Bogdan Chadkin 49ec374546 chore: bump ui libs (#2430)
- @fontsource-variable/inter
- @fontsource-variable/manrope
- @fontsource/roboto-mono
- @floating-ui/dom
- lexical (https://github.com/facebook/lexical/releases/tag/v0.12.0)

https://react-spectrum.adobe.com/releases/index.html

- @react-aria/interactions
- @react-aria/utils
- @react-aria/focus
2023-10-08 16:08:43 +04:00
Bogdan Chadkin f08fe859bb refactor: bump change-case (#2428)
Ref https://github.com/blakeembrey/change-case/releases

Change case in last major merged many packages into one to simplify
maintaining and usage. A few packages like title-case are still separate
as more rare case.

- replaced no-case with change-case (merged into change-case)
- replaced param-case with change-case (merged into change-case and
renamed to kebab (finally))
- replaced camelcase with change-case (has own camelcase utility)
- bumped title-case
2023-10-08 01:03:59 +04:00
Juan Di Toro cf7711eb7f fix: use proper heading props for dialog and sheet components (#2400)
## Description

Fixes #2206 
Copies what the `sdk-components-react` package does for the Headings so
users can control whats being rendered

## Steps for reproduction

1. Click the + button
2. Add a Radix Sheet or Radix Dialog component
3. Select the root on the layers
4. On the right side panel Toggle the `Open` to true
5. Select the Sheet/Dialog Title
6. On the right side panel go to `Settings`
7. Should be able to see a Tag input with a predefined value of `h1`
2023-10-08 00:51:46 +04:00
Oleg Isonen fff7908e42 feat: Collaborative instance outline (#2429)
https://github.com/webstudio-is/webstudio/assets/52824/06094b9e-ffd1-4888-ae92-c0c8306d7c47



## Description

This is the visual part of the collaborative instance outline we will
use for AI and when other user is editing an instance

Not implemented in this PR:

CollaborativeInstanceOutline needs $collaborativeInstanceSelector and
$collaborativeInstanceOutlineAndInstance to have been set when AI is
applying styles to an instance.

## Steps for reproduction

1. To test it right now just add on <SelectedInstanceOutline
variant="collaboration" />


## Code Review

- [ ] hi @istarkov , 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/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-10-07 22:20:47 +02:00
Ivan Starkov 33d640f7aa feat: AI Command bar (#2426)
## Description


https://638245578b47d4399fba191a-slxedcgyqd.chromatic.com/?path=/story/library-ai-command-bar--demo

<img width="512" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/f43a0590-e632-4dc3-9105-75e425b053d4">

<img width="459" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/c7593dcc-93c3-4ef2-ac33-e93015395fc8">

scroll
<img width="435" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/78af59d1-ec66-485b-aa7b-602ca4b6c407">


## Steps for reproduction

Open design-system storybook, find CommandBar

## Code Review

- [ ] hi @kof, 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/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-10-07 14:40:22 +04:00
Bogdan Chadkin 7e824eb1e4 build: bump checks (#2425)
- esbuild
- jest
- eslint
- eslint-typescript

Also removed "jest" binary from packages and use the one installed in
the root
and deduplicated all deps (got a little messy recently).
2023-10-06 16:33:33 +04:00
Ivan Starkov e930c2b34a feat: Autogrowing Textarea (#2424)
## Description

Supports max-height and scrolling with our ScrollArea control see
storybook


https://638245578b47d4399fba191a-pgsxdcimyt.chromatic.com/?path=/story/library-autogrow-text-area--demo

<img width="333" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/808ed6a8-3232-439e-b1eb-98981f85d21f">

## Steps for reproduction


https://638245578b47d4399fba191a-pgsxdcimyt.chromatic.com/?path=/story/library-autogrow-text-area--demo

## Code Review

- [ ] hi @kof, 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/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-10-06 11:40:43 +00:00
Bogdan Chadkin 10ca57d5ad chore: bump radix (#2423)
- select
(https://github.com/radix-ui/primitives/commit/a3dadb0a825524dd60629d426538dac74930791a)
- avatar
(https://github.com/radix-ui/primitives/commit/baf98624513229d65ff033152f6c0c7b74e2fcba)
- colors
(https://github.com/radix-ui/colors/commit/878dd0a118db8151b854979a2a7001ee6493bcec)
- dialog
- dropdown-menu
- popover
- popper
(https://github.com/radix-ui/primitives/commit/929e9f962ccb148dc6467684d1df8cec746dcae7)
- portal
- scroll-area
- toast
- focus-scope
(https://github.com/radix-ui/primitives/commit/2ce556da2faf526d6349a8d431293a8d0cc9b36c)
- tooltip
- navigation-menu
2023-10-06 13:01:35 +04:00
markxtangandBot 2105f73a88 Figma tokens sync (#2421)
## Description

We were unable to create and sync new tokens in Tokens Studio for Figma.
I encountered this problem 3 weeks ago when trying to add color tokens
for link text. Taylor also confirmed experiencing this issue. Today, I
tried to reproduce the issue, but to my surprise, Tokens Studio for
Figma worked as expected.

If this pull request works, then our Tokens Studio is up to date and in
sync with the Styles in the Figma Library 🎉

## Steps for reproduction

1. Open our Figma library file:
https://www.figma.com/file/sfCE7iLS0k25qCxiifQNLE/%F0%9F%93%9A-Webstudio-Library?type=design&node-id=0%3A1&mode=design&t=bJaj3aaWfiGBa8Dg-1
2. Open the Tokens Studio for Figma Plugin, and make sure the correct
Sync Provider is active—see screenshot below. (if not installed, then
you have to get the plugin, and get it synced with our Github—I remember
we have a document somewhere for this, but I can't find it)
3. Test if you can do these things:
- Create a new style in Figma, then import it into the Tokens Plugin
`Styles & Variables > Import Styles`. The new style should show up as a
new design token in the plugin.
  - Edit this new design token and `Apply to Document`
  - `Push to Github`
  
If these work, then it's clear that the Tokens Plugin is working and the
issue we experience before is no longer a problem


![image](https://github.com/webstudio-is/webstudio/assets/122043657/7283b872-0af3-46d7-8d05-067e0832ab92)


## Code Review

- [ ] hi @kof, 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/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

---------

Co-authored-by: Bot (build-figma-tokens.yml) <bot@localhost>
2023-10-06 09:54:50 +02:00
Giuseppe b3dd7f18c4 feat: AI Operations (#2391)
Implements an operation-based system to accomplish a number of edit
tasks on a JSX+CSS representation of a selected Webstudio tree.

Every JSX element has the instance id as data-ws-id and therefore the
LLM knows what to edit.

The idea is to create a number of operations (aiOperations)
specs/schemas with Zod describing unique edit tasks, make a
discriminated union, convert them to JSON Schema. We then inject this
information and the current JSX+CSS in the LLM prompt asking the model
to generate an array of operations.

The LLM responds with an array of operations (aiOperations) to fulfill
the user request. We then process these doing the necessary
transformations to convert these to a Webstudio-friendly format
(wsOperations) and send them to the client where we apply them (see
applyOperations).

Some of these operations are going to be "intermediate" operations for
now.

Generating quality user interfaces might be challenging with LLMs.

Having to do so within a generic operations framework like the one
described above makes it even more challenging.

For this reason when it comes to generating user interfaces, the
Operation chain instead offers an operation called
generateTemplatePrompt that provides information about insertion point
in the existing UI and a prompt, possibly enhanced.

Another chain can use these information and a more sophisticated prompt
and model to then generate the user interface and return a
generateInsertTemplate wsOperation. Webstudio does exactly this in a
rest endpoint, using the template-generator chain with gpt4 instead of
gpt-3.5-turbo.
2023-10-06 09:07:59 +02:00