Commit Graph
142 Commits
Author SHA1 Message Date
Oleg Isonenandzehjotkah 1f4c53419d feat: Pseudo elements (#5572)
This PR replaces the limited "States" dropdown in the Style Panel with a
flexible input field that supports any CSS selector, pseudo-class, or
pseudo-element. This allows for advanced styling capabilities such as
`:has()`, `:focus-visible`, and complex combinators.

## Key Changes

### Flexible Selector Input
- Replaced the fixed "States" category list with a free-form input
field.
- Supports **any** valid CSS selector (e.g., `:hover`, `::before`,
`:has(:checked)`).
- Validation logic ensures only valid selectors are accepted (triggered
on `Enter` key).

## How to Test
1. Select an element and open the Style Panel.
2. Click on the Local style source or a Token.
3. In the input field (bottom of menu), type a selector like `:hover` or
`:first-child` and press Enter.
4. Verify the selector is added and selected.

---------

Co-authored-by: zehjotkah <111518041+zehjotkah@users.noreply.github.com>
2026-01-19 17:28:47 +01:00
Oleg Isonen ff2e086632 feat: Convert instance to an instance of a different component (#5522)
Closes https://github.com/webstudio-is/webstudio/issues/5523

## Description

- convert command now shows a list of available components
- along the way cleaned up commands.ts and made namespaced subscribe api
to subscribe for specific actions

## 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:
0000)
- [ ] 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
2025-12-16 22:17:18 +01:00
Oleg Isonen dcdac0eaa7 feat: Project settings dialog accessible from dashboard (#5514)
## 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:
0000)
- [ ] 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
2025-12-15 17:23:16 +01:00
Bogdan Chadkin f46095ea2a fix: show only one "delete instance" command (#5324)
<img width="501" height="213" alt="image"
src="https://github.com/user-attachments/assets/8a5223e6-dbb7-42c6-89fa-1c8dd3945b52"
/>
2025-07-17 12:01:39 +02:00
Bogdan Chadkin 19a98fa1ae fix: order routes before navigating in preview (#5311)
Ref https://github.com/webstudio-is/webstudio/issues/5223

Navigating within preview didn't work well because we relied on order of
creation and more inclusive routes like `/*` could match before
`/my-page`.

Here fixed it with routes sorting. The algorithm is very simplified but
covers our usecases within builder.
2025-07-01 18:45:25 +03:00
Bogdan Chadkin fa875ab5c1 feat: use body element on new pages (#5222)
Ref https://github.com/webstudio-is/webstudio/issues/3632

Now new project and new page will have body element in the root instead
of body component.

<img width="422" alt="Screenshot 2025-05-20 at 00 15 37"
src="https://github.com/user-attachments/assets/aee568c5-f0e4-40f5-a5a3-e94fc765505d"
/>
2025-05-20 12:24:27 +03:00
Bogdan Chadkin 28e61f49bd experimental: add matching tag when insert element component (#5204)
Ref https://github.com/webstudio-is/webstudio/issues/3632

Now element does not provide default tag and instead builder will try to
find tag matching its parent.

This way we can insert element, give it "ul" tag
and then insert another element into it which will match only "li"


https://github.com/user-attachments/assets/3ea87624-9524-4f2e-91b2-d658d16d7a1b
2025-05-13 12:46:40 +04:00
Bogdan Chadkin 8c91170f63 fix: allow deleting from input in preview mode (#5194)
Fixes
https://discord.com/channels/955905230107738152/1369211497590554675

Delete on canvas is separateed from the one in builder so we can safely
remove preventDefault to allow entering or deleting from inputs in
preview mode.
2025-05-11 13:51:17 +04:00
Bogdan Chadkin e622e08df6 refactor: drop legacy matchers (#5146)
We already fully switched to component content model and no longer
necessary legacy matchers.
2025-04-20 16:59:22 +07:00
Bogdan Chadkin bd77a252c2 refactor: detect empty tags and components (#5132)
Here replaced "embed" and "control" components with content model. Many
components now detect no content based on html content model like with
img or input tags. In other cases component meta can explicitly specify
empty array to not accept anything.

```
meta = {
  contentModel: {
    category: 'instance',
    children: []
  }
}
```
2025-04-17 23:23:20 +07:00
Bogdan Chadkin 3b8c58b435 refactor: use content model to detect rich text (#5109)
Ref https://github.com/webstudio-is/webstudio/issues/3632

Here I finally got rid from "rich-text-child" necessity. With html
elements in the tree it will no longer work so we need a new way to work
with rich text.

Added a few new utilities to content model which detect rich text by
text inside or any textual tags. Span and links can still be detected as
containers rather than children when not surrounded by text and other
textual elements.
2025-04-10 14:16:34 +07:00
Bogdan Chadkin d5bc0f9760 feat: enforce html content model (#5074)
Ref https://github.com/webstudio-is/webstudio/issues/3632

This is a big step into native html elements support. I scraped content
model from html spec and now enforcing all html tags structure so we no
longer need to write custom restrictions.

Now paragraph cannot be nested into heading. Box cannot be nested into
span Text though still can in div Text. Any interactive elements cannot
be nested automatically. List item should have a list as direct parent
(collection and slot are exception because they don't have elements
inside).

Most rules are defined in this table
https://html.spec.whatwg.org/multipage/indices.html#elements-3
2025-04-01 22:07:56 +07:00
Bogdan Chadkin 051c1ba226 refactor: hyphenate style engine (#4977)
Migrated style object model to hyphenated css properties. A lot of
conversions no longer necessary.
2025-03-11 01:01:37 +07:00
Bogdan Chadkin af98a41edf fix: update display from none (#4969)
Fixes https://github.com/webstudio-is/webstudio/issues/4963

Looks like accidentally wrong method was used.
2025-03-08 12:23:47 +01:00
Bogdan Chadkin 21271086f2 fix: prevent inserting into instance with placeholder (#4901)
Closes https://github.com/webstudio-is/webstudio/issues/4897

Added "placeholder" field to component meta to signal the instance
accepts should not be insertion target. This reverts us to previous
behavior even with empty instances.

Also slightly refactored placeholder rendering to use attr() instead of
extra css variable.
2025-02-22 23:56:30 +07:00
Bogdan Chadkin 250b525ef9 refactor: move css generation to sdk (#4889)
No changes. Just moved generateCss from react-sdk to sdk.
2025-02-18 21:14:05 +07:00
Bogdan Chadkin c776166e8a fix: prevent dropping into image instance (#4789)
User reported he was able to drop components into images. Added lookup
for containers first and then for matching ones.

Testing

- add image
- try to drop box into it
2025-01-26 23:24:18 +07:00
Bogdan Chadkin 94f219c249 refactor: rewrite core components templates with jsx (#4756)
Here refactored all core components with jsx templates and moved them to
sdk package. Fixed all imports as well.
2025-01-17 18:29:40 +07:00
Ivan Starkov cbbf694c38 feat: Make canvas cursor style compatible across all browsers (#4727)
## Description

Safari does not change the cursor based on 
`-webkit-user-select: none;`

We need to explicitly set `cursor`

ref #1818

## 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:
0000)
- [ ] 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
2025-01-07 09:27:08 +03:00
Ivan Starkov e9fa0cd530 fix: Deleting in the code editor causes the instance on the canvas to be removed. (#4717)
## Description

Removed logic based on preventDefault

## 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:
0000)
- [ ] 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
2025-01-05 14:39:23 +03:00
Ivan Starkov 44ca2d2da6 fix: Clicking out of input without selecting dropdown still selects it (#4710)
## Description

closes #4615
Also fixes various of other issues. 

## 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:
0000)
- [ ] 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
2025-01-04 13:51:24 +03:00
Ivan Starkov d577a1ffc0 fix: Fix preview on css variables defined on the current element (#4705)
## Description

probably somehow related to #4448



## Steps for reproduction

define --color variable at :root and on current element.

See background or color preview on the current element. 


## 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:
0000)
- [ ] 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
2025-01-04 08:44:42 +03:00
Oleg Isonen 42f57605e6 fix: Fixes hotkeys on radix select, dropdown etc (#4701)
closes https://github.com/webstudio-is/webstudio/issues/4550

## Description

1. Detect radix dropdown,select and co as part of the form controls that
also implement keyboard shortcuts and don't use global shortcuts on
these
2. Simplify shortcut settings by having just one setting that works for
everything: form tags, content editable, radix

## Steps for reproduction

1. click button
3. 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:
0000)
- [ ] 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
2025-01-03 10:27:00 +01:00
Ivan Starkov c385f6c3a7 fix: Blockquote editing placeholder (#4677)
## Description

Fixes this
<img width="639" alt="image"
src="https://github.com/user-attachments/assets/92f9da6e-c949-445f-bdce-cb95e0ca9ecd"
/>

with 

<img width="431" alt="image"
src="https://github.com/user-attachments/assets/740e19a1-98a3-4b22-951e-2c8e368571ad"
/>


## 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:
0000)
- [ ] 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-12-30 19:16:50 +03:00
Bogdan Chadkin 1315731c76 refactor: insert new component copy (#4648)
Our copy paste is able to merge breakpoints so we can leverage it when
generate new component template. Here instead of passing base breakpoint
id I invoke insertWebstudioFragmentCopy with generated breakpoint which
is merged into project one.

Also switched plugin-embed, plugin-markdown and ai to use the same
insertWebstudioFragmentCopy utility.
2024-12-24 23:08:55 +07:00
Ivan Starkov fb67334790 experimental: Use placeholders for editable elements (#4644)
## Description

ref #4595

### TODO:
- [x] - Found bug that deleting last LI does not delete UL
- [x] - Consider removing default texts for paragraph link blockquote
and headings i.e. `Heading text you can edit`


https://p-cfc5b051-3b7a-4a59-a994-44d8d2f8b836-dot-styles.development.webstudio.is/

The following components are considered non-collapsible in **Edit** and
**Content** modes:
*Paragraph*, *Heading*, *ListItem*, *Blockquote*, *Link*.

We are adding placeholders for these components when they are empty,
using the following logic (partially inspired by Notion):

1. **If a component is empty and not being edited**, we display the same
label as shown in the components tree.

![image](https://github.com/user-attachments/assets/a9c41829-ee62-427e-910e-0acd6df1c513)

2. **If a component is empty and being edited**, the behavior depends on
its location:
   - **Inside a content block:**  
- For *Paragraph*, we display: `Write something or press '/' for
commands...`.
     - For all other components, we display the label.  
   - **Outside a content block:**  
     - Always display the label.  

<img width="435" alt="image"
src="https://github.com/user-attachments/assets/96e0c79c-92dc-40c3-a768-db8322a38c3b"
/>


### Update: Default Content Block Component Changed

The default content block component has been updated. Add the new
component

### PS
On Publish and Preview previous behaviour.




## Steps for reproduction

1. click button
4. 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:
0000)
- [ ] 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-12-23 19:05:15 +03:00
Ivan Starkov a27c8b9c9e experimental: Enter support (#4627)
## Description

ref #4595 

- Enter on block creates new paragraph, text or h1 block if any exists
in templates
- New text added through `/` command is fully selected
- If after command block is empty it's replaced with another block
- esc now closes the `/` menu
- backspace on empty now deletes block


Play here


https://p-0b40acbe-34df-4475-8f52-120d5b97da4e-dot-enter.development.webstudio.is/?mode=content

- [x] - Bug (Next PR)
<img width="325" alt="image"
src="https://github.com/user-attachments/assets/0dfa447b-dbfd-4c60-b553-ca041da23a4f"
/>
to reproduce
`Enter`, `/` select Heading, type `blabla`, then `/`, then `Enter`



## 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:
0000)
- [ ] 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-12-20 22:57:02 +03:00
Ivan Starkov ea88935731 feat: RichText edit / command menu (#4621)
## Description

ref #4595

Search is working

<img width="246" alt="image"
src="https://github.com/user-attachments/assets/5dc850e4-6a36-4996-9aaa-f051ac7e977f"
/>

Arrow keys, enter, mouse click is working.



https://p-15889dd9-ed47-46db-9411-fa18c1efb2fe-dot-edit.development.webstudio.is/

- [x] - Enter and click
- [ ] - Repeat > N then close menu (later)
- [x] - In case of select item clear cmd `/blabla`
- [x] - Put cursor inside 1st editable block of the new instance
- [x] - Should work only inside editable content

## 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:
0000)
- [ ] 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-12-20 16:21:56 +03:00
Bogdan Chadkin 9dd1d8979b experimental: add wrap/unwrap commands (#4588)
Ref https://github.com/webstudio-is/webstudio/issues/1696
https://github.com/webstudio-is/webstudio/issues/4356
https://github.com/webstudio-is/webstudio/issues/3981

Added following new commands

- wrap in box
- wrap in link
- unwrap

All three follow constraints and prevent unwanted wrapping and
unwrapping for example wrap in link will not wrap a text with link or
list with list item cannot be unwrapped.

<img width="420" alt="image"
src="https://github.com/user-attachments/assets/698168e1-d583-43e1-b6f7-bd0185cad7df"
/>
2024-12-16 17:33:22 +07:00
Bogdan Chadkin 302f5daa7f refactor: hardcode asset and upload path in builder (#4579)
We hardcoded asset base url in image loader.
Though locally different one is not resolved properly. So aligned local
and deployed image paths with /cgi/asset/ everywhere. Images are now
uploaded to public/cgi/asset locally.
2024-12-13 23:18:22 +07:00
Bogdan Chadkin a02e9d1afe refactor: prepare react 19 types (#4553)
React 19 simplified ref object story, moved JSX from global into react
package. Here prepared our code to not refactor too much in packages
bump.
2024-12-13 16:20:54 +07:00
Bogdan Chadkin cfeb75c876 refactor: replace detachable: false with constraints (#4548)
Here got rid of detachable flag in favor of more universal constraints
queries.

Despite of detachable constraints allow to drag such nodes but limits
drop target more precisely.

Try any radix component.
2024-12-13 00:55:36 +07:00
Bogdan Chadkin b2137c1a7c refactor: migrate dnd to new constraints (#4507)
Replaced legacy utilities with matchers

List item no longer possible to place into list item, thanks to new
parent matcher.

Dnd in navigator and on canvas can be tested
2024-12-05 00:24:23 +07:00
Ivan Starkov 71e0be8363 feat: Transform Plus button to Minus in case of Alt button is pressed (#4490)
## Description

ref #3994

<img width="260" alt="image"
src="https://github.com/user-attachments/assets/88652fef-7229-42cb-bf64-33ec07249426">

<img width="260" alt="image"
src="https://github.com/user-attachments/assets/e8199a7d-ebbc-4971-8641-d83424643ac8">

<img width="245" alt="image"
src="https://github.com/user-attachments/assets/804b8ef5-4f71-42b3-b9d1-5cf034706a02">


## 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:
0000)
- [ ] 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-12-01 18:29:13 +03:00
Bogdan Chadkin 09364f654c experimental: add shortcuts group to command panel (#4434)
Ref https://github.com/webstudio-is/webstudio/issues/1696

Added most of our shortcuts to command panel.

<img width="482" alt="Screenshot 2024-11-17 at 17 28 55"
src="https://github.com/user-attachments/assets/347f877f-43e5-4ab7-9061-a1728d5c9df8">
2024-11-29 20:20:19 +07:00
Bogdan Chadkin 766551fc0c refactor: stop importing remix overrides on canvas (#4466)
We want to decouple remix in cli and published sites from remix in
builder.

Here I stopped importing remix override components. So now we could
migrate CLI to react router without changes in builder.
2024-11-24 19:04:21 +07: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 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
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
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 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
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
Bogdan Chadkin 62467a3ad3 fix: render background styles after builder reload (#4259)
Ref https://github.com/webstudio-is/webstudio/issues/4244

When started rendering all preview var() fallbacks as unparsed. Styles
renderer was not able anymore to rerender those.

So here at least temporary just added computed with transform value to
always rerender when assets are changed.
2024-10-10 00:37:10 +03:00
Bogdan Chadkin 9b81aa6050 fix: render images on canvas (#4234)
Fixes https://github.com/webstudio-is/webstudio/issues/4232

Broke it when serialized as unparsed without assets transform.
2024-10-06 23:07:12 +03:00
Bogdan Chadkin 26d7e041c3 experimental: preview css variables on highlight in combobox (#4224)
Ref https://github.com/webstudio-is/webstudio/issues/3399

Here relaxed converting to css variables for fast preview in canvas. Now
variables can be used as fallbacks for preview variables.

![Screenshot 2024-10-05 at 23 59
53](https://github.com/user-attachments/assets/e6ef71b5-c71e-4e75-9696-eb9faf616a8b)
2024-10-06 12:46:00 +03:00
Oleg Isonen 3d98a692d4 chore: faster font weight detection (#4211)
## Description

Using willReadFrequently option makes it 3-5 times faster

## 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-04 00:40:41 +02:00
Oleg Isonen 9fd5ce0552 experimental: Abort controller (#4195)
## Description

I tried how the code will look like with abort controller, if you don't
like it - we can close this without merging


## 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-03 13:55:43 +02:00
Bogdan Chadkin bbf37d3e61 refactor: simplify var value fallbacks (#4201)
Ref https://github.com/webstudio-is/webstudio/issues/3399

Initially css variable fallback was defined in schema as array though
it's actually a single value by spec and may contain commas. We don't
have css variables in data yet so should be safe to change schema before
too late.
2024-10-02 18:05:05 +03:00
Oleg Isonen 052fe9e55c feat: auto-detect font weight based on selected font family (#4134)
## Description

I rewrote the font weight display logiс in the following way:

1. We now detect for each font  which weights are supported
2. Unsupported weights are lighter gray in the list, but user can still
choose them, we just hint that the weight may not be supported, because
with font stacks, you can have different fonts supporting different
weights, we are testing the one user can see right now

## Steps for reproduction

1. try switching between different stacks and see that when hovering the
font width that is light gray, its not affecting canvas, meaning our
detection was correct and that weight is not supported
3. same thing for any custom font

## 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-01 22:55:10 +02:00
Bogdan Chadkin d74b3e6b65 refactor: remove deprecated tree (#4180)
We refactored both pages and navigator with new tree.
2024-10-01 18:49:07 +03:00