3807 Commits
Author SHA1 Message Date
Ivan Starkov 4411d91c86 Update versions 0.79.0 (#1901)
## 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
0.79.0
2023-07-05 14:13:22 +03:00
Ivan Starkov 3587c03f32 Revert override browser default tag (#1900)
## 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-07-05 12:46:06 +03:00
Ivan Starkov 5cfedb69bd Change pending button icon loading size (#1869)
## Description

closes #1715

## 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-07-05 00:57:12 +03:00
Ivan Starkov 596aa50b9f Update version 0.78.0 (#1899)
## 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
0.78.0
2023-07-04 22:32:14 +03:00
Ivan Starkov 0374894638 Use node-fetch for trpc-interface to fix vercel/remix override (#1897)
## 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-07-04 11:16:38 +03:00
Ivan Starkov 5909fe5ba9 Upate version (#1896)
## Description

npm libs 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
0.77.0
2023-07-03 23:51:36 +03:00
Bogdan Chadkin 2a0900b4c4 Remove size-test from publish 2023-07-03 23:26:55 +03:00
Oleg IsonenandBogdan Chadkin 8f53eadf5b Override browser default tag based styles that use EM units (#1888)
## Description

EM seems to be challenging to use and people tend to use PX or REM
instead ... I changed those values that come with EM by default from
browsers to the values Webflow is using.


I am not sure why webflow is doing certain things: e.g. paragraphs have
marginTop 0, h1-3 have marginTop 20; marginBottom: 10, h4- have
marginTop 10 ; marginBottom 20

These seem to be inconsistent and weird choices.

---------

Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>
2023-07-03 23:13:37 +03:00
Bogdan Chadkin c5a5809501 Support generating expressions code (#1894)
Here added another expression utility to generate function body
generateExpressionsComputation.

InstanceRoot now requires computeExpressions(variables) prop which can
be generated build time.
2023-07-03 23:09:39 +03:00
Ivan Starkov 88c94b1d52 Add modern tooltips to space control (#1877)
## Description

Based on discussion, now space section tooltips are shown only on label
hovers


Supports alt/shift clicks
- [x] - During hover alt/shift works
- [x] - In case of multiple properties sources now group them
<img width="292" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/029b60a5-9a4e-4d85-ba2e-3db4fbbb344d">



## 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-07-03 22:45:24 +03:00
Ivan Starkov 4f7ad34cbf Release 0.76.0 (#1890)
## 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
0.76.0
2023-07-02 22:39:35 +03:00
Bogdan Chadkin 47ac7080da Migrate form to data sources (#1855)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1529

Instead of SuccessMessage and ErrorMessage components we can use Box
with bound state from form.

For now this is only boolean state which should be set on Form component
side. Soon we explore using expression as data sources to change only
enum value instead of booleans.

Changes in template
- ErrorMessage and SuccessMessage are replaced with Box with "show"
bound to expression
- ErrorMessage and SuccessMessage have text in own children
- the rest of Form content is wrapped with Box bound to expression
- Form got state prop bound to variable
- Form initialState prop is deleted

Migration just bind show props of all from direct children to data
sources. Without additional wrapping.
2023-07-02 22:17:23 +03:00
61f164d40e (feat): Ability to add box-shadow to nodes. (#1634)
## Description

This is a WIP PR, and will be adding more details about the feature and
the changes that are going in...

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi, 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: Bogdan Chadkin <trysound@yandex.ru>
Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-07-02 16:31:26 +02:00
Oleg Isonen da1e8eaef3 Scale blurriness fix (#1887)
## Description

Chrome on Windows has a bug and makes everything slightly blurry if
scale(1) is used together with translateX.
We have done a lot of comparisons between various fixes and they were
producing slightly different sharpness,
using scale 0.9999 with opacity 0.9999 works best.
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Edition    Windows 11 Home
Version    22H2
Installed on    ‎10/‎18/‎2022
OS build    22621.1848
Experience    Windows Feature Experience Pack 1000.22642.1000.0


## 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-07-02 16:20:46 +02:00
Oleg Isonen 66af42157f Sort properties alphabetically (#1886)
## Description

As recently reported, its easier to scan properties when they are sorted

## Steps for reproduction

1. open properties pane.
2. combobox showing properties list now will have them sorted
alphabetically

## 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-07-01 23:32:43 +02:00
Bogdan Chadkin 1d0967e927 Scope data sources to instances (#1885)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1529

Here embed template will add scope to always be shown only within
instance. Before we have data sources UI the only use case is deleting
data sources along with instances.

Also found jsep enable ternary by default and forbid for now caz there
is no generation implemented anyway.
2023-07-01 23:54:28 +03:00
Bogdan Chadkin d6aca6b55b Ignore complex props (#1810)
Ref https://github.com/webstudio-is/webstudio/discussions/37

There are props like object and function we cannot express with UI. Even
more there is style prop which if casted to string gives runtime error.
So the best way would be to ignore such types.
2023-07-01 23:49:02 +03:00
Oleg Isonen 529e10d333 More effects props (#1881)
## Description

Part of https://github.com/webstudio-is/webstudio-builder/issues/879

-  pointer events
-  Blend Mode
-  user select


## 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-07-01 20:01:35 +02:00
Bogdan Chadkin 114817c266 Support data source expressions (#1882)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1529

Here introduced two types of data sources into "variable" and
"expression". First stores the value, the second only executable code.

Execute expressions now output results of all expressions so we could
access values globally with "computed" store

Embed template references now allow to define both variable reference
and expression.
2023-06-30 22:22:12 +03:00
c95ca97d47 new color token foreground.inverse-primary (#1859)
Co-authored-by: Bot (build-figma-tokens.yml) <bot@localhost>
Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-06-30 00:49:35 +03:00
Oleg Isonen 42748f27b9 Move body font size and line height to normalize and also fix the values (#1867)
Closes https://github.com/webstudio-is/webstudio-builder/issues/1845

## Description

See issue

## 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-06-29 21:20:21 +02:00
Bogdan Chadkin 37aed7edfa Add expression utilities (#1874)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1529

Here added two utilities:

validateExpression to parse syntax and replace identifier. For parsing
used jsep package which is very limited subset of js.

executeExpression to execute the chain of expressions. The code is
unoptimized and will not cache results between calls. But still should
be fast enough because expressions are indented to be quite simple.
2023-06-29 14:21:10 +03:00
Bogdan Chadkin 06a311c877 Use native node fetch (#1875)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1191

- dropped undici (installed one)
- dropped isomorphic-fetch
- dropped node-fetch
2023-06-29 10:09:51 +03:00
Bogdan Chadkin 5be5abf8b3 Replace minimist with parseArgs (#1868)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1191
2023-06-28 23:22:33 +03:00
Ivan Starkov 227fecfcb3 Fix spacing issues (#1870)
## Description

Fixes following spacing issues:

- [x] - Show mutiple tooltips at once
<img width="399" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/001d3e32-f7ce-4a68-9f61-12604a45886e">


- [x] - Show tolltip if mouse leaved the control and no keyboard
interaction was made
<img width="273" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/7965bb1f-93e3-4c33-b4f6-d2031a0374e8">


- [x] - Infinite tooltip show/hide on hover
![Screen Recording 2023-06-28 at 15 48
33](https://github.com/webstudio-is/webstudio-builder/assets/5077042/19531e19-1c51-4427-8cb6-f1bb93899f3a)

- [x] - Shift selection now always works after mouse move, before after
control got focus shift wasn't worked at all.

- [x] - If mouse inside space area and keyboard nav started use next
element of mouse target

## Steps for reproduction

Focus control play with buttons, enters, esc, shift mouse move

## 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-06-28 20:55:52 +04:00
Andras Bacsai f849cc5b7c Rest endpoint to load by projectId (#1863)
## Description

1. What is this PR about (link the issue and add a short description)
Add REST endpoint to get the latest buildId based on projectId:
`/rest/buildId/<projectId>`

Should return buildId or null (which means the project is not published
yet).

It is required for the new CLI.

## Steps for reproduction

1. click button
3. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [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-06-28 13:05:16 +02:00
Ivan StarkovandOleg Isonen 7632b05fe7 Fix hash scroll (#1861)
## Description

closes #1824

- [x] single edgecase left if id is equal to `hello%20world` nothing
works
- [x] fix back button cause chrome bug
https://discord.com/channels/955905230107738152/1122839004375691355
- [x] allow edit form in preview mode to close issue above

Fix corresponding issue in RR
https://github.com/remix-run/react-router/pull/10642

At SaaS patched too

## Steps for reproduction

create links on pages with anchor
<img width="254" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/46a880f3-cdd0-4e19-8cb4-b608bdc4f96a">

Check it works

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

---------

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-06-28 10:06:54 +04:00
Ivan Starkov 1a21c4d3c3 Fix preview mode toggle and sync (#1865)
## Description

closes #1841

## 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-06-28 10:05:07 +04:00
Bogdan Chadkin 9976b7e975 Add property tooltip to icon controls (#1831)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1798

Here added property tooltip to toggle button controls and menu controls.
Tooltip is triggered only by hover because click on controls is
functional.

<img width="240" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5635476/f37cea37-08a7-4f6d-8ca2-e7592e34057b">
2023-06-27 20:41:16 +03:00
Bogdan Chadkin b8c18be051 Migrate to node v18 (#1857)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1191

Only removed stucturedClone polyfill for now
2023-06-27 18:17:48 +03:00
Oleg Isonen 603df8a22c Reset properties with option-click (#1866)
## Description

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

## Steps for reproduction

1. see issue

## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
- [ ] hi @taylornowotny  , I need you to do
  - QC


## 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-06-27 15:25:53 +02:00
Bogdan Chadkin e66e118ad5 Migrate to storybook 7 (#1862)
See https://storybook.js.org/docs/react/migration-guide and
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-65x-to-700

- all configs are now ts/esm
- had to add hack (process.env.NODE_ENV) to workaround storybook bug
- webpack is gone
- renamed storybook:run to storybook:dev
- amount of packages reduced from 2456 to 2060
2023-06-27 10:02:58 +03:00
Bogdan Chadkin 6deecd76f4 Fix deprecated storybook args (#1864)
These stories break on upgrade.

See
-
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-controloptions
-
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#no-longer-inferring-default-values-of-args
2023-06-26 20:36:23 +03:00
Ivan Starkov fb9cecb556 Fix props not saved (#1860)
## 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-06-26 10:25:28 +03:00
Bogdan Chadkin c5f84b7822 Run eslint from the root with cache (#1854)
While turborepo does not work for us we can try to solve long checks
time with builtin caching. Eslint provides similar one to prettier we
already use.

```
pnpm -r lint
51.53s

pnpm eslint . --ext .ts,.tsx --max-warnings 0
18.10s

pnpm eslint . --ext .ts,.tsx --max-warnings 0 --cache (with cache)
1.82s
```

In this PR I removed all lint scripts in packages and added global one
in the to github workflow. It saves like 30s on my laptop because pnpm.
Already stored cache makes linting almost instant.

Also bumped all eslint dependencies.
2023-06-26 10:08:15 +03:00
Ivan Starkov aec1ca7db8 Fix scrub lost unit on negative values (#1853)
## Description

closes #1846

## Steps for reproduction

Drag value scrub to make it eq to 0.
Stop drag.
See unit preserved

## 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-06-26 10:23:19 +04:00
Ivan Starkov cba00105db Sync pages change (#1856)
## Description

Changed pages synchronisation.

We had following path on link click in canvas:

- We intercept it in handleLinkClick and do publish('switchPage', {});
- We subscribe on 'switchPage' at builder and do navigate(builderPath, {
pageId});
- We subscribe on useSearchParams extract from there pageId and do
selectedPageIdStore.set(pageId)
- On Canvas we subscribe on selectedPageStore and finally render the
page

Now we just change
`selectedPageHashStore`, `selectedPageIdStore` in a single function
`switchPage`
`location.searchParams` used only for initial and popstate
synchronisation.


pageHashStore added for future use, no logic now.



## 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-06-26 10:22:13 +04:00
Bogdan Chadkin 4496b3a980 Bump all radix packages (#1852)
Seems like there is no changes in types. Need to test the app.
2023-06-25 19:13:20 +03:00
Bogdan Chadkin 07c6734f8c Support updating data source values (#1849)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1529

Added data source values store which can be updated from both components
and props panel.

```js
const { setState } = useContext(ReactSdkContext)
const instanceId = getInstanceIdFromComponentProps(props)

setState(instanceId, propName, value)
```
2023-06-25 12:05:02 +03:00
Bogdan Chadkin f8f2c91a35 Drop unused radix modules (#1851)
I'm gonna bump all radix packages. Doing a little cleanup before that.
2023-06-24 15:20:15 +03:00
Darin DimitroffandOleg Isonen d8f423eb97 Fix breakpoints selected item styling (#1840)
Added the proper `aria` attributes to two selectors to make sure the
intended design renders correctly for the selected item.


https://github.com/webstudio-is/webstudio-builder/assets/16368791/f6914be2-e5b5-49b5-bb5f-5425257b706b

Pinging @taylornowotny for a quick review.

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-06-23 21:18:13 +02:00
Ivan Starkov 5bae55124c Fix url hash (#1838)
## Description

closes #1828 

## Steps for reproduction

Create links to the page with section with spaces, see its escaped
properly

## 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-06-23 21:32:00 +03:00
Ivan Starkov ade16e5005 Allow input color without hex, also fx invalid (#1837)
## Description

closes #1829

## Steps for reproduction

paste non hex color from figma, see it works
enter something like `ereemc` see invalid state

## 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-06-23 12:56:18 +04:00
Ivan Starkov c59e657fbb Fix flex-child ordering (#1836)
## Description

closes #1833

## Steps for reproduction

Create Flex box, add 2 boxes
Change order on any box

## 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-06-23 12:55:50 +04:00
Ivan Starkov 0827fd3e6b Forms playground (#1823)
## Description

Closes #1806

Most changes in this PR is ability to test it locally with saas
described here
https://dev.to/istarkov/local-development-with-public-and-private-monorepos-3554

Documentation how to test saas is added to SaaS

`action` and `method` now available for adding
`hidden inputs` are now cleared by prefix from formData (to not send ws
inputs anywhere)

`action` and `method` are now read at server using `getFormProperties`


## Steps for reproduction

Create form, add action and method, see form has hidden inputs 

<img width="273" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/3f50dc14-9779-4da1-9bcf-730ad377c72f">


## Code Review

- [x] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
- [x] hi @TrySound , I need you to do
  - 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-06-23 10:38:06 +04:00
Bogdan Chadkin 730d897039 Support data source insert from template (#1826)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1529

- added data sources store
- added dataSource type to props
- insert data sources from template (prop.dataSourceReference allows to
bind several props to the same data source)
- convert to static prop on copying (simplification until requirements
are clear)
2023-06-21 19:57:42 +03:00
Oleg Isonen 381b5ae480 Error description typo (#1830)
## Description

Just typo in the error description, no functional change
2023-06-21 09:54:23 +02:00
Bogdan Chadkin 45c74fc7ec Add toggle group component (#1809)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1779
https://github.com/webstudio-is/webstudio-builder/issues/1779

- Here added new toggle group component aligned with figma.
- Replaced all legacy toggle group usages.
- Removed local/remote/overwritten colors from controls with labels.
- Prevented unselect of toggle group with single toggle
- Dropped unused toggle component from design system
2023-06-20 21:23:23 +03:00
Ivan Starkov 056170e1a8 Add background section tooltips (#1821)
## Description

closes #1786

Labels inside background section are not resetable and always have
default color.

<img width="615" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/18bb9490-106d-466b-a286-d633e029df76">

Info icon has gone from `Code` just custom description is now used

cc @taylornowotny 


## 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-06-20 20:51:15 +04:00
Bogdan Chadkin 36b98ef3f6 Add "show" system prop for conditional rendering (#1724)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1529

Here added system "show" prop which already works to not render
component but has lack of dynamic behavior based on some state.
2023-06-19 21:01:50 +03:00