Commit Graph
5224 Commits
Author SHA1 Message Date
Bogdan Chadkin 438af049bd Create assets with patches (#1633)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1335

Successor of https://github.com/webstudio-is/webstudio-builder/pull/1376

Assets no longer created while uploading. Asset patch now tracks new
assets to save in db.
2023-05-15 22:22:16 +07:00
Bogdan Chadkin 282d173920 Remove artifact from not existing migration 2023-05-15 16:43:39 +07:00
Ivan Starkov cad34a3040 Fix types (#1629)
## Description

Makes AllComponent type better


Found null bug.

Enforced for all components 
```
    [componentAttribute]: instance.component,
    [idAttribute]: instance.id,
```
to be non-optional. 

cc @TrySound should fix your issue with Html component


## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-15 12:21:12 +04:00
Bogdan Chadkin 93f636919a Save project uploader when create file (#1618)
We need to be able to track users who uploads files to prevent misuse of
our storage.
Here added File.uploaderProjectId in db. This way we can always find
project owner.
Saving user is less ideal because often can be no user for example when
share edit permission by token.
2023-05-15 14:34:58 +07:00
Oleg IsonenandJayaKrishnaNamburu b4b86a6c89 Outline style property (#1630)
## Description

https://github.com/webstudio-is/webstudio-builder/pull/1596

---------

Co-authored-by: JayaKrishnaNamburu <namburu1995@gmail.com>
2023-05-14 18:40:12 +02:00
Bogdan Chadkin 3fcf37e02b Add image proxy route (#1453)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1179

Here added image proxy - simple remix route to interop image requests
locally and in preview. We have now only single image loader which
accepts image base url.

Here support only local deployment. Preview and saas preview to
RESIZE_ORiGIN env.
2023-05-14 23:25:34 +07:00
Oleg Isonenandnettohadi ef49e85362 Set loading state when opening project from dashboard (#1627)
Closes https://github.com/webstudio-is/webstudio-builder/issues/1334

## Description

When project item is clicked, we are fetching the project data via
router, if its slow - we show loading indication

## Steps for reproduction

1. open dashboard
2. set network throttling in dev tools to super slow
3. open a project

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory

---------

Co-authored-by: nettohadi <32300655+nettohadi@users.noreply.github.com>
2023-05-14 14:23:51 +02:00
Ivan Starkov 41d569bf10 Speedup coldstart using prisma jsonProtocol (#1625)
## Description

[Feature](https://github.com/prisma/prisma/issues/18095)
Not a lot
like 0.5s, better than nothing 

Cold starts before:
```log
#BEFORE
5.648834, 5.706094, 5.345910, 6.229974, 5.379417, 5.575179, 5.745076, 5.918667, 5.751743, 6.037298, 6.112594, 5.322952, 5.770592, 5.711932, 5.526630, 5.458778, 5.734221, 5.543622
#AFTER
5.133354, 5.149831, 5.016901, 5.123560, 4.990820, 5.459221, 5.242380, 5.448488, 5.026409, 4.912934, 5.340224, 5.089208, 5.124014, 5.069436, 5.135053, 5.000400, 5.109141, 5.336060, 5.383335
```

BEFORE AVG = 5.695528
AFTER AVG = 5.162672

So using test this gives 0.5s

To reproduce test below bash can be used 

```bash
#!/bin/bash

for i in {1..20}
do

curl -w "%{http_code} %{time_total}\n" -o /dev/null -sL 'https://webstudio-builder-k3sxay3ft-webstudio-is.vercel.app/builder/b0e475ef-f991-4a3f-ac63-b2e1fdaa5bfd' \
  -H 'authority: webstudio-builder-k3sxay3ft-webstudio-is.vercel.app' \
  -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'cache-control: no-cache' \
  -H 'cookie: YOUR COOKIE' \
  -H 'pragma: no-cache' \
  -H 'referer: https://webstudio-builder-k3sxay3ft-webstudio-is.vercel.app/login?returnTo=%2Fdashboard' \
  -H 'sec-ch-prefers-color-scheme: dark' \
  -H 'sec-ch-ua: "Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: document' \
  -H 'sec-fetch-mode: navigate' \
  -H 'sec-fetch-site: same-origin' \
  -H 'sec-fetch-user: ?1' \
  -H 'upgrade-insecure-requests: 1' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36' \
  --compressed

sleep 600

done
```




## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-14 16:15:10 +04:00
Ivan Starkov 2374b5f22b Fix assets vercel uploading (#1626)
## Description

1. Add 404 instead of redirect
2. Fix vercel/remix upload

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-13 18:11:41 +04:00
Bogdan Chadkin 50a54a7c70 Drop unused deps (#1623)
Found these dependencies are not used in our project. Can be safely
removed.
2023-05-13 15:06:01 +07:00
Ivan Starkov d14c07f190 Fix hydration (#1621)
## Description

closes #1557

## Steps for reproduction

Install
https://chrome.google.com/webstore/detail/dark-mode/dmghijelimhndkbmpgbldicpogfkceaj
plugin
See our website doesn't work but current PR is


## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-13 11:52:03 +04:00
Ivan Starkov b1326b5306 Test push (#1622)
## Description

- actions/cache@v3 for pnpm moved to setup-node
- Added on `pull_request`
- restricted push on main.
- Added build cancelation.
- Same behaviour on checkout is preserved as was on push see
```
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit
```


## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-12 23:34:48 +04:00
Bogdan Chadkin 6893d43702 Format schema.prisma 2023-05-12 21:34:32 +07:00
Bogdan Chadkin dd92436fe6 Upload file instead of form data (#1620)
Form data is complex format to work with and web api does not support
its stream parsing and we had to use remix utilitties.

Here upload file as is so node or worker gets stream and do anything
with it. So this is one less dependency on node.

These streams are still bufferred but we can improve this at least for
images later to not exceed vercel memory.
2023-05-12 21:15:23 +07:00
Bogdan Chadkin 810a87b990 Store content type before upload (#1619)
Content type is important when detect image or font parser and required
(or recommended?) for uploading to s3.

Here temporary saved it in File.format and reuse in upload. Later
overriden with parsed format.

This is a preparation to uploading only blob without additional
information.
2023-05-12 14:28:44 +07:00
Bogdan Chadkin 653300bbdf Drop session storage polyfill (#1501)
Looks like we do not have problems anymore in canvas without this
polyfill.
2023-05-12 01:07:14 +07:00
Roman Pominov bfd69c8947 Some fixes in form-handlers (#1616)
## Description

1. Added `hasMatchingForm` that is needed for #1611 
2. Made sure we ignore File form entries for now

Corresponding saas PR:
https://github.com/webstudio-is/webstudio-saas/pull/157
2023-05-11 15:05:35 +03:00
Bogdan Chadkin f018ff9451 Upload assets with native fetch (#1583)
Remix fetcher introduce constraints for own server implementation. For
example body can be FormData, object or string and FormData requires
custom stream parser (they provide one).

Though streaming blob much simpler task and can be done with native
streams.

Another constraint is request cancelation when component is unmounted.
We workaround this with global persistent fetcher. Though native fetch
does not require this workaround too.
2023-05-11 18:59:51 +07:00
Bogdan Chadkin 74da71b7c7 Move assets data into File table (#1573)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1335

We want to be able to copy paste assets between projects. Though assets
are tied to specific project and we need to duplicate its data client
side which can be a security hole.

Here I added File table with all file data from assets grouped by name.
So now client side will still duplicate File data within session but
this data will no persist in db/storage.
2023-05-11 17:29:01 +07:00
Ivan Starkov de99e6e8af Release 0.65 (#1613)
## Description

npm update 

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
0.65.0
2023-05-10 16:03:30 +04:00
Roman Pominov bf6d2c8e78 Forms fixes (#1610)
Closes #84 

## Description

1. Fixed a bug in form template (`email=email` instead of `name=email`)
2. Changed labels of components
3. Moved Button back to Forms category

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
- [ ] hi @istarkov, I need you to do
  - conceptual review (architecture, feature-correctness)
  
## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-10 14:54:39 +03:00
Ivan Starkov 86dc7e74aa Fix unexpected error issue on project loading (#1612)
## Description

This is fast fix, in the future we would need to review all out errors
Intead of this 
<img width="415" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/78e214ca-2780-4449-b0a7-9854456c4eef">

We are now trying to login user first, and then show this 
<img width="386" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/0744ed68-eedd-47f7-a6c0-ccf049bd47e4">

Also instead of Unexpected Error showing real error.


## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-10 15:53:15 +04:00
Ivan Starkov 5dfab33a1b Update npm packages (#1609)
## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
0.64.0
2023-05-10 11:59:48 +04:00
Ivan Starkov 2fa32a1b76 Remove hover debounce (#1607)
## Description

Debounce on hover makes me feel that everything is slow, you move mouse
but hover is not completed.
Compare with immediate hover, feels like UI is superfast

For example Figma has immediate hover


## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-10 11:57:26 +04:00
Ivan Starkov d06e9616e5 Fix width not set on prject change and breakpoints change (#1605)
## Description

On project change breakpoints can be updated later than canvas with is
calculated, so breakpoints from the previous project were used.

Here is the fix

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-10 11:57:02 +04:00
Roman Pominov fa6aba1f8b Changes to enable forms submission in saas (#1568)
Part of #84 
Should be deployed together with
https://github.com/webstudio-is/webstudio-saas/pull/148

## Description

1. Exposed `User.email` in the data we send to saas
2. Used Remix's form in the Form component
3. Refactoring in `form-handlers`

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
- [ ] hi @istarkov, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)


## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-10 10:38:01 +03:00
Ivan Starkov bcdd13d7ad Improve drag performance if style panel is open (#1606)
## Description

Do not rerender Instance on drag

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-09 21:58:51 +04:00
Oleg Isonen 2dd7e2f715 Add bug report button (#1603)
## Description

We may need to rethink what we show when user hits report bug, e.g.
ideally user would at least make a screenshot or create a video but for
now as a simple option is to lead them directly into github discussions

## Steps for reproduction

1. see new bug button on the left bottom

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-09 16:52:22 +02:00
Bogdan Chadkin 2afa5e1cd4 Drop link preset states (#1604)
:active and :visited states on links have special behaviour. They are
vendor defined until color on stateless link is defined. Similar to how
vars work there is var with default. And when var is somewhere defined
default is overriden.

Though using vars for this specific case is too complex here easier
solution. We can just remove active and visited states on default
styles. User may never see this inconsistency as usually would modify
color on stateless link first and then go to active or visited states.
2023-05-09 15:01:21 +07:00
Ivan Starkov cda5c6ba1a Release-0.63.0 (#1601)
## Description

Npm update

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
0.63.0
2023-05-08 21:06:14 +04:00
Bogdan Chadkin f4f0a2e984 Show stateless styles when state is selected (#1602)
Ref
https://discord.com/channels/955905230107738152/955907841070346300/1104517307478319257

Ideally make these values remote but as a fast fix made them local.
2023-05-09 00:04:11 +07:00
Ivan Starkov a7f0a807a7 Path performance, validate only changed styles (#1600)
## Description

170ms -> 5ms reduction on validation 

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-08 20:47:20 +04:00
Ivan Starkov 812cbaab14 Fix editing of background gradient resetted other properties of the curent layer (#1598)
## Description

Fix editing of background gradient resetted other properties of the
curent layer


https://discord.com/channels/955905230107738152/955907841070346300/1105100883542409279


## Steps for reproduction


To reproduce set position center


![](https://cdn.discordapp.com/attachments/1105100883542409279/1105101084013367337/image.png)

Goto "Code", add space then click enter
All values are resetted


## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-08 19:28:52 +04:00
Bogdan Chadkin 12ad194e9c Optimize patch endpoint (#1599)
We batching transactions though each transaction and each namespaace in
it loads build data, applies patches and writes to db. This makes
patches do a lot of connections to db within single request.

Here each patch request loads and updates build only once and apply
patches of all transactions to intermediary state.
2023-05-08 21:25:24 +07:00
Bogdan Chadkin 943126de84 Optimize patch endpoint (#1599)
We batching transactions though each transaction and each namespaace in
it loads build data, applies patches and writes to db. This makes
patches do a lot of connections to db within single request.

Here each patch request loads and updates build only once and apply
patches of all transactions to intermediary state.
2023-05-08 21:24:39 +07:00
Ivan StarkovandOleg Isonen 6a3368add0 Fix collapsed outline sometimes not visible (#1597)
## Description

<img width="499" alt="image"
src="https://user-images.githubusercontent.com/5077042/236811571-0f98099d-907a-47d4-8733-59dba654d26f.png">

Now on connected outlines, it will not be the thin border like before.
(But the thin border has an issue that in some cases it can become a
solid line)

Imo this looks better vs thick 4px outlines at the webflow

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-05-08 13:58:23 +02:00
Ivan Starkov 15ad4df530 Fix adding/deleting bg style in case of style source inheritance (#1593)
## Description

Fix adding/deleting bg style in case of style source inheritance


https://discord.com/channels/955905230107738152/955907841070346300/1102929914182762617

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-08 15:27:18 +04:00
Bogdan Chadkin 888dbbbb0e Compute remote style sources only for current breakpoint (#1594)
Ref
https://discord.com/channels/955905230107738152/955907841070346300/1104446794211016744

Remote style sources should provide info only within current breakpoint.
So when remote from other breakpoint we show cascaded remote instead.
2023-05-08 00:47:56 +07:00
Ivan Starkov 91cf072068 Fix background image edit (#1592)
## Description

Image background layers are invisible during edit
fixes
https://discord.com/channels/955905230107738152/955907841070346300/1104430743049994331

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-07 19:59:14 +04:00
Ivan Starkov 935f4aeb89 Fix scroll on edit (#1589)
## Description

The current approach relies on batching behavior.
Here is fast fix to not reset atom if global atom has not been changed

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-07 19:27:32 +04:00
Bogdan Chadkin 6fb341b1ce Fix link default and preset styles (#1591)
Here made added browser defaults for link and set color as preset.
2023-05-07 18:58:27 +07:00
Bogdan Chadkin 09e32b60ff Support remote label for next style sources (#1590)
Ref
https://www.figma.com/file/xCBegXEWxROLqA1Y31z2Xo/%F0%9F%93%96-Webstudio-Design-Docs?type=design&node-id=1037-32728&t=HT5zNo0zhXDCpIX8-0

Here show next style sources as remote too. And add alert when next
style source has same style as local so user see something overrides it.
2023-05-07 17:25:57 +07:00
Bogdan Chadkin 6820b8d866 Render placement indicator in portal (#1585)
Need to render placement indicator in portal to avoid shifting because
of position: relative on ancestors elements like ScrollView.

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-06 21:34:55 +02:00
Bogdan ChadkinandOleg Isonen fd4e2a4f4b Fix dragging when navigator is docked (#1586)
Fixed conditional rendering of tree preview.

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-05-06 21:34:38 +02:00
Bogdan Chadkin 1f908d1abf Add padding to settings scroll area (#1587)
Outline was cut with overflow: scroll from scroll area. Here moved
paddings inside and added bottom padding.

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-06 21:29:12 +02:00
Bogdan Chadkin 3bec46192b Support state category in meta (#1584)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1518

Now default states should be spread per component. And states have
category with fallback to "states".
2023-05-06 23:53:46 +07:00
Bogdan Chadkin 4f6bad897c Align style source along with design (#1575)
Ref https://github.com/webstudio-is/webstudio-builder/issues/807
https://github.com/webstudio-is/webstudio-builder/issues/1108

- more consistent input spacing
- more visible text editing
- consistent border around input instead of shadow
- toggle selected state
2023-05-06 18:42:25 +07:00
6e50f85a88 added 4 brand colors for spinner (#1581)
## Description

added 4 brand colors for spinner

brand/spinner-turquoise
brand/spinner-blue
brand/spinner-purple
brand/spinner-orange

---------

Co-authored-by: Bot (build-figma-tokens.yml) <bot@localhost>
Co-authored-by: Roman Pominov <rpominov+github@gmail.com>
2023-05-06 12:13:18 +03:00
Ivan Starkov 317edc0d79 Update NPM 0.62.0 (#1580)
## Description

Update NPM

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
0.62.0
2023-05-05 16:52:53 +04:00
Roman Pominov b495aab7f1 from-handlers package (#1554)
Part of #84  

## Description

Added a `@webstudio-is/form-handlers` package that we're going to use to
send submitted forms as emails.

There're two handlers currently:

- mailchanels
(https://blog.cloudflare.com/sending-email-from-workers-with-mailchannels/)
 - n8n
2023-05-05 14:44:15 +03:00