137 Commits
Author SHA1 Message Date
Ivan Starkov 828e673681 Update version 0.49.0 (#1273)
## Description

Update version 0.49.0 to publish npm


## Steps for reproduction

1. click button
2. expect xyz

## 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

- [ ] 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-03-21 17:21:43 +04:00
Bogdan Chadkin c815f069cd Render tree with normalized data (#1267)
We finally able to use normalized data to render tree. A few last
improvements in tree drag and drop add support for slots with
duplicating ids within tree.
2023-03-19 23:49:41 +03:00
Ivan Starkov fcee225a5f Add simple background parser (#1240)
## Description

ref #877 - the ability to parse multiple gradient layers from Figma 
![Screen Recording 2023-03-18 at 00 25
12](https://user-images.githubusercontent.com/5077042/226031486-0dc0978b-5572-4dd6-9441-b86b2e469a7a.gif)


closes #1255 - now background added at the top

fixes css value input invalid input now shows as invalid

## Steps for reproduction

Copy some background from figma like
```
background: linear-gradient(180deg, #11181C 0%, rgba(17, 24, 28, 0) 36.09%), none, linear-gradient(180deg, rgba(230, 60, 254, 0.33) 0%, rgba(255, 174, 60, 0) 100%), radial-gradient(54.1% 95.83% at 100% 100%, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%), linear-gradient(122.33deg, rgba(74, 78, 250, 0.2) 0%, rgba(0, 0, 0, 0) 69.38%), radial-gradient(92.26% 201.29% at 98.6% 10.65%, rgba(255, 174, 60, 0.3) 0%, rgba(227, 53, 255, 0) 100%) /* warning: gradient uses a rotation that is not supported by CSS and may not behave as expected */, radial-gradient(84.64% 267.51% at 10.07% 81.45%, rgba(53, 255, 182, 0.2) 0%, rgba(74, 78, 250, 0.2) 100%) /* warning: gradient uses a rotation that is not supported by CSS and may not behave as expected */, #EBFFFC;
```

Open any layer paste it into the code, and click enter or blur.
See layers added. BGColor has changed if set.


## 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

- [ ] 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
2023-03-18 21:33:48 +04:00
Bogdan Chadkin cde929f344 Refactor tree node with selectors (#1264)
Tree node is a renderer for pages and navigator instances. Selector of
nodes is build by passing parent selectors.

Select and hover callbacks are now provide selectors.
2023-03-18 19:17:54 +03:00
Bogdan Chadkin 60a2380884 Access instance data by id in tree (#1265)
In many cases the logic in tree component rely only on ids and it's
additional complexity to resolve full instances.

Here I rewrite getItemChildren, canAcceptChild and canLeaveParent to
accept instance id instead of instance.
2023-03-18 19:04:43 +03:00
Oleg Isonen 570a9d0a81 Fix stacking context issues for any combobox dropdowns (#1263)
Closes https://github.com/webstudio-is/webstudio-builder/issues/1104

## Description

anything that uses position relative has higher stacking context, in
this case spacing uses position relative, so we always use portal to
prevent the need to use zIndex

## Steps for reproduction

1. open spacing
2. open style sources dropdown
3. it should not overlap

## Code Review

- [ ] hi @TrySound , 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-03-18 16:53:44 +01:00
Oleg Isonen 245ff1f8ed less cocain for somebody 2023-03-17 23:36:07 +01:00
9585ab8a62 changed word "inherited" to "remote" (#1252)
and word "set" to "local" for parity with code
also changed background.canvas to background.workspace

---------

Co-authored-by: Bot (build-figma-tokens.yml) <bot@localhost>
Co-authored-by: Roman Pominov <rpominov+github@gmail.com>
2023-03-17 09:43:25 +03:00
Oleg Isonen d93937365e Make canvas iframe receive no pointer events for the time of dragging (#1256)
Fixes https://github.com/webstudio-is/webstudio-builder/issues/1213

## Description

when user drags color picker thumb, they can move mouse over canvas,
with CORS canvas will hide the events and we loose control

## Steps for reproduction

1. see video in the issue
2. also affected dragging components onto canvas

## Code Review

- [ ] hi @TrySound , 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-03-16 19:03:01 +01:00
Bogdan Chadkin aaffa9019e Output item selector on tree drag end (#1257)
Another step further. Now horizontal shift output item selector instead
of item itself.
2023-03-16 16:29:54 +03:00
Oleg Isonen 6f6a57c0e1 Remove handled updates from the updates list (#1251)
## Description

Fixes https://github.com/webstudio-is/webstudio-builder/issues/1223

After handling settings update, I forgot to delete the update from the
list, but if the user doesn't unmount component, switches instance, then
unmounts, the same scheduled update is still there and applies to the
new instance

## Steps for reproduction

1. name an instance
2. select a diff instsance
3. switch from settings tab to styles tab

## Code Review

- [ ] hi @TrySound , 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-03-15 23:34:27 +01:00
Bogdan Chadkin 55aae4491c Pass selected instance selector to tree (#1250)
Selector is a list of ids from root to target to allow identify
instances even with duplicated ids.

Here is the first step to support selectors in navigator. Passing
selected instance selector already helped to get rid of one getItemPath
usage.
2023-03-15 22:48:21 +03:00
Oleg Isonen 6d4fab40b5 Blocking alerts (#1242)
Fixes #198

## Description

1. disables builder in non-chromium browsers
2. disables builder when window is smaller than 900px
3. allows testing in unsupported browsers via feature flag
"unsupportedBrowsers" or "*"

## Steps for reproduction

1. open builder in safari
2. resize the window to < 900 and then return back to 900+

## Code Review

- [ ] hi @TrySound , 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-03-15 20:27:18 +01:00
Oleg Isonen 50431010e3 update workspace background color closes #1245 2023-03-15 17:58:05 +01:00
Bogdan Chadkin 48559568f5 Simplify horizontal shift (#1248)
Got rid of getItemPathWithPositions. Horizontal shift can compute these
positions with getItemPath and getChildren. Refactored left shift with
for loop.
2023-03-15 12:36:18 +03:00
Bogdan Chadkin e0553200e9 Improve instance hovering (#1236)
Label again started flickering because hovered instance and hovered
outline store changes have delay in between. Solution as before is to
provide all info with outline. Here I just passed both label and
component to get the shape for getInstanceLabel.

Removed react hook from instance hovering and refactored with instance
selectors.
2023-03-14 19:51:34 +03:00
Roman Pominov 4b1a6847a4 Refactor link behaviour in preview (#1237)
## Description

- Removed Link wrapper that used to apply `preserveBuildParams` (part 1
of #1120)
- Removed `preserveBuildParams` completely, because we no longer need it
as we request page switch instead of letting link to navigate
- Removed `mode` parameter from BuildParams, because it's always "edit"
now
- Fixes #1231

## Steps for reproduction

1. Open preview mode
2. Click on some links
2023-03-14 18:06:24 +03:00
Ivan Starkov d50123128d Drag drop background layers (#1238)
## Description

ref #877

- [x] - add storybook 
<img width="305" alt="image"
src="https://user-images.githubusercontent.com/5077042/224958554-b414cf44-6978-4ae1-81e4-fde7403615b7.png">

- [x] - add drag'n'drop

## Steps for reproduction

Add few background layers, drag'n'drop them

## 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

- [ ] 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-03-14 18:46:07 +04:00
Ivan Starkov 5cf2212b0b Update versions (#1235)
## 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-03-14 11:35:16 +04:00
Bogdan Chadkin fddb67e924 Rename instance address to instance selector (#1234)
Selector makes more sense and allows to not introduce "instance element"
term.
2023-03-14 00:29:45 +03:00
Bogdan Chadkin bb7b7f73ab Improve instance selection (#1233)
"Click" based implemention had aa few important bugs. Selecting other
instance was not possible when some text was selected in editing mode.
This is consequence of a fix when other instance is selected user select
text and move cursor outside of editor while still selecting.

Here's how all solved. We track both mousedown and mouseup. When their
targets are different we do nothing because this is most likely text
selection or drag'n'drop.

Editing state a little simplified by just looing for closest
contenteditable instead of editing id comparison.

Instance address now computed by traversing dom.
2023-03-13 23:40:19 +03:00
Bogdan Chadkin 91fbdb2ee1 Address selected instance with tree path (#1228)
With slots there can be same ids in one tree so we need new way to
address instances. Here I propose the list from target instance to the
root.

Now instead of computing parents by normalized tree (one instance of
slot can have many parents) we just access already computed list from
rendered tree.

This address can be computed when user click in dom which can be
traversed or it can be passed top-down with props.

The main con of this approach is collaboration. Reparanted instances on
by one user makes "selected address" stale. Though we have similar
situation with single id when instance is deleted.

Isolated mode for slots/components will make this problem less
noticable.
2023-03-13 18:42:54 +03:00
Bogdan Chadkin 25d30967aa Create page on client (#1232)
Newly created instance does not propagate to client because we no longer
reload on navigating to new page.

Here moved page and root instance creation to client with patches.
2023-03-13 18:42:26 +03:00
Andras Bacsai c9cb63eaa3 Add lostpixel to builder (#1230)
## 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-03-13 15:16:42 +01:00
Roman Pominov 47d35ace8f Update Select and Textarea (#1207)
## Description

- Closes #1155
- Closes #1153 
- Closes #1150

1. Added "Nested Icon Label" component:
https://select-textarea--638245578b47d4399fba191a.chromatic.com/?path=/story/library-nested-icon-label--demo
2. Added "Select Button" component:
https://select-textarea--638245578b47d4399fba191a.chromatic.com/?path=/story/library-select-button--demo
3. "Select Button" is now used as Trigger in Select
4. Updated "Text Area":
https://select-textarea--638245578b47d4399fba191a.chromatic.com/?path=/story/library-text-area--demo
2023-03-13 10:22:34 +03:00
Ivan Starkov 01d66bb015 Hide background layers (#1229)
## Description

ref #877

Allows hiding background layers in edit mode, i.e. eye button now works

<img width="242" alt="image"
src="https://user-images.githubusercontent.com/5077042/224558080-6fd5fa13-4e4b-424f-81ec-26456ba7e363.png">

One of the assumptions I made was that `var` is used only in edit mode
https://github.com/webstudio-is/webstudio-builder/blob/7ae3ed003e4d7f7fc99038ccdde57b5fa634bbe1/packages/css-engine/src/core/to-value.ts#L41



## Steps for reproduction

Add backgrounds, hide/unhide them

## 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-03-12 20:44:15 +04:00
Ivan Starkov 7ab6cc52fd Fix color picker (#1227)
## Description

Select non transparent color if default color was transparent

## 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-03-12 12:29:32 +04:00
Bogdan Chadkin cd2032eddb Migrate all left updates to normalized instances (#1226)
Ref https://github.com/webstudio-is/webstudio-builder/issues/696

Here the last pieces to get rid of hacky patchInstancesMutable utility.
Now will be easier to integrate slots.
2023-03-11 19:23:31 +03:00
Ivan Starkov d3fe478953 Backgrounds, part 2 (#1201)
## Description

Backgrounds part 2. ref #877

- [x] - remove repeat section under gradient part
- [x] - info Icon for gradient "code"

The floating panel, gradients support.

<img width="508" alt="image"
src="https://user-images.githubusercontent.com/5077042/224417159-22a27ffd-6460-4d97-8891-f14a9a3331a3.png">

No drag, no hide, no smart insert



## 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-03-11 19:36:48 +04:00
Bogdan Chadkin 78f7882ddb Switch pages on client side (#1225)
Switching between pages takes very long time though all data already
loaded. Here I added validation to not reload builder data when page is
changed and render canvas with static id which is not really used for
anything so iframe no longer reloads.

Switching pages now instant.
2023-03-11 13:57:55 +03:00
Oleg Isonen 0c9e96d2e3 Login redesign (#1222)
## Description

Login redesign

<img width="430" alt="Screenshot 2023-03-10 at 19 41 51"
src="https://user-images.githubusercontent.com/52824/224399146-74ee67f4-db60-4c1e-9582-f39f84498e8a.png">
<img width="1371" alt="Screenshot 2023-03-10 at 19 42 01"
src="https://user-images.githubusercontent.com/52824/224399154-3e7db67a-0149-4b86-8f12-9661395ae1b9.png">



## Steps for reproduction

1. go to /login


## 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-03-10 23:04:09 +01:00
Bogdan Chadkin 40b2000d2e Sync initial client store from builder to canvas (#1224)
Before we send initial data from canvas which broke preview mode. Now
builder is leader and fully maintain synchronization.
2023-03-11 00:03:18 +03:00
Bogdan Chadkin 9a7b61a491 Validate pages on client (#1221)
We are moving pages logic to client side to support collaboration and do
less work on server. Here migrated validation to client side. Server
validation will be removed with endpoints in following PR.
2023-03-10 18:52:18 +03:00
Oleg Isonen 73f5f99dc2 Use remix link for link block (#1217)
## Description

Link block wasn't using remix link


## 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-03-10 13:17:19 +01:00
Bogdan Chadkin e888ddd4cd Export instances tree lookup from project-build (#1219)
This utility is needed to filter loaded data per page on published
sites. We aleady have it in builder so easy to move.
2023-03-10 13:30:03 +03:00
Bogdan Chadkin 2757da21d6 Migrate storybook to vite (#1209)
Webpack builder is very slow and hard to use becaause of it. It gave us
a lot of issues recently.

So here I migrated to vite builder. The experience is great. It caught a
bug in shallow-equal package, though fixed in latest release.

There was one issue with reload. When modify packages and rebuild
storybook watcher detects a lot of changes and goes into infinite loop.
Solved by importing packages sources directly with export conditions
vite allows to configure. Now any changes in packages can be reflected
in builder storybook without manual reload, restart and additional
watching.

We would get much better experience with remix if they allow to
configure this.

Also had to remove @storybook/addon-interactions which are incompatible
with vite builder.
2023-03-10 12:51:38 +03:00
Ivan Starkov be4fcc3ce2 Update npm versions (#1216)
## 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-03-09 23:49:18 +04:00
Oleg Isonen 276b19a30d Keep the label from old instance (#1215)
Fixes https://github.com/webstudio-is/webstudio-builder/issues/1214

## Description

We ended up removing instance labels when sorting instances, is there
more situations like this?

## Steps for reproduction

1. name instance
2. sort it in navigator or on canvas

## Code Review

- [ ] hi @TrySound , 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-03-09 20:47:19 +01:00
Bogdan Chadkin d6811f8dbd Drop storybook testing (#1212)
All these packages are not compatible with vite builder and we use them
only to test 2 inputs. Much easier to remove them now and add when
storybook fix issues.

```diff
du -ck node_modules
-818692
+775208
```
2023-03-09 21:56:50 +03:00
Oleg Isonen e6c5217e7a Reverting the decision to make nicer looking link targets (#1211)
User should know the underlying platform

this has also resulted in the need to have target wrapped in all links
components

<img width="265" alt="Screenshot 2023-03-09 at 14 19 50"
src="https://user-images.githubusercontent.com/52824/224035667-b0cc296c-3ed0-4c4c-b86b-205aa4a8adba.png">


## Steps for reproduction

1. create link
2. select target prop

## 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-03-09 19:54:09 +01:00
Roman Pominov 4d6921d0bd Allow to delete width/height on Image (#1210)
## Description

Fix for the bug reported in
https://discord.com/channels/955905230107738152/1083358357743742998

Can't delete a value in width field:
- Add image component
- Set width
- try removing width - it won't be saved

## Code Review

- [ ] hi @kof, 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-03-09 16:14:31 +03:00
Oleg Isonen 22082a250a Fix text highlighing (#1204)
## Description

Closes https://github.com/webstudio-is/webstudio-builder/issues/1193

When user is selecting text inside content editable and mouse goes up on
a different instance - we don't want to select a different instance
because that would cancel the text selection.

## Steps for reproduction

1. enter text editing
2. select text and let mouse go up on a different instance outside of
the current
3. see text now stays highlighted, before it would select a different
instance

## Code Review

- [ ] hi @TrySound , 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-03-09 12:34:52 +01:00
Ivan Starkov 22a2f11e0d Update versions (#1205)
## 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-03-09 09:36:55 +04:00
Oleg Isonen ca33d421a2 Instance name bugs (#1200)
## Description

1. Don't set the label when id didn't change
2. workaround stale defaultValue in TextField

## Steps for reproduction

1. change instance name
2. select a different instance (see previous instance name is still in
the text field)
3. select an different instance or different tab - instance name from
previous instance went into a the currently selected instance

4. expect xyz

## Code Review

- [ ] hi @TrySound , 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-03-08 22:10:22 +01:00
Bogdan Chadkin 57c39c4a52 Paste markdown as normalized instances (#1195)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Refactored markdown parser to produce normalized instances and added
multiple roots support for insert utility.

Note: can be reviewed with hidden spaces
2023-03-08 23:06:04 +03:00
Ivan Starkov 17d2bb84bd Fix ts error (#1199)
## Description

I don't know why it started to detect this error. But here we are.

## 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-03-08 22:28:40 +04:00
Ivan Starkov 1abd12a069 ts satisfies keyword support for storybook (#1197)
## Description

Storybook don't understand ts satisfies. Until we move onto new
storybook this adds that support

## 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-03-08 20:11:39 +04:00
Ivan StarkovandOleg Isonen bac386467c Background section redesign part 1.1 (#1149)
## Description

ref #877
As in this comment part 1
https://github.com/webstudio-is/webstudio-builder/issues/877#issuecomment-1441897685

<img width="647" alt="image"
src="https://user-images.githubusercontent.com/5077042/223226959-3e9b1832-07aa-425b-afcf-27f7cdafa85c.png">

You can add/remove layers. View/Hide not working. No drag.

## Steps for reproduction

Create new project. (existing could not work well because of migration)
Create background layers. Add images. Set various background layers
params.

## 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-03-08 19:29:53 +04:00
Ivan Starkov db3b42ae7d Fix css on production You don't have access to this project (#1194)
## Description

The issue it's the production bug only. In all other cases, session was
used (same domain on canvas and on builder).

closes #1159

## 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-03-08 13:49:54 +04:00
Ivan Starkov d50b0cace5 Fix collapse on size change (#1192)
## Description

closes #1183 

## Steps for reproduction

1. click button
2. expect xyz

## 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
- [ ] 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
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-03-08 13:49:32 +04:00