604 Commits
Author SHA1 Message Date
Ivan Starkov d41b52abda Release 0.89.0 (#2200)
## 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-08-27 21:42:04 +03:00
2680ae0a13 Add tooltips for component properties in Settings tab (#2125)
## Description

1. What is this PR about (link the issue and add a short description)

**Important** The PR adds tooltips only for HTML attributes.

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

## Steps for reproduction

1. Add a few components to the canvas
3. Select one
4. Go to the Settings tab in the right sidebar
5. Hover over the labels

HTML attributes should show a tooltip with a description

## Code Review

- [ ] @taylornowotny please review the descriptions in the
props-descriptions.ts file
   - test it on preview
- [ ] @istarkov check the first commit that is where the implementation
and integration are done. The idea behind this is that we have a central
file with HTML attributes descriptions and when generating components
props we pick the descriptions from there if the property doesn't have a
custom description. Essentially we use props-descriptions as a fallback.
Do we need tests for this feature?
  

## Before requesting a review

- [ ] made a self-review

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

---------

Co-authored-by: Giuseppe Gurgone <ggurgone@users.noreply.github.com>
Co-authored-by: istarkov <istarkov@gmail.com>
2023-08-27 20:46:36 +03:00
Bogdan Chadkin cc0336e50d Drag on canvas closest detachable (#2197)
Before when start dragging we searched for closest rich editor under
cursor and did nothing when the instance is not detachable (for example
select value or switch indicator).

Here I changed the behavior to also look for closest detachable instance
and drag whole thing. This way we do not need toast like in navigator
and can canvas dnd just work.

Also fixed placeholder in "Select Value" component. Before was no way to
change it.
2023-08-27 21:28:33 +04:00
Bogdan Chadkin abc7acbc55 Reimplement instance selection with pointer events (#2199)
Here improved instance selection by using pointerdown and pointerup.
This solves issues with libraries like radix preventing firing mouse
events.

Though there is a problem. Pointer events do not support event.detail to
inform about double clicks. So here I implemented multiple clicks
detection. For this I track time between latest pointerup and next
pointerdown events.
2023-08-27 21:00:25 +04:00
Ivan Starkov 7fd01f7d07 NPM Release 0.88.0 (#2194)
## 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-08-27 11:01:48 +03:00
Bogdan Chadkin c48f6613a8 Fix focus navigation in preview (#2179)
Ref https://github.com/webstudio-is/webstudio-builder/issues/2151
https://github.com/webstudio-is/webstudio-builder/pull/2112

Here splitted webstudio component wrapper for preview and canvas. This
allows us to have more granular control over preview behavior. For
example canvas requres all elements to be focusable for instance
selection to work. Prevew should be close to published sites and reflect
user experience.
2023-08-25 17:47:40 +04:00
Ivan Starkov ab436a6fc4 Fix new href property duplicated on unmount (#2170)
## Description

On onmount outdated onSave were used. What cause creation of additional
href property on instance.

- [x] - Fix duplication on unmount (1st commit)
- [x] - Fix save, to validate if multiple properties with same name
exists. (2nd commit)
- [x] - Use latest prop in resolveUrlProp (3rd commit)

Use hide whitespaces.

<img width="303" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/156fc5a4-c697-4b05-8caf-7a3b7fa29264">


## 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-08-25 10:36:14 +03:00
Ivan Starkov 52b01efa3b Fix parent style calculation for unstylable parent components (#2167)
## Description

If the parent component has `meta.stylable = false`, we need to skip it
to get the correct style of the parent.


## Steps for reproduction

Create the Box and add the Sheet to it. 
When you go to the sheet/trigger/button, you will notice that it does
not have a 'Flex Child' section or a 'zIndex' property.

To add these, add 'display: flex' to the box you created initially. When
you go back to the sheet/trigger/button, you will see that it now has a
'Flex Child' section and a 'zIndex' property.

## 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-08-25 00:10:41 +03:00
Oleg IsonenandwasimTQ 9336f05f25 Add help button with popover in dashboard and builder (#2166)
Originally started in
https://github.com/webstudio-is/webstudio-builder/pull/2132

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

## Description

Help dialog in builder and dashboard

## Steps for reproduction

1. open builder
2. open help dialog in the left sidebar
3. open dashboard
4. click help button

## Code Review

- [ ] hi @istarkov , 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

---------

Co-authored-by: wasimTQ <wasimthoufiq21@gmail.com>
2023-08-24 22:44:38 +02:00
Bogdan Chadkin 75c5cdc179 Prevent editing of radix input and textarea in canvas mode (#2160)
Ref https://github.com/webstudio-is/webstudio-builder/issues/2151

Here added new logic to intercept bubbled to html element events

- handle click on links in preview
- prevent forms submit
- prevent keydown on input and textarea in canvas

This allows to remove some props overrides from webstudio component and
fixes editing of radix input and textarea.
2023-08-25 00:25:16 +04:00
Bogdan Chadkin 1bb154eebd Fix instance labels in settings and style panel tooltips (#2164)
- fixed instance name placeholder in settings
(https://discord.com/channels/955905230107738152/1143832643373371432)
- fixed instance name in style tooltips

Can be tested on radix components
2023-08-23 19:15:10 +04:00
Oleg Isonen 2f0ea2602a Move position section in style panel right after size section (#2163)
## Description

it was originally moved below because it was "unstyled" and took too
much space


## Steps for reproduction

1. open style panel
2. see position after 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-08-23 14:49:56 +02:00
Ivan Starkov d096f91f0f Speedup remix dev 40x on my machine (#2157)
## Description

This speedups my remix dev rebuilds from 42s to 1s
The issue was that chokidar watched my whole fs and seems like something
on my machine makes it very slow.

Also enabled `v2_dev: true,` doesn't affect perf, just to be modern


## 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-08-22 00:58:55 +03:00
Bogdan Chadkin 23c1ff5e74 Schedule canvas rect updates and fix drag&drop (#2152)
Here changed canvas rect subscription to read always in effect to not
get stale state.
This fixes the issue with drag'n'drop when switch to another breakpoint.
2023-08-21 16:10:52 +04:00
Bogdan Chadkin 6b5cd33033 Subscribe selected instance for component hooks (#2150)
Here subscribed selected instance selector store instead of navigator
events. Now selection from canvas trigger hooks as well. Necessary to
support navigation menu component.
2023-08-20 21:56:26 +04:00
Bogdan Chadkin 5e900ff2e8 Add component tokens support (#2147)
Ref https://github.com/webstudio-is/webstudio-builder/issues/2137

Here added static tokens support to meta. Id of resulting style source
become persistent like this "componentName:tokenName". Such token styles
are inserted only if style source with same id not exist. This way we
prevent breaking styles already changed by user.

Style source input now autocomplete global tokens and suggest to create
predefined component tokens.

Also disabled spell check in style source input.

<img width="244" alt="Screenshot 2023-08-20 at 17 18 37"
src="https://github.com/webstudio-is/webstudio-builder/assets/5635476/9572f5b1-6243-49fa-83be-a0315f104987">
2023-08-20 18:48:16 +04:00
Bogdan Chadkin 036b156c6b Fix prop labels (#2144)
- https://github.com/webstudio-is/webstudio-builder/issues/2104
- https://github.com/webstudio-is/webstudio-builder/issues/2047
- https://github.com/webstudio-is/webstudio-builder/issues/2131
- https://github.com/webstudio-is/webstudio-builder/issues/2129

Improved switch control layout and made all inputs change to vertical
layout when label is more than 8 chars.
2023-08-20 12:57:00 +04:00
Ivan Starkov f659565d96 Add project templates (#2138)
## Description

closes #2134

<img width="1400" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/c868898a-e3ae-4b81-bbac-8a7c3b55e98d">

On card click

<img width="631" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/897c9863-1a66-4bf5-93d0-bcff147823e6">





Also fixed resize

<img width="953" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/f890668c-c022-47ec-9745-fc5dc9433264">

Made it

<img width="1204" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/5d2bc6cf-9495-4657-a1d1-e0f8c15516e5">



## 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-08-20 11:40:11 +03:00
Oleg Isonen 84fd2c1116 Add inline-flex display option (#2141)
## Description

This adds inline-flex display option as requested here
https://github.com/webstudio-is/webstudio/discussions/50

The use case is having a button with icon and text, without turning it
into block element with full width.

## Steps for reproduction

1. select any element and set display: flex


## Code Review

- [ ] hi @istarkov , 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-08-19 14:56:14 +02:00
Bogdan Chadkin e665a996ee Fix code text component (#2120)
Fixes
https://discord.com/channels/955905230107738152/1140570603372413039
https://discord.com/channels/955905230107738152/1140566358023745587

- dropped inline prop
- dropped meta prop
- replaced css custom property with local style
- added `white-space: pre-wrap` preset style to preserve indent
- fixed pasting of code in markdown
2023-08-14 22:05:14 +04:00
Bogdan Chadkin 3d04415630 Sort assets (#2121)
Ref https://github.com/webstudio-is/webstudio-builder/pull/2115

- sort uploading assets first
- sort newest uploaded first
2023-08-14 16:26:37 +04:00
Bogdan Chadkin 8bfdf3174f Release 0.87.1 (#2114) 2023-08-13 23:15:41 +04:00
Ivan Starkov f9ce6a1ac9 Release 0.87.0 (#2110) 2023-08-13 22:34:12 +04:00
Ivan Starkov ff8682d1d1 Fix hidden elements not selected sometimes (#2109)
## Description

https://discord.com/channels/955905230107738152/1140198766364860416

## 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-08-13 16:31:33 +03:00
Bogdan Chadkin f240c46027 Infer label from component name (#2106)
Here made meta.label optional to simplify adding new stuff. Most of the
time label is just a "humanized" version of component name. With radix
there is an additional action to strip namespace. But still would be
less repetition if the name is just inferred.
2023-08-13 13:12:51 +04:00
Ivan Starkov 7a8fd3db49 Radix Button (#2097)
## Description

Add radix button.


<img width="555" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/afd07b25-2592-4ed6-9788-dd880be2f22e">


## 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-08-12 15:30:00 +03:00
Bogdan Chadkin a737e03c8f Automatically open tab content on select in navigator (#2073)
Here added tabs hooks to auto select tab when its content is selected.
Added new utils to hook context getPropValue and indexesWithinAncestors.

Renamed instanceSelection to instancePath.

Had to pass all props in edit mode in webstudio component



https://github.com/webstudio-is/webstudio-builder/assets/5635476/1f1211bc-0ea4-4d21-9205-1439668e08b4
2023-08-10 22:02:25 +04:00
Bogdan Chadkin 9157f98eb7 Bump ui libs (#2086)
Mostly patches and unrelated feature releases

- fontsource
- react-aria
- floating-ui
- radix colors
- react types
- type-fest
2023-08-10 21:55:08 +04:00
Ivan Starkov f8c97c2e2d release 0.86.0 (#2090)
## Description

release 0.86.0

## 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-08-10 18:49:02 +03:00
Ivan Starkov 377889f5fb Fix pointer events (#2089)
## Description

Fix bug with drag component etc

implemented disableCanvasPointerEvents as disposable resource. 
That makes it much easier to control order of execution (disable first
then enable), be sure that counter is always >=0,
and easier control about enable/disable events allowing to dispose only
if resource was created.



## 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-08-10 18:31:01 +03:00
Bogdan Chadkin 0679c9eef8 Improve props bypassing in canvas (#2088)
Here fixing the issue with props not bypassed from parent component in
canvas mode. This is important for radix triggers with asChild which
bypass props to child button.
2023-08-10 18:57:59 +04:00
Ivan Starkov 7af70bdf50 0.85.0 (#2084)
## 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-08-09 23:43:21 +03:00
Ivan Starkov 034709c44d release-0.84.0 (#2082)
## Description

npm packages update


## 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-08-09 22:48:34 +03:00
Ivan Starkov 81b60abbb9 Fix if mouse leaves Tooltip.Content and moves over an iframe, the Radix Tooltip stays open (#2076)
## Description

When the mouse leaves Tooltip.Content and moves over an iframe, the
Radix Tooltip stays open.
This happens because Radix's internal grace area relies on the
pointermove event, which isn't triggered over iframes.
The current workaround is to set pointer-events: none on the canvas when
the tooltip is open.

Here are:
- [x] Tooltip component sets `--canvas-pointer-events` on the
documentElement if any tooltip is open
- [x] Iframe uses `--canvas-pointer-events`
- [x] `isCanvasPointerEventsEnabledStore` in order to use above css
variable
- [x] Color picker hack fully removed. Now just intercepts `open` state
change, as it's dialog and canvas is not interactive when it's open
already so it's safe to disable pointer-events too.


## 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-08-09 22:29:30 +03:00
Bogdan Chadkin 7f53be7b2d Add list item section to style panel (#2077)
Fix https://github.com/webstudio-is/webstudio-builder/pull/2063
https://github.com/webstudio-is/webstudio-builder/issues/2079
https://github.com/webstudio-is/webstudio-builder/issues/2060

Here added new "List Item" section specifically for List and ListItem
components. Now user can cutomize list item markers for whole list or
per each item.

Changed behavior of Select Control to put current value into the list of
options if not present. This way display shows "List Item" instead of
nothing.
2023-08-09 22:58:50 +04:00
Ivan Starkov 260ca1e9a5 Synchronisations fixes (#2070)
## Description

- Fixes sync bugs
https://discord.com/channels/955905230107738152/1138073603036954664
- There is no sense to retry `fatal` errors, we can stop sync.
- Fatal errors state, show fatal error message.
- If user cancel confirmation goto fatal state too, as sync will never
be fixed.
- Intercept error if project is loaded during synchronisation.
- Errors logged, as during investigation there were no way to get why
`patch` requests are in failed state.
- rest.patch are now wrapped with try/catch so we can distinguish api
errors.
- toasts added too (and made infinite in case of fatal errors)
- exponential backoff + jitter added
- improved connectivity messages


Use for review:

<img width="328" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/c9bff25b-4e50-44ed-b4b9-1d3460c13ee1">


### Todo,
- [ ] - test well.

## 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-08-09 19:57:40 +03:00
Ivan Starkov 42dcbbc3bc Add automatic https to url (#2078)
## Description

Add https to url 
https://discord.com/channels/955905230107738152/1138821247791284244

https://discord.com/channels/955905230107738152/1137045793069600888

## 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-08-09 19:23:14 +03:00
Ivan Starkov c37f99c490 Fix-breakpoints (#2065)
## Description


- [x] - Fixes that {mix|max}Width was used instead of label at
Breakpoints edit

- [x] - Fixes that form parts wasn't exists partially on useEffect
unmount already, and wrong comment that `Should never be not successful
because the html validator should catch it` - as it was not successfull
;-) having mount/unmount cases before.


## Steps for reproduction

Open breakpoints dialog
See now labels used 
<img width="307" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/ee4a64fa-caa4-43e0-b058-8008a472574f">

Click Edit, see same

<img width="482" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/bbf38d79-0776-4e0c-92e7-2ef267674d30">

Try edit, see everything saved and changed

2. expect xy

## 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-08-09 17:13:24 +03:00
Bogdan Chadkin fdf22ab9e6 Add component hooks (#2069)
We want to control some builder behavior specific to some components.
For example set open state on dialog, collapsible etc when select in
navigator.

Here I added hooks to be called from builder and executed in canvas. For
now added 2 hooks onNavigatorSelect and onNavigatorDeselect.
2023-08-08 16:38:53 +04:00
Ivan Starkov da7e17b2fe Fix button duplicate text on edit (#2066)
## Description

Double click on button cause text duplication

https://discord.com/channels/955905230107738152/1138065267549818880



## 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-08-08 01:12:50 +03:00
Ivan Starkov 7d635c4940 Fix Toolbar dissapears in the tooltip (#2061)
## Description

Fixes 3

https://discord.com/channels/955905230107738152/1137452246876033114

Toolbar selection is not working inside tooltip content text.

## Steps for reproduction

Open tooltip, start editing tooltip content text. Select some text with
mouse. Mouse is now visible

## 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-08-06 19:00:24 +03:00
Bogdan Chadkin 8c6b5cff82 Bump to remix 1.19.2 (#2062)
Ref https://github.com/remix-run/remix/releases/tag/remix%401.19.2

Here fixed a few vulnerabilities by upgrading proxy-agent dependency.
2023-08-06 19:46:19 +04:00
Ivan Starkov 3df5c96a9c Fix jumps on editing text inside tooltips, and probably other components (#2054)
## Description


![image](https://github.com/webstudio-is/webstudio-builder/assets/5077042/dc764c12-8612-4ea4-9a07-46384a8ed5a7)

https://discord.com/channels/955905230107738152/1137452246876033114

## 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-08-06 14:09:57 +03:00
Bogdan Chadkin 107a2c0ce5 Bump to storybook 7.2 (#2059)
- https://github.com/storybookjs/storybook/releases/tag/v7.2.0
- https://storybook.js.org/blog/july-2023-update/
2023-08-06 14:20:05 +04:00
Ivan Starkov f5ffdd643f Fix toolbar positioning on scale (#2042)
## Description

fixes Toolbar positioning if canvas has zoomed
https://discord.com/channels/955905230107738152/1137141681007886388

## 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-08-05 21:19:09 +03:00
Ivan Starkov 1b4b2db376 Partially fix tooltip trigger editing (#2041)
## Description

https://discord.com/channels/955905230107738152/1137094092417941695

<img width="180" alt="image"
src="https://cdn.discordapp.com/attachments/1137094092417941695/1137094092640231454/Screen_Recording_2023-08-04_at_21.43.44.gif">

Fixes positioning. But still have tooltip content blink, seems like
tooltip doesn't like changing trigger on the fly.

Blinking will not be fixed until we change how editor works

I created a simple reproducible example changing the trigger using
setInterval and get same behaviour as we have

![Screen Recording 2023-08-05 at 10 00
02](https://github.com/webstudio-is/webstudio-builder/assets/5077042/67655855-4b61-41a3-9ea4-c4664c0ebf38)





## 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-08-05 21:10:24 +03:00
Bogdan Chadkin d88939b477 Fix breadcrumbs labels (#2038)
Ref
https://discord.com/channels/955905230107738152/1137068758511394929/1137068758511394929

Full component name was used instead of meta or instance labels.
Also removed unnecessary instance labels.
2023-08-05 11:39:12 +04:00
Ivan Starkov 0a169f3819 Add more label spacing for boolean props (#2037)
## Description

Fixes
https://discord.com/channels/955905230107738152/1136931915044237402

<img width="260" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/7b427f37-1e88-4516-baef-66803886f771">

## 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-08-04 21:36:29 +03:00
Ivan Starkov 4f10bc26f8 Attempt to hover/select without element (#2014)
## Description

Removes `div style="display:contents"` arount Radix etc Components.

Below in Implementation is written why SelectedInstanceConnector was
moved into standalone root level hook.
In short
- [x] - No issues with visually hidden components.
- [x] - Allows us to not use refs for the builder support. (Now our
components can be without refs)
- [ ] - cc @TrySound ContentEditable could also use
getAllElementsBoundingBox from domUtils to get element ref this will
allow to remove useRef from WebstudioDevComponent

Changes from previous behavior:

- Now on preview elements are not selected (now is like in webflow).
- On changing marign etc we do not hide outline as before



## Implementation: 

having `instanceSelector` we can 
- Find all elements with attribute `data-ws-selector` which ends with
`instanceSelector`
- Then find "root/parent" elements of found elements. _(We can find few
subtrees)_
- Then use that elements instead of wrapper element.

This works fine with tree hovering and selections.
This allows us to not use `refs` inside our WebstudioDevComponent at
all.

### Below is why SelectedInstanceConnector was rewritten

The issue arises when such element is duplicated by radix into
VisuallyHidden element.

There is no way to detect now inside `WebstudioComponentDev` does
current Component is inside VisuallyHidden
(We have no reference element to detect that.)

So current approach makes any additional changes useless.
I'm going to close this. And leave just for example




## 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-08-04 13:34:14 +03:00
Bogdan Chadkin bcc4556f26 Bump fonts (#2036)
Ref https://github.com/fontsource/fontsource/blob/main/CHANGELOG.md#50x

The new major version moved variable fonts into separate packages
2023-08-04 12:57:49 +04:00