3605 Commits
Author SHA1 Message Date
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
Bogdan Chadkin 0ac4050d7e Upgrade to pnpm 8.4 (#1578)
Ref https://github.com/pnpm/pnpm/releases/tag/v8.4.0
https://github.com/pnpm/pnpm/releases/tag/v8.3.0

- pnpm install && pnpm install no longer needed
- pnpm dedupe simplifies upgrading deps, didn't enable check in CI caz
taking too long
2023-05-05 18:07:14 +07:00
Bogdan Chadkin 536622b2bf Add cache control (#1574)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1572
2023-05-05 14:35:36 +07:00
Bogdan Chadkin a167d702f7 Fix copy paste of style sources (#1570)
Ref
https://discord.com/channels/955905230107738152/955907841070346300/1103260031048241182

Here style sources were pasted without copying. Here I renamed the
utility to clarify a little and provided proper list of instance ids.
2023-05-05 14:34:51 +07:00
Bogdan Chadkin d952c1bf0a Simplify asset data (#1561)
Removed all no longer used fields. Stopped passing id with form data.
2023-05-05 11:14:45 +07:00
Bogdan Chadkin fda33bb9b1 Rename loadByProject to loadAssetsByProject (#1560)
Found the name super confusing when started to work on builder. Here
renamed and dropped unused loadByIds utility.
2023-05-03 22:33:00 +08:00
Ivan Starkov fee87685db Fix scrub control (#1559)
## Description

Fixes scrub control can set invalid unitless value 

## 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-03 15:02:17 +04:00
Roman Pominov bcdfc9f83d Fix floating point math issue in scrub (#1562)
## Description

Fix of the bug reported in
https://discord.com/channels/955905230107738152/1102991527254446182:

1. Set value of any input that you can scrub to 1.3
2. Scrub to decrease it by 1 to 0.3
3. The value gets set 0.30000000000000004
2023-05-03 13:36:01 +03:00
Oleg Isonen d16a340c5c Icons update (#1558)
## Description

Updated all icons in this list
https://github.com/webstudio-is/webstudio-builder/issues/1362

## Code Review

- [ ] hi @rpominov, 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-03 00:00:16 +02:00
Bogdan Chadkin 7f0e1bb2f3 Upload files by url (#1547)
Here splitted asset upload into 2 phases

1. initial upload creates asset in db with uploading state and generates
unique name (POST /rest/assets endpoint)

2. use unique name to upload file, extract meta and mark asset as
uploaded (POST /rest/assets/$name endpoint)

This give us more straightforward data flow without creating temporary
asssets with fake id which are changed later.

And also unlock splitting files into separate table to allow securely
copy paste assets between projects (still wip).

Fixed persistent fetcher to support sequential submits.
2023-05-03 01:08:07 +08:00
Bogdan Chadkin 403edf6523 Parse tuple in css-data (#1548)
We support tuple type in styles and can now parse initial values
properly which is important since we no longer use computed browser
style.
2023-05-03 01:00:37 +08:00
Bogdan Chadkin f82bd6f22e Fix preset styles (#1556)
Preset styles were skipped because of early return.
2023-05-03 00:50:27 +08:00
Roman Pominov 15a307f6dd Fix lostpixel (#1553)
https://discord.com/channels/955905230107738152/1102879882960175164

## 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
2023-05-02 16:24:17 +03:00
Oleg Isonen abb4c2f639 Forms (#1525)
https://github.com/webstudio-is/webstudio-builder/issues/84#issuecomment-1522834976

## Description

1. Added new components:
   - textarea
   - radio-button and radio-button-field
   - checkbox and checkbox-field
   - success-message
   - error-message
 2. Added `states` like `:disabled`, `:valid`, etc. to `input`
3. Added `custom-components/form` that renders success-message and
error-message conditionally
 4. Added `success` and `error` style states to `custom-components/form`
5. Style panel now shows "Select an instance on the canvas" if the
selected component is not rendered on canvas (e.g. error-message may not
be rendered)
 
Not in this PR:

- The mailer package
- Backend handler for forms (will be in a PR in SAAS)
- Logic in Form that actually submits to backend and shows success/error
messages

## Steps for reproduction

1. Add a "Form" to canvas
2. Add "Checkbox Field", "Radio Button Field", "Text Area" to the form
3. Try changing `initialState` property of the form
2023-05-02 14:14:06 +03:00
Roman Pominov 5399b206f3 Fixed label's cursor & couple TS fixes (#1549)
## Description

1. Fixed label's cursor:
https://discord.com/channels/955905230107738152/1102616619219439676
2. Improved TS to make sure all prop types are always handled in props
panel
2023-05-02 13:55:27 +03:00
Bogdan Chadkin 4e31256b2a Restrict allowed parents with config in meta (#1542)
Added `allowedParentComponents: string[]` option to meta which prevents
dropping, inserting or pasting components into wrong parents. For
example ListItem now can be placed only inside of List component.

This will unlock better experience with compound radix components.
2023-05-02 15:20:22 +08:00
Oleg Isonen 1962ba89b9 Breakpoints editor (#1543)
https://user-images.githubusercontent.com/52824/235469260-2a212e73-0815-4a4b-a02d-d98cf56c7a88.mp4



## Description

Closes https://github.com/webstudio-is/webstudio-builder/issues/1407

## Steps for reproduction

1. click edit breakpoints
2. test all possible inputs

## Code Review

- [ ] hi @rpominov , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview
- [ ] @TrySound please check if you have any concerns regarding removing
breakpoints and styles

## 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-01 20:13:57 +02:00
Roman Pominov 86ee37a7ad Some fixes in props panel (#1546)
## Description

1. Removed a sanity check that started to give false positives (wasn't
needed really in the first place)
2. Cmd+enter in textarea control now saves the value
3. Fixed layout of props panel in the case when there're no initial
props
2023-05-01 16:38:45 +03:00
Bogdan Chadkin b8b9978068 Use remix memory upload handler (#1514)
We had own uuid-handler utility to buffer streamed values for formData.
Remix has own memory upload handler to do the same. A little less custom
code for us.
2023-05-01 19:06:02 +08:00
Bogdan Chadkin c2ac8ed354 Allow to reset drop target (#1541)
Here I allows to return undefined in swapDropTarget. This enables us to
reset drop target when move cursor out of droppable elements.

For example before Body was always selected as drop target. Though this
behavior prevent us from restricting parents for cases like Tabs>Tab and
List>ListItem.

Also got rid from emulatePointerAlwaysInRootBounds which was used to
workaround that fallback to Body. So now no longer necessary too.

https://user-images.githubusercontent.com/5635476/235142653-48b95ebe-9714-44c4-90d9-b69b930f2379.mov
2023-04-29 13:22:18 +07:00