3595 Commits
Author SHA1 Message Date
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
Oleg Isonen 35b01e5e68 Implement breakpoints popover design (#1534)
Part of https://github.com/webstudio-is/webstudio-builder/issues/1407

## Description

Implements design changes from
https://www.figma.com/file/xCBegXEWxROLqA1Y31z2Xo/%F0%9F%93%96-Webstudio-Design-Docs?node-id=3719-47947&t=IyN7o4sC7xAxaPNG-4

- new List and ListItem primitive components just for keyboard
accessibility
- deprecated List and ListItem we had before because they are only
useful in asset manager and we already learned how we want to treat
keyboard differently

## 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-04-28 20:36:02 +02:00
Roman Pominov 3ebf8fe9c3 Update Flex-child icons (#1540)
## Description

Updated icons in the Flex-child section:
https://github.com/webstudio-is/webstudio-builder/issues/1411#issuecomment-1527085455

Closes #1411
2023-04-28 15:52:18 +03:00
Ivan Starkov 70746774bf Release 0.61.0 (#1539)
## Description

Release 0.61.0
Npm packages 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.61.0
2023-04-28 09:36:56 +04:00
Bogdan Chadkin 5595742f75 Insert styles from embed template (#1538)
Now embed templates can define simplified version of our styles which is
useful for radix components and as AI output.

```
styles: [
  {
    property: 'backgroundColor',
    value: { type: 'keyword', value: 'red' }
  }
]
```
2023-04-28 12:07:10 +07:00
Roman Pominov ee17f1416a Fix: can't delete a form element from canvas (#1537)
## Description

Fixes bug:

- select an Input instance by clicking on it on canvas
- press backspace to delete it
- nothing happens
2023-04-27 15:58:03 +03:00
Bogdan Chadkin bb9db13c9f Run dts as additional checks in actions (#1523)
This fixes the bug introduced in my previous PRs and reproducable only
by running dts generation. Here added it to checks so we could avoid
broken publishes while releasing.
2023-04-27 17:37:59 +07:00
Bogdan Chadkin c60ee0af07 Show initial and html style in style panel (#1533)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1067

We need to move away from getComputedStyle for not local styles in style
panel.

Here added default html style from browser sources. Now we can render it
and properties initial styles instead of computed styles.

Also fixed in properties data generation currentcolor -> currentColor
and removed same from border presets.
2023-04-27 17:06:38 +07:00
Ivan StarkovandOleg Isonen 5ba6c25565 Units menu in css value input (#1524)
## Description

closes #1464


- [ ] rename "UnitMenu" to just "Menu" because we are going to bring in
some keywords _I think it's still mostly unit menu, and having that for
keywords only values we have keywordButtonElement I would prefer to keep
current name_
- [x] 1. put in the menu the most popular units/keywords to keep it
short and usable in this order:
    "-",
    "px",
    "%",
    "em",
    "rem",
    "dvw",
    "dvh",
    "auto",
    "normal",
    "none"
- [x] 2. add "auto" , "normal" , "none" to properties that support these
keywords into the menu
- [x] 3. use "-" when value is unit-less (detect unitless value from
mdn-data)
- [x] 4. use "-" when keyword value is selected
- [x] 5. allow any unit to be typed even if its not in a menu, when its
typed and user hits enter - we show it as a unit, just not part of the
menu
- [x] adjust margin for keywords menu to 2px from the bottom edge of the
input

## Steps for reproduction

Open width style. Set value 0, see menu
<img width="166" alt="image"
src="https://user-images.githubusercontent.com/5077042/234040113-1780a843-b773-44c3-9e90-56c77b9ecc7f.png">

Set value 10px, see menu 
<img width="141" alt="image"
src="https://user-images.githubusercontent.com/5077042/234040280-c7690bf0-00d5-44a4-b8a9-a07bf31f5625.png">


Set value `10vw`
see menu
<img width="150" alt="image"
src="https://user-images.githubusercontent.com/5077042/234040386-a7ed6f40-a0c7-433f-a500-df5c5ac1938f.png">


Set value `Auto` see menu

<img width="140" alt="image"
src="https://user-images.githubusercontent.com/5077042/234051716-a76a3cce-e56e-4842-bad9-ca7905ce2382.png">

When menu is closed see

<img width="120" alt="image"
src="https://user-images.githubusercontent.com/5077042/234052911-23306652-0cf1-4a54-9c2b-2b33c4d20f15.png">

Set "Inherit"

see menu

<img width="165" alt="image"
src="https://user-images.githubusercontent.com/5077042/234052792-304b1de6-8d5c-4e23-92aa-42a34da47631.png">

see Position its still a keyword

<img width="232" alt="image"
src="https://user-images.githubusercontent.com/5077042/234053175-68c892f2-332a-4938-a4b5-928d7a30fe32.png">








## Code Review

- [x] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

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

## Before merging

- [x] 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
- [x] 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-04-27 14:00:29 +04:00
Bogdan Chadkin 6db60b7e7d Drop baseUrl from tsconfig in packages (#1530)
This should fix auto import from parent folders
which is very annoying right because tries to import from 'src'.
2023-04-26 18:59:43 +07:00
Bogdan Chadkin 2017153253 Migrate preset styles to array of declarations (#1531)
Before preset styles used `{ tag: { property: value } }` format. Now we
are switching to `{ tag: [{ state,property,value }] }` to support
specifying states in preset styles.

Same format will be used for embed template styles.

Here switched only format. States in preset styles not supported in
builder yet.
2023-04-26 18:59:31 +07:00