Commit Graph
3322 Commits
Author SHA1 Message Date
Jaya Krishna Namburu 9ef2e1663a fix: show advanced options as highlighted for flex-sizing when used (#4438)
fixes #4408 

## Description

Fixes highlighting the advanced options icon, when advanced section is
used for flex-sizing.

## Steps for reproduction
- Add a element and set display to flex.
- Now add some child elements to the flex display
- Used advanced options from `flex-sizing` and set some custom values.
- Now, the `...` indicator for the advanced option should be
highlighted.


![fix-advanced-options](https://github.com/user-attachments/assets/342cc652-1534-43cf-aab9-af87d18f2114)

## Code Review

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

## Before requesting a review

- [x] made a self-review

## Before merging

- [x] tested locally and on preview environment (preview dev login:
0000)
2024-11-20 11:09:30 +01:00
Ivan Starkov 145f8d9ed7 feat: Builder mode switch menu (#4423)
## Description

ref https://github.com/webstudio-is/webstudio/issues/3994

<img width="256" alt="image"
src="https://github.com/user-attachments/assets/ee37fe7d-41ed-40f3-909f-a29d12d07e4b">

## 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-19 21:04:18 +03:00
Bogdan Chadkin 1ac74854e8 refactor: bump to remix 2.14 (#4433)
Ref https://github.com/remix-run/remix/blob/main/CHANGELOG.md#v2140
2024-11-19 15:40:47 +07:00
Ivan Starkov 82785555fa fix: Page title field becomes unfocused after entering one character (#4436)
## Description

closes #4435

Cherry Pick from https://github.com/webstudio-is/webstudio/pull/4428

## 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-18 21:22:09 +07:00
Bogdan Chadkin 65e58d719a fix: stop failing when retrieve mdn url for css variables (#4432)
Fixes https://github.com/webstudio-is/webstudio/issues/4431
2024-11-16 21:00:00 +07:00
Bogdan Chadkin b8a341c4fd experimental: add tabbable command actions (#4407)
Ref https://github.com/webstudio-is/webstudio/issues/1696

Here adding new idea into command search.
User searches for an object and can navigate actions over this object.
In case of pages user can open page or open pangel settings panel.

https://github.com/user-attachments/assets/a5d6c039-ba6b-4dbb-b0b4-bb9f1782dd20
2024-11-16 16:38:09 +07:00
Oleg Isonen c84374708a chore: Make dev password more escure! (#4425)
## 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-11-15 17:25:34 +01:00
Bogdan Chadkin d1a8fddb02 build: bring back nanoid to prisma (#4426)
Nanoid was used in very old migrations. Forgot we need to run them all
when setup new db.

Also bumped nanoid version to the latest.
2024-11-15 23:11:54 +07:00
Ivan Starkov c3ca454e1f feat: Add Content Editor share permission (#4421)
## Description

Part 2 Of #3994


Hidden under flag

<img width="360" alt="image"
src="https://github.com/user-attachments/assets/59cf859a-3325-425b-b06e-31b74bd93df4">


<img width="350" alt="image"
src="https://github.com/user-attachments/assets/dca8521c-5e2b-4e4f-893f-df416cea0481">


Links with `?mode=content` from free plan should not work

<img width="626" alt="image"
src="https://github.com/user-attachments/assets/d737474d-8110-42a1-98fd-2ab94ed24cde">

Content edit shared links have no design mode

<img width="421" alt="image"
src="https://github.com/user-attachments/assets/42ee3d4b-7aab-4e2c-9e28-b5b0fe6c58af">


## 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-15 13:59:28 +04:00
Jaya Krishna Namburu d1bd5df4e1 feat: add links to mdn documentation inside tooltips for sections and properties (#4416)
## Description

fixes #4383 
Tweaked the `__generated__/properties.ts` that is generated at build
time to store `mdn_url` in it. And use these url's to show on the
tooltips for the properties and sections.

## Steps for reproduction
- Open any property, and the tooltip opens
- Inside the tooltip, you should be able to click on the external link
icon.
- The link should take you to a mdn link of the same.


![external-links](https://github.com/user-attachments/assets/9b81d2da-7d5f-4d7f-abdb-e0eaa5902a14)


## Code Review

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

- [x] made a self-review

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
2024-11-15 10:20:55 +05:30
Ivan Starkov ad04a72e3b fix: Tooltips trigger without a delay (#4419)
Partially (or may be fully) Fixes #4406
Closes #4410
Some issues can't be fixed with current tooltips - i.e. if hover from
tooltip is going onto the canvas we can't set delay on hover back.


## Description

1. Fixes focusable buttons had tooltip.
2. 

## 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-14 20:35:53 +04:00
Ivan Starkov 36ba02d30f feat: Add builderMode, add mode "edit" (#4376)
## Description
Part 1 Of #3994 

This PR introduces a feature flag, `contentEditableMode`, that hides the
`EditorButton` in the top bar. This button is now intended for **testing
purposes only** and will **never be used in production**.

<img width="154" alt="image"
src="https://github.com/user-attachments/assets/f4a37334-71b9-43d8-b4a8-afd518fc6833">

## Most Notable Things In The Content Edit Mode

1. **Notion-like Editing**: Elements are editable with a single click.
2. **Restricted Element Editing**: Binded elements, such as expressions,
are non-editable.
3. **Selective Property Editing**: Only properties for `img` and `link`
elements are editable.

Additional changes:
- **Copy/Paste and Drag/Drop**: Disabled to maintain a controlled
testing environment.

Refer to the issue `Part 1` for further details on upcoming changes and
planned enhancements.


## Steps for reproduction

Play play 

## 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-14 11:06:29 +04:00
Bogdan Chadkin f75a837c9e refactor: add sdk runtime (#4417)
Similar to react-sdk/runtime added another entry point to sdk package
which includes all the stuff imported on published sites to reduce js
size.

./fixtures/webstudio-remix-netlify-functions/build/client: 392kB
(-176kB)
2024-11-13 17:20:42 +04:00
Bogdan Chadkin bb8e41ab57 refactor: migrate builder tests to vitest (#4415)
Really, this was too easy
2024-11-13 14:39:17 +04:00
Bogdan Chadkin cb255932bf refactor: migrate CLI tests to vitest (#4409)
Jest is barely maintained and vitest is blazinly faster.
2024-11-13 01:38:19 +04:00
Oleg Isonen 7ec1bb54ad fix: Remove uppercasing on dashboard card titles and also enable user-select. (#4402)
## Description

Remove uppercasing on dashboard card titles and also enable user-select.

## 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-12 12:46:26 +01:00
Bogdan Chadkin bc0f6bb6a3 refactor: generalize insertable lookup (#4398)
Here replaced a bunch boilerplaty code with more general
findClosestInsertable. This also reduced amount of explicit instance
selector calls. Prevented inserting list item into body. Refactored
tests with jsx.
2024-11-10 23:02:15 +04:00
Bogdan Chadkin b2a844ae01 refactor: bump cookie (#4397)
cookie package now has builtin types
2024-11-10 21:33:14 +04:00
Bogdan Chadkin c54fbe45c4 experimental: fuzzy search tokens (#4396)
Ref https://github.com/webstudio-is/webstudio/issues/1696

Switch to match sorter for more control over results. Now it will try to
match best token in the list of each option.
2024-11-10 02:12:45 +04:00
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