191 Commits
Author SHA1 Message Date
Bogdan Chadkin 7a6f5280fa build: npm release 0.129 (#2838) 2024-01-29 01:01:44 +07:00
Ivan Starkov 252cff1326 build: Npm release 0.128.0 (#2822)
## 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
2024-01-25 19:11:42 +03:00
Bogdan Chadkin e01000e7ad fix: recover from canvas errors (#2809)
Here added error boundary to catch user errors and be able to recover
from them when broken data is updated.

No longer requires reload.
2024-01-23 23:09:01 +07:00
Ivan Starkov 70711f37a1 build: Release 0.127.0 (#2807)
## Description

Release 0.127.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
2024-01-22 21:56:28 +03:00
Ivan Starkov 24d161e000 build: Release 0.126.0 (#2795)
## Description

Npm 0.126.0 Release

## 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
2024-01-22 09:10:34 +03:00
Ivan Starkov 2209b21608 build: Release 0.125.0 (#2761)
## Description

release 0.125.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
2024-01-14 18:56:19 +03:00
Ivan Starkov ad6a8da1c9 build: Release 0.124.0 (#2741)
## Description

Npm release

## 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
2024-01-08 11:20:09 +02:00
Bogdan Chadkin a22f9fe900 feat: add html editor (#2717)
Ref https://github.com/webstudio-is/webstudio/issues/2359
https://github.com/webstudio-is/webstudio/issues/2388

Here added codemirror based html editor for html embed component. It
supports basic autocomplete and highlights embedded css and js.

Splitted basic codemirror setup into CodeEditor component everything
else can be customized around it.

<img width="245" alt="Screenshot 2023-12-27 at 15 30 57"
src="https://github.com/webstudio-is/webstudio/assets/5635476/7bb7907a-0f5b-406b-8615-2029e6494839">
<img width="240" alt="Screenshot 2023-12-27 at 15 30 22"
src="https://github.com/webstudio-is/webstudio/assets/5635476/bc826e52-0597-4998-a534-e7053f25fb26">
2023-12-31 13:48:19 +07:00
Bogdan Chadkin 0688dfdab7 feat: switch to expression edtior for expressions (#2707)
Ref https://github.com/webstudio-is/webstudio/issues/2532

- switched to expression editor for expression field in variables panel
- removed legacy code editor
- preview actual (not initial) values in variable list
- show actual values in variable list for parameters
- render autocomplete tooltip in body to prevent variables popover
scroll overflow
- wrap lines expression editor to avoid horizontal scroll
- fix html embed failing when non string value is specified

<img width="503" alt="Screenshot 2023-12-20 at 11 17 22"
src="https://github.com/webstudio-is/webstudio/assets/5635476/09a4ae36-2b02-416f-b290-3a82cda79851">
<img width="493" alt="Screenshot 2023-12-20 at 11 15 14"
src="https://github.com/webstudio-is/webstudio/assets/5635476/409c08e5-200f-45aa-908c-be5d0a2ba520">
2023-12-21 12:14:00 +07:00
Bogdan Chadkin 60dcb68776 feat: reimplement expression editor with codemirror (#2705)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here introduce the new expression editor as a replacement to code
editor. It is implemented with codemirror and will improve DX of our
bindings and cms usage.

- autocomplete now completes nested objects in variables
- javascript syntax is highlighted in expressions
- json values are formatted as multiline text
- autocomplete shows fields value/type

Additionally improved a couple of things

- json objects are wrapped with parentheses `({ param: "value" })` to be
treated as object instead of block in highlighter
- objects and arrays are rendered as "object" and "array" in variables
list for cleaner UI

Integrated in builder only for variable value and json prop value. Will
require additional logic to integrate as expression editor.

<img width="559" alt="Screenshot 2023-12-19 at 12 13 28"
src="https://github.com/webstudio-is/webstudio/assets/5635476/c3a3907a-9c08-4343-a1a7-ed12dbdb2404">
<img width="239" alt="Screenshot 2023-12-19 at 12 12 24"
src="https://github.com/webstudio-is/webstudio/assets/5635476/777a2ac5-db79-46c7-8438-538f03edcbf7">
2023-12-19 15:10:40 +07:00
Ivan Starkov 297b8f1961 build: Release 0.123.0 (#2695)
## Description

NPM Release 0.123.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-12-14 17:50:07 +02:00
Ivan Starkov 039b5ce3cf build: Release 0.122.0 (#2683)
## 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-12-14 17:29:02 +02:00
Bogdan Chadkin 92ddfbd64c feat: support page url pattern in builder (#2674)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here extended page "path" field to accept [url
pattern](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API)
compatible syntax to parametarize url with id, date, slug or anything
else. Such data can be passed to backend/cms requests and use the same
webstudio page for dynamic content.

Preview fields automatically added when template fields appear in path.

- fixed json local value
- create "Page params" parameter data source when template is used in
path
- added preview fields to compile path template and preview in ui

<img width="1292" alt="Screenshot 2023-12-08 at 11 35 30"
src="https://github.com/webstudio-is/webstudio/assets/5635476/5dac81f6-5334-4d01-bf28-a74dd709834b">
2023-12-11 20:19:18 +07:00
Ivan Starkov 7142efc4ba feat: Pass cookies and requestUrl to n8n (#2662)
## Description

Ref #2661

This allows us to extract posthog (and probably other trackers) cookies
distinct_id for the user on the server side
And then using aliasing to use in n8n schemas
https://posthog.com/docs/product-analytics/identify#alias-assigning-multiple-distinct-ids-to-the-same-user

See corresponding n8n schemas in saas repo



## 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-11-29 12:33:50 +02:00
Ivan Starkov 04b7c2ff23 build: Update NPM 0.121.0 (#2652)
## 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-11-23 10:34:03 +02:00
Ivan Starkov b8662bdc2d build: release 0.120.0 (#2634)
## 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-11-19 23:33:22 +02:00
Ivan Starkov 50fa7b5f24 build: npm release 0.119.0 (#2621)
## 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-11-17 14:38:34 +02:00
Ivan Starkov aaef19dce7 build: Release-0.118.0 (#2606)
## 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-11-13 10:42:19 +02:00
Ivan Starkov 45706d77f0 build: NPM Release 0.117.0 (#2598)
## 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-11-11 00:14:40 +02:00
Ivan Starkov 033c7044fa build: NPM release 0.116.0 (#2596)
## 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-11-10 16:03:55 +02:00
Ivan Starkov 40f6a47922 build: NPM release 0.115.0 (#2594)
## 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-11-10 14:50:41 +02:00
Ivan Starkov a715124364 build: Npm release 0.114.0 (#2571)
## 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-11-05 23:52:48 +02:00
Ivan Starkov 6423cf0296 build: Npm release 0.113.0 (#2568)
## 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-11-05 19:37:37 +02:00
Ivan Starkov 2aa4d3cc8f build: Bump package versions to 0.112.0 (#2556)
## 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-11-03 09:25:45 +02:00
Bogdan Chadkin d7460d8354 feat: add basic code editor (#2547)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added code editor with variables completion support for bindings
UI. Simple textarea would not work because same names can be used for
different variables
to support seamless dnd for user. `$` is used to trigger completion, in
the future can be replaced with tab or something like this. Current
implementation is mostly a copy paste from lexical playground.

<img width="536" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5635476/c33ebb71-85d8-41b3-8151-72eccae76129">

To test try CodeEditor component in storybook

## Use case

1. Our variables can have the same names for easier copy-pastability
To address specific variable they should be chosen from available list.

2. renaming variable should rename it everywhere to not break bindings.
So variables behave as symbol in text editor and removed completely on
backspace.
2023-11-02 01:02:17 +04:00
Ivan Starkov c1e330d7b9 build: Npm release 0.111.0 (#2501)
## 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-17 20:47:48 +03:00
Ivan Starkov 76b44497e0 build: Npm release 0.110.0 (#2498)
## 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-17 00:10:18 +03:00
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
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 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 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
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
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
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
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
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
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
Ivan Starkov 07af1654e1 build: Release 0.105.0 to npm (#2416)
## Description

Merge after #2415

## 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-04 18:35:19 +00:00
Bogdan Chadkin a379a98c1f refactor: split stores with server synchronization (#2410)
New version of immerhin moved global queue into store instance so we can
stop filtering and just call store.popAll().

Also replaced default store with webstudio own serverSyncStore instance.
Now auto import works much better.
2023-10-03 20:13:57 +04:00
Ivan Starkov 357f35d7a5 feat: Implement Rate Limiting (#2393)
## Description

This PR integrates a rate-limiting mechanism into the app using Vercel's
edge-layer middleware in combination with the Hono framework. This
middleware is written in JS with full JSDoc TypeScript typings.

### Architecture & Strategy
Vercel Middleware: Serves as the front-line defense, running at the edge
for optimal performance.
Hono Framework: For granular control, we utilize Hono middlewares for
applying or skipping rate limits.
Additionally, non-expensive routes benefit from an ephemeral cache to
further optimize performance

### Current Limitations
Due to a dependency on CommonJS, we cannot use TypeScript fully.
Consequently, session configurations are not yet shared across multiple
files. All utility functions are present in a single file for the time
being.


### Logic Breakdown
- Assets: Rate limiting skipped.
- Service Calls: Rate limiting skipped.
- /rest/ai/* Endpoint: Rate limit of 20 requests per 5 minutes,
identified by userId or IP.
- Unauthorized Users: Rate limit of 5 requests per 5 seconds, based
solely on IP.
- Authorized Users: Rate limit of 20 requests per 5 seconds, based on
userId.

### Next Steps
Plan to migrate to ESM for enabling TypeScript support for better
maintainability.
Use multiple regional KV

### Debug endpoint.
[Rate limit debug
endpoint](https://webstudio-builder-kscynssns-webstudio-is.vercel.app/rate-limit-debug)


## 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-03 12:16:18 +00:00
Bogdan Chadkin fc7be4433a build: release 0.104 (#2409) 2023-10-03 15:24:28 +04:00
Giuseppe ccf0280a20 feat: AI Copywriter (#2314)
## Description

Implement AI copywriter functionality behind feature flag. The final UI is not included in this branch.

The feature consists of:

- a `copywriter` chain to generate the copy with AI
- a /rest/ai/copy endpoint to handle generation requests. The response
is streamed as plain text
- the temporary test UI which is a tab in the right sidebar. 
 
For every selected instance it allows to generate copy for it and its
subtree. A `collectTextInstances` utility creates an array of text nodes
objects with the following shape:

```ts
{
  instanceId: string;
  index: number;
  type: "Heading" | "Paragraph" | "Text";
  text: string; // current text or empty
}
```

The AI responds with an array of these where the text property contains
the generated text. The frontend parses incrementally and updates a
Webstudio instance by `instanceId`.

The `index` is used to replace the proper text node in the
`instance.children` array. When all the children are text nodes these
are merged into a single text node, otherwise the AI would generate
`children.length` copy. We identify this case by setting the `index` to
`-1`.
2023-10-03 10:34:26 +02:00
Ivan Starkov c551d2ad4d build: Release v0.103.0 to npm (#2406)
## 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-02 19:07:59 +00:00
Jaya Krishna Namburu 3c8c40a24d build: Release v0.102.0 to npm (#2382)
## Description

Releasing `0.102.0` to npm.

## Code Review

- [ ] hi @kof, I need you to do
  - detailed review (read every line)
2023-09-26 19:45:51 +02:00
Jaya Krishna Namburu f22e0105aa chore: Add netlify deploy command list in cli and in export tab (#2380)
## Description

Adds the `netlify` deployment commands sequence. Tested one by one,
seems to be the best flow i can come by. Would like to validate on
someone else too.


## Code Review

- [x] 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

- [x] made a self-review
2023-09-26 19:12:12 +02:00
Ivan Starkov a64ce7295b build: Release v0.101.0 to npm (#2373)
## 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-09-26 12:00:17 +03:00
Giuseppe 61c7960d3c feat: AI Package (#2307)
This PR introduces the baseline `@webstudio-is/ai` package which
includes:

1. A LLM Abstraction (types) for messages format to make requests to a
model
2. An implementation of the above that uses the OpenAI chat completion
endpoint
3. A common interface for chains. Chains are regular async functions
that can execute an arbitrary number of steps, including calling a LLM
via a model client.

The idea is that a builder API route can use any of these chains to
perform a task that requires AI. For example generate text copy, images,
a theme etc.
2023-09-25 10:59:44 +02:00
Ivan Starkov fffc332076 [Misc] Npm Libraries Update 0.100.0 (#2338)
## Description

Npm Libraries Update 0.100.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-09-19 15:14:10 +03:00
Ivan Starkov b538b74ef2 Enable CLI Usage in CI Environment (#2321)
## Description

- Allow overriding default templates with custom external or internal
ones.
- Ensure exact dependencies, e.g., workspace:* instead of workspace:^,
to address beta release issues.
- Enable passing buildId, authToken, and origin via flags during sync.
- Rename "host" to "origin" in the CLI.

Most code is custom template.

- [x] - Tested at SaaS

## 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-09-18 14:54:14 +03:00