Commit Graph
5224 Commits
Author SHA1 Message Date
Ivan Starkov 0c23cf580a Fix toggle group focus interfere, show error in storybook (#1923)
## Description

Error:

- [x] - <img width="112" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/ea3d781d-2f8b-403a-847f-8b01b3675f8e">
- [x] - fixed toggle group button size was 26px must be 24px
- [x] - also made outline offset -2px 


## 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-12 22:50:33 +03:00
Ivan Starkov 5e072c7242 Position section (#1879)
## Description

ref #1858

Position section without "relative to element" (will do in next PR):

<img width="258" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/5184b5df-dc95-4b4b-b93b-00b4a63ac20b">

Changed label fonts on fonts from design. IMO non monospaced fonts for
numeric dynamic labels is disaster.
Here on 3-4 symbols difference in font length could be serious amouunt
pf pixels like '5'

Made label margins like in design 2px instead of 1. 

Simlified label logic to use css only solution.

Having that a lot of code is shared with spacing secion some bugs can be
in both

Next PR:
<img width="270" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/a7c0c842-eaf9-477e-9267-b9b29e087f41">


## Steps for reproduction

Goto spacing and position section, play with params.

## 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-12 00:29:14 +03:00
Oleg IsonenandIvan Starkov 84c06569b9 Condense settings and properties tabs into one (#1902)
Closes #1880
Mostly also #1905

## Description

Merging Settings and properties


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

---------

Co-authored-by: Ivan Starkov <istarkov@gmail.com>
2023-07-11 22:50:26 +02:00
Bogdan Chadkin 05df3910f5 Support effectful expressions in component actions (#1914)
Here added support for callbacks or event handlers on components which
basically can do only assignment to variables for now with extended
(with assignment operator) syntax of expressions.
2023-07-11 20:27:06 +03:00
Bogdan Chadkin a8ecaf3a99 Migrate storybook to new format in sdk (#1924)
Here bumped storybook and migrated stories to Meta and StoryObj types
from deprecated ComponentMeta and ComponentStory.
2023-07-11 20:15:38 +03:00
Oleg Isonen 432ab19456 Update README.md (#1922)
fixes
https://github.com/webstudio-is/webstudio-builder/issues/1917#issuecomment-1628827257

## 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-10 21:46:36 +02:00
Bogdan Chadkin b5a1b794e2 Fix text toolbar overflow (#1919)
This fixes an issue with text toolbar below top navigation because of
wrong middlewares order. Here used the right order and bumped/deduped
floating-ui.
2023-07-10 20:59:41 +03:00
Bogdan Chadkin db31e37751 Extend tsconfig from package in remix apps (#1920)
Closes https://github.com/webstudio-is/webstudio-builder/issues/121

Looks like since upgrade to remix 1.18 tsconfig is not longer updated
and we finally can access reusable config by package name.
2023-07-10 20:28:21 +03:00
Ivan Starkov 652b52cd50 StyleInfo unification (#1918)
## Description

Use same code to get StyleInformation by instanceId as was used for
selectedInstanceId.

Works  right only for the ancestors of selected element


## 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-10 19:38:23 +03:00
Bogdan Chadkin 8b1034c375 Use s3 rest api instead of library (#1515)
Here replaced s3-client library with rest api to upload and delete
files.
Though to simplify generating of Authorization header reused their
signature-v4 package.
Even for such small utility aws adds 11 dependencies. But overall 94 ->
11 is a good result, pnpm will be a little faster, vercel cold start
smaller.

```diff
du -ckd1 node_modules
- 686952
+ 672964
```

Btw figured all edge cases with the help of ChatGPT. It's not always
correct but together with human can produce working code.
2023-07-10 17:04:10 +03:00
Bogdan Chadkin 518cced7db Upgrade to remix 18 (#1876)
Enabled v2_headers and increased size limit

- https://github.com/remix-run/remix/releases/tag/remix%401.18.0
- https://github.com/remix-run/remix/releases/tag/remix%401.17.0
- https://github.com/remix-run/remix/releases/tag/remix%401.16.0
2023-07-10 15:26:13 +03:00
Bogdan Chadkin 6440b79369 Refactor sync server with async iterators (#1913)
Here the logic is following. We iterate over transactions polling and
every set of transactions retry until request is complete.

The code becomes more straightforward and solves
https://github.com/webstudio-is/webstudio-builder/pull/1812 for free
because nothing is scheduled until requests are complete and
transactions are queued in array.
2023-07-10 12:35:48 +03:00
Ivan Starkov 09e81f08ca Fix numeric scrub in case of body is scrollable (#1916)
## Description

Affects storybook env, in the buider we don't have scorllable body so
cursor doesn't cause body to overflow

## 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-09 23:40:15 +03:00
Bogdan Chadkin 3cdb2dbbc4 Support effectful expressions (#1908)
Here added two new utilities for generation and executing individual
expressions. Such expressions can use assignment operator to change any
variable.

This give us less opinionated solution for "set" action. We can just
execute any code our parser supports.
2023-07-08 12:15:40 +03:00
Bogdan Chadkin b5d65d4bfa Show badges on inherited styles (#1911)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1895

<img width="249" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5635476/a5feb845-ecdc-4c81-aa97-059bf0e12ad8">
2023-07-08 11:26:20 +03:00
Oleg Isonen c1243d6df7 Disable spellcheck (#1907)
## Description

Textarea/inputs in the builder don't need spellcheck

## Steps for reproduction

1. open props panel
2. type something in any text inputs

## 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-07 09:31:38 +02:00
Oleg Isonen cda2c05020 Roboto font fallback for arial (#1898)
## Description

Closes #1884 

## Steps for reproduction

1. use Arial on any element
2. check in dev tools if roboto is a fallback

## 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-05 14:17:15 +02:00
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