Commit Graph
3637 Commits
Author SHA1 Message Date
Bogdan Chadkin 39d9d5c9ba Make meta serializable (#1649)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1129
https://github.com/webstudio-is/webstudio-builder/issues/1545

Here put all components meta icons into strings and fixed usage with
innerHTML. This allows us to load components only from canvas and send
to builder.
2023-05-19 20:41:31 +07:00
Oleg Isonen 25a110b778 Use user-select: none by default (#1642)
Closes https://github.com/webstudio-is/webstudio-builder/issues/1639

And https://github.com/webstudio-is/webstudio/discussions/29

## Description

We are changing default behavior to not user selectable and allowing it
where it's practical, like copying project name as a deletion
confirmation

## Code Review

- [ ] hi @rpominov , 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-18 19:15:40 +02:00
Roman Pominov 12e4014656 Panel tabs (#1653)
## Description

1. Added `PanelTabs` to design-system. Closes #966
2. Used `PanelTabs` in inspector panel. Closes #1643
2023-05-18 19:46:30 +03:00
Roman Pominov 0a02293aa1 Change section title color (#1615) 2023-05-18 17:16:56 +03:00
Ivan Starkov ad574fefc2 Nested Input Button (#1650)
## Description

Closes #1646


## 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-18 14:32:11 +04:00
Ivan Starkov 667902d599 Add neutral-destructive button (#1648)
## Description

closes #1645

## 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-18 13:14:56 +04:00
26bb454b3b Two new text styles: Regular Bold and Mono Bold (#1647)
Co-authored-by: Bot (build-figma-tokens.yml) <bot@localhost>
Co-authored-by: Roman Pominov <rpominov+github@gmail.com>
2023-05-18 10:19:39 +03:00
Bogdan Chadkin 5439343437 Mark files as deleted (#1638)
Ref https://github.com/webstudio-is/webstudio-builder/issues/193

To make undo of assets deletion work we need to stop deleting files from
storage to restore assets without loosing actual file.

Here added File.isDeleted and file.updatedAt fields to mark as deleted.
This way we can run scheduler to actually delete files which are marked
for some time already. And undo of asset deletion now works.
2023-05-17 17:11:07 +07:00
Roman Pominov b5c8716460 selectedInstanceIsRendered -> selectedInstanceRenderState (#1640)
Fixes review comment:
https://github.com/webstudio-is/webstudio-builder/pull/1632#discussion_r1196082482
2023-05-17 12:03:20 +03:00
Roman Pominov b186c3c85c Fix project card menu z-index (#1637)
## Description

Fixed a bug where menu is obscured by the big letters of another
project's card

![image](https://github.com/webstudio-is/webstudio-builder/assets/825702/93d8f948-6c35-44b8-8c20-e1267bd0b219)
2023-05-17 11:55:58 +03:00
Bogdan Chadkin f9add7acdd Fix breakpoints width and rendering (#1631)
Ref https://github.com/webstudio-is/webstudio/discussions/30

Here fixed width update which always relied on base breakpoint instead
of selected one.

Another issue found and fixed is wrong order of rendered breakpoints.
2023-05-17 01:23:52 +07:00
Roman Pominov d04e0e83ec Fix scroll reset in style panel (#1632)
## Description

1. Closes #1617

Before this PR `selectedInstanceIsRendered` behaved like this:

Switching to instance that **is** on canvas: `true -> false -> true`
Switching to instance that **is not** on canvas: `true -> false`

Issue: we can't tell apart brief `false` in the first case, and final
`false` in the second

After this PR:

Switching to instance that **is** on canvas: `true -> undefined -> true`
Switching to instance that **is not** on canvas: `true -> undefined ->
false`

Now we can distinguish temporary `undefined` from permanent `false` and
don't hide style panel during `undefined`

## Steps for reproduction

Case 1:

1. Select a Box instance
2. Scroll style panel
3. Select another Box instance
4. Scroll should not reset

Case 2:

1. Select a Box instance
2. Select a Success Message instance in a Form
3. Style panel should show "Select an instance on the canvas" message
2023-05-16 16:03:56 +03:00
Roman Pominov 68243c6876 Assets copy-paste (#1636)
## Description

1. Closes #1325
2. Assets used in styles are copied
3. Assets used in props are copied
2023-05-16 14:34:42 +03:00
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