1678 Commits
Author SHA1 Message Date
Bogdan Chadkin 5509d593b3 fix: prevent closing navigator when drag and drop on canvas (#4393)
Fixes https://github.com/webstudio-is/webstudio/issues/4158

none is confused with undefined value, replaced it with more explicit
"auto".
2024-11-09 18:09:08 +04:00
Bogdan Chadkin 4945c8ba8d feat: support contact email list (#4391)
Closes https://github.com/webstudio-is/webstudio/issues/4390

Users requested to setup multiple emails in our default form action.

**Testing**

- try to enter multiple emails in project settings
- submit form from published site
2024-11-09 17:54:11 +04:00
Bogdan Chadkin 971ae9f10c experimental: add command panel (#4367)
Ref https://github.com/webstudio-is/webstudio/issues/1696

Press cmd+k or ctrl+k and see yourself. Or just watch the video.

Based on https://cmdk.paco.me used by shadcn.


https://github.com/user-attachments/assets/46bb807a-c6af-487f-b57c-09fb8f6e5741
2024-11-09 17:41:36 +04:00
Bogdan Chadkin 84274281d5 refactor: add instance key store (#4389)
Here added $instanceKey store which can be used to access props and
variables from any part of the tree. This replaces manual
JSON.stringify(selectedInstanceSelector) in a few places.
2024-11-07 19:59:43 +04:00
Bogdan Chadkin a1c05ba768 refactor: move selected instance store into awareness (#4388)
We need to avoid accessing instance selector where possible to make
logic hookable.

Here moved `$selectedInstance` into awareness and switch to it in many
places instance selector is accessed directly.
2024-11-07 18:51:53 +04:00
Oleg Isonen 4c260971c8 fix: avoid left sidebar border covering the workspace outline (#4386)
## Description

- use one border for both upper and lower part of the left sidebar menu
- use box pseudo element instead of border to avoid overlapping 1 px of
the workspace
- make caret visible when user is editing content and parent has an
instance outline from 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-11-07 15:23:44 +01:00
Bogdan Chadkin f36fe2fa55 refactor: store selected instance in awareness state (#4378)
For now sync awareness with selected instance selector. Added selectPage
and selectInstance utilities to update awareness properly.
2024-11-07 12:38:10 +04:00
Bogdan Chadkin 4234f88db8 refactor: move canvas renderer into builder (#4382)
There is no need for canvas renderer in react-sdk. Moved into builder
and slightly cleaned.
2024-11-07 12:19:19 +04:00
Ivan Starkov 9d04bf5386 fix: Rich Text Editor: Prevent pasting links when inside an existing link (#4374)
## Description

closes #2887

## Steps for reproduction

See Issue

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-11-06 16:29:50 +04:00
Bogdan Chadkin a71190a0a8 refactor: drop legacy style engine (#4377)
The only left usage of legacy style engine was collapsed instance logic.
Here inlined necessary code and got rid of the rest.
2024-11-06 14:52:15 +04:00
Bogdan Chadkin 6b1ea5eb4a refactor: move selected page into awareness state (#4371)
Ref https://github.com/webstudio-is/webstudio/issues/4364

We need to implement universal linking of current user view. For this I
added "awareness" state which reflects terminology from collaboration
libraries.

First migrated selected page id and fixed usages.
2024-11-06 02:29:52 +04:00
Bogdan Chadkin 4cd51fa299 feat: select the page when opening the page settings (#4375)
Closes https://github.com/webstudio-is/webstudio/issues/4372

Editing another page settings is confusing to users and complicates the
logic. Win-win
2024-11-06 02:15:27 +04:00
Ivan Starkov bac416c47f fix: When quickly selecting different instances, the instance is not selected. (#4370)
## Description

partial fix for 1 from
https://github.com/webstudio-is/webstudio/issues/4095

The issue was incorrect clickCount count

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-11-05 18:21:28 +04:00
Bogdan Chadkin 11603f4694 build: bump storybook (#4369)
Storybook is getting smaller.
2024-11-05 17:26:04 +04:00
Ivan Starkov 44f6b778de fix: Show hover outlines during text editing (#4368)
## Description

fix for

When you click into an instance to edit it, such as a paragraph, the
hover outline no longer shows when you hover over other instances. Only
in the navigator does the hover show.

Hover outlines now display on all elements except those that have been
edited.

https://github.com/webstudio-is/webstudio/issues/4095

## Steps for reproduction

Start editing the text, hover outlines are now shown for all elements
except edited.

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-11-05 16:43:15 +04:00
Ivan Starkov b762a92214 fix: Option list changes width on hover (#4363)
## Description

closes #4300

Also simplified types instead of unions with 2300+ strings

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-11-04 15:17:45 +04:00
Bogdan Chadkin 5fbda47b41 refactor: migrate css preview to new style engine (#4353)
Preview now managed by new style engine.

![Screenshot 2024-10-29 at 12 05
25](https://github.com/user-attachments/assets/3017247e-2fc6-4572-bb19-8309067a570d)
2024-11-04 10:36:53 +04:00
Bogdan Chadkin 4fb2338ae8 refactor: remove legacy style engine from style panel (#4338)
Migrated style panel to new style engine for sections rendering and
switched position section as well.

Test following cases

- flex child section when parent has flex
- list style section for list or list item
- inset control when position value is relative, absolute, fixed or
sticky
- inset control when position is inherited form relative etc
- zindex control when parent is flex or grid
2024-11-04 10:14:01 +04:00
Bogdan Chadkin 57fc3b9e73 feat: allow drag and drop in pages (#4358)
Closes https://github.com/webstudio-is/webstudio/issues/403

Now pages and folders can be maintained with drag and drop.



https://github.com/user-attachments/assets/108230ea-95fa-40ac-bbcb-5d0785c5554f
2024-11-04 10:02:29 +04:00
Bogdan Chadkin 65a58de7c0 fix: complete css variable properly in code inputs (#4360)
Fixes https://github.com/webstudio-is/webstudio/issues/4357
2024-11-04 00:26:34 +04:00
Bogdan Chadkin cfef7718a4 fix: allow project redirects to dynamic paths (#4352)
Fixes
https://discord.com/channels/955905230107738152/1300622567740018730

Users cannot specify dynamic path in redirect new path.
2024-11-03 23:37:54 +04:00
Ivan Starkov afc77fa72a feat: Block editing with arrow keys (#4334)
## Description

- Double click now sets cursor to the click position
- Up/Down arrows on a first/last line trying to preserve cursor x
position (visible in case of block above block)
- Right/Left arrows switch blocks if cursor is at block begin/end.



## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-10-28 19:44:08 +03:00
Bogdan Chadkin d61945402c build: upgrade to typescript 5.6 (#4345)
Only some apis added to types.
2024-10-28 12:17:43 +03:00
Bogdan Chadkin f987b50220 refactor: switch to lezer highlight (#4347)
We already use lezer code highlighting in codemirror. Here I replaced
prism.js with lezer for css preview as well.

Also switched theme in code editor to the same solarized light extracted
from thememirror.net.

Html highlighting is improved a little.
![Screenshot 2024-10-27 at 13 23
42](https://github.com/user-attachments/assets/2fc42a38-456e-4c8c-8f05-ea767c9e1a13)
2024-10-28 11:40:38 +03:00
Bogdan Chadkin 65b32e8a40 refactor: drop display: contents (#4348)
We have advanced panel which allows to set any value. No need to have
display: contents behind the flag anymore.
2024-10-28 11:07:08 +03:00
Bogdan Chadkin f48bfa4542 build: drop prisma build (#4346)
This shaves a few seconds from all GitHub actions
2024-10-26 19:09:13 +03:00
Bogdan Chadkin ac74d634ac refactor: bump ui libraries (#4344)
Here only patches with bug fixes. Shouldn't affect us. Bumping right
after release so we have time to tinker with UI.
2024-10-25 13:21:37 +03:00
Bogdan Chadkin ac2e8d9d1e feat: support editing sides in space and inset controls (#4341)
Here made space and inset controls to remember active properties when
open side input.

Test inset and space controls with alt and shift pressed.



https://github.com/user-attachments/assets/c6718245-9426-49ed-91a5-05f83c3ccb88
2024-10-25 11:38:14 +03:00
Bogdan Chadkin c7c9033d14 refactor: move sidebar panels into features (#4332)
This removes 2 levels of nested folders for 5 features. Will simplify fs
navigating a lot.
2024-10-25 01:09:26 +03:00
Bogdan Chadkin 119a36a3cf fix: forbid scrubbing css variables (#4340)
Css variables takes a lot of space inside of input and user need to have
text selection work natively. Scrub does not fit in this.
2024-10-25 01:05:32 +03:00
Bogdan Chadkin 54f6c1c953 fix: select "space" autocomplete with mouse (#4339)
Here fixed closing space popover before selecting value from
autocomplete with mouse.
2024-10-24 23:31:25 +03:00
Bogdan Chadkin 82c301372b refactor: remove css variables feature flag (#4337)
Css variables are landed. No need for conditional rendering.
2024-10-24 20:48:46 +03:00
Bogdan Chadkin 0c25e5028b feat: preview variable values in autocomplete (#4336)
Ref https://github.com/webstudio-is/webstudio/issues/3399

Here added 2 things to improve accessibility of variables for users

1. Added color and unit values preview in autocomplete list
2. Color inputs no longer autocomplete unit values and unit inputs no
longer autocomplete color values.

![Screenshot 2024-10-24 at 00 40
15](https://github.com/user-attachments/assets/2406460c-ad68-4657-97ea-0abc4080ce2f)
![Screenshot 2024-10-24 at 00 35
49](https://github.com/user-attachments/assets/36c68bb7-9365-4914-bf3d-4324be7fae96)
2024-10-24 12:26:27 +03:00
Bogdan Chadkin c28faf27ab build: bump eslint (#4325)
eslint-plugin-react-hooks now works with eslint 9 and do not require
@eslint/compat wrapper.
2024-10-22 17:20:47 +03:00
Bogdan Chadkin 73dd80ae27 refactor: control floating panel open state (#4331)
Slightly change floating panel "open" state to make it controlled from
outside. This is important with form validations.
2024-10-22 15:33:08 +03:00
Bogdan Chadkin 7c23583b75 refactor: decouple features from sidebar (#4304)
Here removed reliance on sidebar from all its panels so we can store
them as features and not just panels.

This will greatly reduce folder nesting and simplify navigation from
command line.
2024-10-22 12:51:46 +03:00
Oleg Isonen 02551fa0c0 feat: improve vertical space usage (#4307)
## Description

- all inputs/buttons have now 24px height
- horizontal paddings on all panels are 12px, vertical 8px - optimized
for better vertical density
- drive-by: removed all old colors, now its all entirely based on
typography collection from figma and so we can now make dark mode
reality

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-10-22 01:58:06 +02:00
Bogdan Chadkin 5ee0860cd9 fix: show "delete variable" in variable tooltip (#4322)
Ref https://github.com/webstudio-is/webstudio/issues/3399

![Screenshot 2024-10-20 at 10 41
55](https://github.com/user-attachments/assets/d194cc13-efec-40fa-8021-13d2473188a1)
2024-10-21 14:18:58 +03:00
Bogdan Chadkin 257d760222 feat: support paste styles in advanced section (#4323)
Ref https://github.com/webstudio-is/webstudio/issues/3399
https://github.com/webstudio-is/webstudio/issues/3540

Here added two more features to advanced panel

1. When search for property, user can enter css declarations like
`width: 100px; height: 200px;` and press enter instead of searching for
property and editing property after creation.

2. When search for property, user can paste css declarations from some
theme editor or figma, this is useful interop with other tools

Note: this does not support breakpoints, states or tokens. Declarations
are inserted only within currently selected style source and state.


https://github.com/user-attachments/assets/1f37f5d1-11b9-4f05-ae4d-a7c647ae14b6
2024-10-21 12:07:24 +03:00
Bogdan Chadkin 4168a2dd80 fix: prevent creating css variable with invalid name (#4319)
Closes https://github.com/webstudio-is/webstudio/issues/4292

Here instead of validation error I just remove "create" option. It is
consitent with just random invalid name not starting with `--`.



https://github.com/user-attachments/assets/214b71b9-1b88-49de-8eb0-4e815c67486f
2024-10-20 13:12:21 +03:00
Bogdan Chadkin 325eff1469 feat: support css variables in transitions (#4317)
Ref https://github.com/webstudio-is/webstudio/issues/3399

- stop filtering when open combobox suggestions
- prevent showing selected description when highlight css variable
- support css variables in duration
- support css variables in delay

Also replaced select with css value input for easing. Had to get rid
from out easings presets though now we can use easings from css
variables which I think a better trade.

Presets will make sense with dedicated UI for easings like
https://www.easing.dev.

![Screenshot 2024-10-19 at 21 55
02](https://github.com/user-attachments/assets/4cdbb799-d01c-4c3f-93dc-c54e9723635e)
2024-10-20 10:30:28 +03:00
Ivan Starkov 8545ca7a94 fix: Infininite loop in backgrounds (#4299)
## Description

Just inifinite loop 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-10-19 16:30:02 +03:00
Ivan Starkov 513d78681b fix: After modifying style, it takes two clicks to select the next instance (#4314)
## Description
Style Source looses focus after adding Token


closes #4309
closes #4306

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-10-19 15:14:35 +03:00
Ivan Starkov 309b6a8b27 fix: Hovering over autocomplete ignores actual input value (#4312)
## Description

closes #4301
closes #4308

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-10-19 15:00:46 +03:00
Bogdan Chadkin 6939a99759 fix: allow inserting into textual collection items (#4305)
Fixes https://github.com/webstudio-is/webstudio/issues/4294
2024-10-19 12:24:28 +03:00
Bogdan Chadkin 7d111f4428 fix: prevent failing navigator when instances are inconsistent (#4303)
Users somehow make instances tree inconsistent. For example deleting
instances does not delete id from parent children.

I still have not idea how to reproduce this but we need to stop failing
users with broken state. Here just logged into console instead of
throwing error.
2024-10-18 14:16:18 +03:00
Jaya Krishna Namburu b07b904bcd fix: show custom option in easing dropdow only when used (#4290) 2024-10-16 17:41:36 +05:30
Ivan Starkov 2337551767 fix: Fix multiline expression (#4297)
## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-10-16 14:25:54 +03:00
Ivan Starkov 17b3159c49 fix: Input arrow up and down pulls up autocomplete now instead of incrementing (#4291)
## Description

closes #4287

- [x] Up/Down now uses `onChange` instead of `onChangeComplete` (this
should be faster)
- [x] Up/Down in the Space control now works with modifiers (it seems
this never worked before)
- [x] Up/Down no longer opens the combobox if the input is
numeric-like​⬤

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-10-16 13:43:40 +03:00
Oleg Isonen 89bca4d7d0 feat: Publish settings section in project settings (#4295)
Closes https://github.com/webstudio-is/webstudio/issues/4272

## Description

- I moved the only publish setting we have to a separate section, so we
can add more in the future.
- Added a settings button in publish dialog

<img width="625" alt="image"
src="https://github.com/user-attachments/assets/8c72028c-69e6-4fb6-849f-bdb9ee0594cc">
<img width="327" alt="image"
src="https://github.com/user-attachments/assets/70c892de-65ef-4962-a790-fb8c6e6b49e7">


## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-10-16 10:33:32 +02:00