2369 Commits
Author SHA1 Message Date
Ivan Starkov 0280d40d0a build: Npm release 0.109.0 (#2492)
## 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-16 19:51:53 +03:00
Oleg Isonen a02b81faf6 feat: Add some initial prompts to ai bar (#2494)
## Description

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

## Steps for reproduction

1. click on a prompt
2. run ai

## 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-16 18:50:06 +02:00
Ivan Starkov 24a3fb4ea0 feat: Preverve AI menu state, make it initially open (#2495)
## Description

State of the AI menu now in local storage. Opened by default

## 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-16 19:27:39 +03:00
Oleg Isonen 3a316079ce feat: When user selects a page - close the pages tab (#2493)
User pointed out that keeping pages tab open after selecting a page is
confusing
2023-10-16 19:47:08 +04:00
GiuseppeandGiuseppe Gurgone 4fb0159312 fix: Allow inserting templates only inside container components (#2491)
Like with text insertions, when inserting a generated template we need
to check whether the host element is a container.

Co-authored-by: Giuseppe Gurgone <gsppe@users.noreply.github.com>
2023-10-16 18:55:43 +04:00
Ivan Starkov 91251ad914 build: Npm release 0.108.0 (#2488)
## Description

Npm release 0.108.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
2023-10-16 10:36:58 +03:00
Ivan Starkov 02938a6a02 fix: Outline variants sizing (#2486)
## Description

Issue: outline sizes do not match
<img width="552" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/6b9b2a01-f14d-4d04-9eda-1d26af857a47">

Fixed:
<img width="548" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/98040e1c-dc96-4755-9872-965f5b17bae6">

## 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-16 00:08:21 +03:00
Giuseppe 0cefb0385c fix: Miscellaneous AI fixes (#2483)
Fixes:

- Disable Radix components via feat flag
- classNames should be optional when generating templates
- Prevent unwrapped JSX to fail
- Use shared computeSelectorForInstanceId when inserting templates and deleting instances
- Add extra instruction for GPT to fill required values just in case
2023-10-15 21:39:57 +02:00
Ivan Starkov b9e003435b fix: AI, Enable adding text to empty container nodes (#2485)
## Description

Check `currentInstance.children.length===0` was used as check does
element can have children.

Fixed using meta.


## 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 22:28:27 +03:00
Bogdan Chadkin 419c29734b refactor: move undo/redo into commands (#2481)
Ref https://github.com/webstudio-is/webstudio/issues/2354

Here moved last pieces of shared shortcuts into commands. Fixed
distinction of cmd+z and cmd+shift+z to workaround react-hotkeys-hook
implementation.
2023-10-15 23:27:24 +04:00
Bogdan Chadkin 46548ebfd4 fix: prevent image delete when close image dialog (#2482)
Looks like "disabled" state triggered "delete" button near "Choose
source".
2023-10-15 21:54:36 +04:00
Ivan Starkov bfab8be9d4 feat: Implement collaborative highlight for AI-modified elements (#2484)
## Description

Implement collaborative highlight for AI-modified elements

## 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 20:38:27 +03:00
Ivan Starkov 03118d68d6 fix: AI Command Bar improvements (#2480)
## Description

closes #2473

## 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 15:21:47 +03:00
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
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
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
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
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 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
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