ref #4608
## 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
Another case I forgot. Variables should be unset in all page metas when
deleted.
- Test delete of body variable used in page title
- Test delete of global variable used in page title
- Bind all page meta values and delete the variable to make sure it was
unset from all fields
Global variables will be replaced with "name" or unset when deleted from
data variables section.
There are few cases to test
1. variable is unset on a few pages when delete
2. variable is unset on inside of slots when delete
Some templates have variables with missing scopeInstanceId on dialogs or
something else from broken embed template. Here allow it in validation
because migration would be more complex.
---------
Co-authored-by: Oleg Isonen <oleg008@gmail.com>
Ref https://github.com/webstudio-is/webstudio/issues/4768
Forgot to handle the case with rebinding with parent variables after
variable on child is deleted.
Also fixed the case with rebinding variables outside of slot scope.
Ref https://github.com/webstudio-is/webstudio/issues/4768https://github.com/webstudio-is/webstudio/issues/4753
User can paste expression with not defined variable and should get it
saved in case of accidental closing popover.
Now such expressions can be executed in builder and will be compiled
with undefined instead of variables in published sites.
In the future we need to add global diagnostics to let users find such
places faster.
Also fixed a couple of ui issues
- react error about using button inside of button in data variables list
- react error about using unknown middlewareData prop from floating-ui
<img width="307" alt="Screenshot 2025-01-27 at 16 30 58"
src="https://github.com/user-attachments/assets/2ddc9ead-33a2-4438-b641-6943d7472f7e"
/>
Ref https://github.com/webstudio-is/webstudio/issues/4768
Here improved copy paste experience between expressions. All expressions
while editing have are no longer encoded with ids. For example
`system.search.name` is the same.
Though invalid js characters are encoded with code point like this
`Collection Item.title` becomes `Collection$32$Item.title` when copy
into textual editor.
And this less obscure name can be copied between different lists with
the same `Collection Item` name.