169 Commits
Author SHA1 Message Date
Ivan Starkov daf932837c Update npm (#1311)
## 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-28 16:08:38 +04:00
Bogdan Chadkin 3edd4ea3cc Optimize canvas loading (#1310)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1044
https://github.com/webstudio-is/webstudio-builder/issues/360

Canvas no longer need to load any data. No longer need pages. No longer
need auth token. No longer need static css.

Here I cleaned all unnecessary logic to load canvas. It may load much
faster now.
2023-03-28 19:02:02 +07:00
Bogdan Chadkin 68af3b58b6 Fix possible cyclic slot and hide its styles and props panels (#1306)
One cyclic case I missed. When paste slot into itself as target then
check miss unresolved fragment inside. Here added additional check
before copying and covered with tests.

For slots show only settings panel.
2023-03-28 18:46:18 +07:00
Ivan Starkov 83e2c01dc5 Border style (#1307)
## Description

ref #1169 

BorderStyle now is toggle group

<img width="225" alt="image"
src="https://user-images.githubusercontent.com/5077042/228191674-83d8dd64-490a-4a15-8307-c64ae425d74f.png">

## Steps for reproduction

Open borders, set

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

- [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
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-03-28 15:29:08 +04:00
Oleg Isonen e87eeaa006 Support minWidth and maxWith in media queries, both are optional (#1305)
## Description

This is in preparation for supporting webflow breakpoints which use a
combination of min and max width
## 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-28 11:42:55 +02:00
Roman Pominov 3279d6fc78 Props panel: basic URL control (#1280)
If this looks good, I will not merge it right away, but open a PR in
`webstudio-saas`

## Description

- #993 

1. Added a new type of Prop `{type: "page"}`, similar to `{type:
"asset"}`
2. Added `pagesStore` to `ReactSdkContext` (will need to make changes to
`webstudio-saas` as well to support this)
3. Added a new control type `{control: "url"}` and corresponding
`<UrlControl>`
4. Updated Link components: 
   - set `{control: "url"}` for the `href` prop
   - made them support `{type: "page"}` as `href`
   - simplified / cleaned up

## Steps for reproduction

1. Add a link
2. Set a page as `href` in props panel
3. Try clicking on the link in preview mode
2023-03-28 11:05:32 +03:00
Ivan Starkov 524882fd0e Update versions (#1303)
## Description

npm version changes

## 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-27 22:31:09 +04:00
Oleg Isonen e67aa302fc Fix object position layout (#1302)
## Description

Object position doesn't fit the grid layout like other elements have in
size section


## 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-27 20:29:45 +02:00
Ivan Starkov 6f03fc06b2 Fix border-color (#1300)
## Description

ref #1169 

Fixes bug that only borderTopColor changed 

Was:
<img width="230" alt="image"
src="https://user-images.githubusercontent.com/5077042/228027729-5c6496ea-2f45-4346-9d95-152f9283dda8.png">

Now:
<img width="233" alt="image"
src="https://user-images.githubusercontent.com/5077042/228028039-c376a5a4-4651-4a58-b2ad-62179c5a92eb.png">


## Steps for reproduction

Change borderStyle then change borderColor see all border colors has
changed

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

- [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
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-03-27 22:15:24 +04:00
Bogdan Chadkin 12814190d7 Implement slots (#1294)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1116

Slot is copy pastable part of the tree which is always in sync. Kinda
like primitive components.

The idea is the following. Slot is copy pasted as any other instance
though its children are preserved as is without cloning with new ids.

This lead to the problem with multiple slot children. While copy paste
they are preserved as is though when add new child to slot, the other
instance of it will not get new child.

To workaround this we add another Fragment component which groups all
children into single one and new children are always reflected in all
slot copies.
2023-03-28 00:48:02 +07:00
Bogdan Chadkin 6854ea950a Upgrade remix (#1299)
Small releases

https://github.com/remix-run/remix/releases/tag/remix%401.13.0
https://github.com/remix-run/remix/releases/tag/remix%401.14.0
2023-03-28 00:38:18 +07:00
Ivan Starkov e5e22e6f6d Background title section (#1279)
## Description

ref #877 

- [x] - Use + in the title instead of "Add background" button
- [x] - Label colors should be moved somewhere outside of Layer items
- [x] - Fix theme.spacing, do not use px values



## Steps for reproduction

Open backgrounds play with it.

## Code Review

- [ ] hi @rpominov , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)

- [ ] hi @kof I want you
  - 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
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-03-27 15:08:28 +04:00
Bogdan Chadkin 9b6511f4e2 Migrate style computing to instance selectors (#1291)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1116

This is the last one slots blocker for sure.

Refactored inherited styles to compute from selectors and got rid of
legacy traverser utility.
2023-03-27 17:45:27 +07:00
Bogdan Chadkin 1d9407fde7 Compute bounding box by children when display: contents (#1296)
Slots have display: contents to not affect layout. So we need a way to
show correct hover and selected state. Here's added utility to traverse
all descendants and get their rects and then compute the sum of those
rects.
2023-03-27 17:40:42 +07:00
Bogdan Chadkin 7ec230462b Upgrade esbuild (#1297)
- got rid of unused esbuild-node-externals package
- removed esbuild override/resolution to old version
- deduplicateed webpack 4 and 5 into single 4 instance
- upgraded esbuild to the latest version with "context" api instead of
incremental flag which potentially forces to fix the issue with remix
once they upgrade

Esbuild bump fixed the issue with remix going infinite watch loop after
any changes in packages and looks like esbuild in remix no longer blocks
parallel turbo run!!!
2023-03-27 14:36:57 +07:00
Bogdan Chadkin f53c839fe6 Allow to hide any item in the tree (#1293)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1116

We need this to hide Fragment instance in navigator which is an implicit
child of slot with persistent id.
2023-03-26 18:44:29 +07:00
Bogdan Chadkin 407955c6c0 Cancel tree drag (#1292)
Drag end is called conditionally and I forgot to handle cancel event.
2023-03-26 18:44:15 +07:00
Oleg Isonen b22dfe038e Components Panel (#1284)
## Description

Implements all design changes and accessibility for components add panel



https://user-images.githubusercontent.com/52824/227720011-344b31f8-ce17-4d13-ad4d-2d506ca3bcce.mp4



## 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-26 13:36:05 +02:00
Bogdan Chadkin 919d560396 Delete pages with stores (#1289)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1084

Now whole pages management is managed by immerhin patches. Got rid of
pages/$projectId endpoint and no longer used form utils.
2023-03-25 18:56:24 +07:00
Bogdan Chadkin 3592df7bba Migrate text editing to selector (#1287)
The last piece to address instances by selectors

- the mode is represented as text editing instance selector
- reset editing mode along with selection on user input instead of
ssubscribing to selected store
- moved enter/esc shortcuts to shared between builder and canvas
- got rid of legacy subscriptions to stores
2023-03-25 11:35:29 +07:00
Bogdan Chadkin 92342a22a4 Update pages with store (#1288)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1084
https://github.com/webstudio-is/webstudio-builder/issues/1286

Currently only create page patches propagate to canvas. Here migrated
update to immerhin too.
2023-03-25 11:35:15 +07:00
Bogdan Chadkin cd0e01ea56 Select span node with selector (#1285)
Here bit less straightfforward as lexical<>instances conversion is not
very straightfforward because lexical represents a few instances with
its formats.

To solve conversion complexity used almost same ancestor traverser as
before but finish once eiditing node is reached.

Pass instance selector for each webstudio-component ot identify selected
and editing instances.
2023-03-24 23:06:31 +07:00
Bogdan Chadkin bac73301c8 Refactor insert and reparent operations with selectors (#1283)
- in many places root check can be replaced with selector.length === 1
- reparent and insert utilities now accept selectors
- findClosestDroppableTarget output end instead of last index and always
fallback to root
2023-03-24 14:56:30 +07:00
Bogdan Chadkin cb020a7a06 Provide drag origin for canvas and side panel (#1282)
I broke in one of recent PRs drag origin. Here put it back to support
hiding components panel to show preview.
2023-03-24 00:12:10 +07:00
Oleg Isonen 5fb2d6f74d Replace card component (#1281)
## Description

1. Replaces card component in the add component panel

This doesn't add all design changes yet

## 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-23 17:02:12 +01:00
Bogdan Chadkin f1750dde04 Refactor canvas drag and drop to rely on instance selectors (#1278)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1116

Drag payload produce 2 kinds of actions insert and reparent and output
tree compatible drop target.
2023-03-23 16:35:55 +07:00
Bogdan Chadkin 863ca74688 Replace tree preview with navigator tree (#1239)
Ref https://github.com/webstudio-is/webstudio-builder/issues/248

Tree preview requires a lot of work to support with all data changes
2023-03-23 10:24:08 +07:00
Bogdan Chadkin 70b9e7e5cf Preview navigator drop target while dragging canvas (#1276)
Ref https://github.com/webstudio-is/webstudio-builder/issues/248

We need to get rid of legacy preview to move forward with slots. Here
exposed drag item and drop target from tree component. Now we can
connect canvas and navigator.

Note: navigator changes are not yet reflected in canvas while dragging.
2023-03-22 19:36:28 +07:00
Roman Pominov b4a6a67ada Add SectionTitle; Add utility for focusing using arrow keys (#1249)
## Description

Closes #1100
Closes #1271

1. Added `SectionTitle`
https://section-title--638245578b47d4399fba191a.chromatic.com/?path=/story/library-section-title--demo
2. Added basic `ArrowFocus` utility
3. Used the new `SectionTitle` in `CollapsibleSection`, so props and
style panels now use the new `SectionTitle`
4. Made `CollapsibleSection` open by default as specified in #1100

## Steps for reproduction

1. Open style panel
2. Open props panel
3. Check storybook demos by the links above
2023-03-22 15:29:53 +03:00
Oleg Isonen 736e4c1659 Hide outline on mouse out (#1274)
## Description

1. If you mouse over and then mouse out directly to the side, without
hovering other instances, the instance outline gets stuck


## 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-22 13:28:09 +01:00
Bogdan Chadkin 24406491d1 Switch builder to separate placement indicator computing (#1269)
Ref https://github.com/webstudio-is/webstudio-builder/pull/1268

Now all builder UI rely on separate placement computing

- for background layers had to add default getValidChildren to exclude
placement indicator child
- fixed text selecting in safari while dragging with preventDefault on
move
2023-03-22 18:40:10 +07:00
Ivan Starkov 3f4ce56eb7 Borders - part 1 (#1272)
## Description

ref #1169

<img width="230" alt="image"
src="https://user-images.githubusercontent.com/5077042/226687676-eba0e113-844d-44e6-9afa-81dff5746e73.png">


Based on this comment
https://github.com/webstudio-is/webstudio-builder/issues/1169#issuecomment-1478260843
Border Style section is added. As no  section `+` button exists.

IconButton has changed to be in sync with design.
ToggleButten added.

To review start with borders.tsx


## Steps for reproduction

Open Borders section, change style, borders width, radius, individual
radius, individual borders

## Code Review
- [x] hi @rpominov , I need you to do
check that ToggleButton component and its stories are ok.


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

- [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-22 14:15:28 +04:00
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