Commit Graph
5319 Commits
Author SHA1 Message Date
Bogdan Chadkin 611174a044 experimental: migrate size section to style object model (#4073)
Ref https://github.com/webstudio-is/webstudio/issues/1536
https://github.com/webstudio-is/webstudio/issues/3399

Most changes is object position switching to new style engine.

<img width="559" alt="Screenshot 2024-09-05 at 15 58 13"
src="https://github.com/user-attachments/assets/2ada00a8-37f1-40e1-a001-425753221198">
2024-09-05 16:25:38 +02:00
Bogdan Chadkin e381a70580 experimental: migrate style section to style object model (#4065)
Ref https://github.com/webstudio-is/webstudio/issues/1536
https://github.com/webstudio-is/webstudio/issues/3399

Power style section and its colorful dots with new style engine.

Can be tested

- size section
- background section
- transforms section
- advanced section
2024-09-05 01:12:32 +02:00
Bogdan Chadkin ca62a9837e experimental: migrate gap controls to style object model (#4067)
Ref https://github.com/webstudio-is/webstudio/issues/1536
https://github.com/webstudio-is/webstudio/issues/3399

Refactored flex gap with new style engine.
Synchronize linking both ways not only row=column.
2024-09-05 01:05:54 +02:00
Ivan Starkov 766d7eb95f chore: Add CSRF protection to prevent Canvas script execution vulnerability (#4047)
## Description

how it works
https://github.com/webstudio-is/webstudio-saas/issues/317#issuecomment-2317121292

- attack example
https://p-845e975a-4e84-4186-b312-431f3a6f99ea-dot-main.development.webstudio.is/
- attack fixed
https://p-845e975a-4e84-4186-b312-431f3a6f99ea-dot-csrf.staging.webstudio.is/

corresponding PR #4060 (Add postMessage token to secure against Canvas
script execution)

Additionally

csp on iframe (see comments)
destination checks - to prevent including loaders/pages into iframes

<img width="1015" alt="image"
src="https://github.com/user-attachments/assets/2d8c6840-e195-424e-942f-8b8d05203e18">


## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-09-04 17:08:08 +03:00
Bogdan Chadkin 5d15ad78bf experimental: migrate toggle group to style object model (#4063)
Ref https://github.com/webstudio-is/webstudio/issues/1536
https://github.com/webstudio-is/webstudio/issues/3399

Switched to new style engine for toggle group controls. Those are tricky
caz have property tooltip internally.

Improved tooltip to not show reset button and source when highlight not
selected toggle button.

Can be tested
- background "repeat"
- flex child "sizing"
- flex child "order"
- size "overflow"
2024-09-04 14:01:16 +02:00
Oleg Isonen 74420860cb chore: add unused ref to fix the warning (#4062)
## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-09-04 13:14:34 +02:00
Ivan Starkov 87bfd994be chore: Add postMessage token to secure against Canvas script execution (#4060)
## Description


https://github.com/webstudio-is/webstudio-saas/issues/317#issuecomment-2317121292

See postMessage

Doesn't work as can be intercepted using `addEventListener`.

## Steps for reproduction

In chrome dev console in window and canvas context 

```js
globalThis.postMessage = (...args) => console.log(...args); // no messages
```

```js
globalThis.postMessage({
    "action": {
        "type": "sendStoreData",
        "payload": {
            "source": "builder",
            "data": [
                {
                    "namespace": "hoveredInstanceSelector",
                    "value": [
                        "w2emY6HYI160BmYG9WA6C",
                        "_BKGofOEhOFV_zLiN0iZk"
                    ]
                }
            ]
        }
    },
    "token": "development-token-2"
}, '*'); // Error in console "Invalid token"
```

```js
window["__webstudio__$__api_token"] // is undefined
```


```js
window.addEventListener(
    "message",
    e=>console.log({...e.data}), {capture: true}); // token prop is undefined
```

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-09-04 14:07:56 +03:00
Jaya Krishna Namburu 8de31b3737 feat: allow deleting style layers even when in hidden state (#4059)
fixes #3797 

## Description

Allow layers to be deleted even when the layers are in hidden state.
This change should reflect for all the following layer based properties.

- transforms
- translate
- filter
- backdrop-filter
- box-shadow
- text-shadow
- backgrounds


## Steps for reproduction
- Add a layer to any of the following layer based proeprties.
- Hide a layer in the list
- Now, delete the layer that is hidden

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


## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
2024-09-04 12:35:58 +02:00
Jaya Krishna Namburu 29a76c3ed4 feat: Add support for css-transforms in style panel (#4057) 2024-09-04 05:21:57 +05:30
a0407f3e1f fix: Default form control values (#4045)
## Description

- always use defaultValue and defaultChecked props when passing to react
- expose value and checked as props, remove default*
- reorder initial props to make more sense (name, value, checked - in
this order)

Affected components:

Forms:
- checkbox
- radio
- input
- select
- textarea

Radix:
- checkbox
- radio group
- select
- switch

## Steps for reproduction

1. test each component named above how bound and unbound value/checked
works
2. use in regular form and bind to url params
3. use in webhook form 

## Code Review

- [ ] hi @john, I need you to do
  - 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file

---------

Co-authored-by: Ivan Starkov <istarkov@gmail.com>
Co-authored-by: Bogdan Chadkin <opensource@trysound.io>
2024-09-04 00:15:43 +02:00
Bogdan Chadkin ea50da67ac feat: show generated css in property label (#4058)
Here improved property label to show css declaration with computed
(used) value.

<img width="381" alt="image"
src="https://github.com/user-attachments/assets/b299939b-c421-4571-b365-c7c8140f2a64">
2024-09-03 22:47:05 +02:00
Jaya Krishna Namburu 99851a40d6 feat: Add tooltips for individual properties in style panels by the descriptions generated by ai (#3964)
## Description

This PR adds tooltips for all the layer based sections in the transform
property. The rest of the properties already have their tooltips managed
by the `PropertyName` component. I have taken our previous tooltips as
based and used a AI suggested one and proof read those. So, please let
me know if there are any suggestions to change.

## Steps for reproduction

- verify tooltips for `translate`, `scale`, `rotate` and `skew`,
`box-shadow`, `text-shadow`, `drop-shadow` properties.

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

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
2024-09-03 21:23:57 +05:30
Ivan Starkov cfe018a3e8 fix: CLI, CORS does not allow synchronization in certain scenarios (#4056)
## Description

**✅🔍 Review per commit!!! ✅🔍**

We missed this bug because our CLI has two different sync methods:

  1. Sync by buildId - This one works fine.
  2. Sync by projectId - broken

This PR contains:
1. Fix
2. Fixture with sync by projectId  

## Steps for reproduction

1. click button
4. 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-09-03 12:06:19 +03:00
Bogdan Chadkin ae1e72051c build: publish 0.175.0 (#4054) 2024-09-02 22:55:05 +02:00
Ivan Starkov 4225acb909 chore: Add dasboard preconnect (#4052)
## Description

Test preconnect

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-09-02 22:32:50 +03:00
Ivan Starkov 56985b70b3 chore: Add prefetch dns, add loading indicator to dashboard (#4051)
## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-09-02 21:37:19 +03:00
Oleg Isonen 2ab94fd9f4 feat: Hide the label of the instance when mouse is not hovering it (#4046)
## Description

When instance is selected the label often gets in the way of seeing the
element behind the label, we think its better to only show the label
when user is hovering the instance

## Steps for reproduction

1. hover instance - old behavior
2. selected instance with mouse hover - old behavior
3. selected instance  without mouse over - no label

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-09-02 17:28:59 +02:00
Ivan Starkov f46abe2f04 fix: Support new project links in the cli (#4049)
## Description

closes #4048

## Steps for reproduction

see fixtures
We are still supporting `BUILDER_URL_DEPRECATED` (in a single fixture)
and all other fixtures uses modern link format


## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-09-02 16:59:06 +03:00
Ivan Starkovandjohnsicili c3b130e6a4 chore: Add SEO support (#4043)
## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file

---------

Co-authored-by: johnsicili <john@createtoday.io>
2024-09-01 19:28:33 +03:00
Ivan Starkov aa0f35222c fix: Sitemap resource loading issue (#4042)
## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-31 19:47:01 +03:00
Oleg Isonen b4342020a8 fix: fix old share link support (#4041)
## Description

Regression with old share link urls

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-31 17:54:00 +02:00
Bogdan Chadkin ac26e8f7f7 experimental: migrate text control to style object model (#4036)
Ref https://github.com/webstudio-is/webstudio/issues/1536
https://github.com/webstudio-is/webstudio/issues/3399

Straightforward switch in all cases.
Size section can be tested.
2024-08-31 17:11:20 +02:00
Oleg Isonen bdab4f67df chore: fix types generator in time component (#4038)
## Description

Last PR broke the generator because if there are multiple types exported
it starts getting a different namespace

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-31 14:11:15 +02:00
Ivan Starkov d3d19e77fd chore: Add gitclean and gitrebase to devcontainer (#4027)
## Description

Can't leave without this commands

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-31 08:28:14 +03:00
Bogdan Chadkin 769b193f8d experimental: migrate color control to style object model (#4031)
Ref https://github.com/webstudio-is/webstudio/issues/1536
https://github.com/webstudio-is/webstudio/issues/3399

Simplified color control and reimplemented border color and shadow color
as separate controls based on new color picker.

Relaxed "advanced" state in border color, so text field only visually
look disabled but still accessible.

Test color, border color, border bottom color and box shadow color.
2024-08-31 01:00:48 +02:00
Ivan Starkov 678825c92f chore: Unreveal remix, use fully default setup (#4035)
## Description

Unreveal remix, use fully default setup

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-30 23:04:09 +03:00
Ivan Starkov 3c1479c732 chore: Protect session cookies (#4034)
## Description

Cookie Overwriting in Canvas:
Scripts running inside the canvas can add any cookie client-side. There
is no way on the server to distinguish whether a cookie was created on
the server or client-side. A bad actor can even write a signed cookie by
copying it from their own session, making it difficult to identify the
source of the cookie.

To protect against cookie overwrites, we set a null session cookie if a
user is using an authToken.
This ensures that any existing HttpOnly, secure session cookies cannot
be overwritten by client-side scripts
See Storage model
https://datatracker.ietf.org/doc/html/rfc6265#section-5.3
If the cookie store contains a cookie with the same name,
domain, and path as the newly created cookie:
...
If the newly created cookie was received from a "non-HTTP"
 API and the old-cookie's http-only-flag is set, abort these
 steps and ignore the newly created cookie entirely.

_same domain and path are enforced by `__Host-` prefix__

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-30 21:59:31 +03:00
Ivan Starkov a25f2d7e93 fix: Chrome tab restore (#4033)
## Description

Chrome aggressively uses cache when restoring tabs (e.g., using
Shift+Command+T or automatic session restore).
This behavior can cause issues with loading a builder application due to
the following cycle:

1. The builder checks if the session needs to be renewed (a navigation
is detected) and redirects to `/auth/ws`.
2. Chrome retrieves the `/auth/ws` response from the cache, followed by
all OAuth redirect responses from the cache.
3. The last cached response redirects back to the builder's root (`/`).
Chrome detects this as a redirect cycle
and reloads the most recent OAuth step, resulting in an "expected state"
error.
4. To prevent this issue, the only solution is to add a `no-store`
directive to all redirect responses.


## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-30 19:33:40 +03:00
Bogdan Chadkin bb1a5d52eb refactor: improve color picker (#4029)
Color control can be a thin wrapper around color picker

- fixed "inherit" keyword support
- moved intermediate value into color picker
- merge highlight and change low level events
2024-08-30 16:48:28 +02:00
Oleg Isonenandjohnsicili 34157d4f21 feat: Support multiple types of timestamps in the Time Component (#4028)
## Description

Date can be in various forms, lets support them all:

1698377386 - A valid 10-digit Unix timestamp (October 26, 2023).
2147483647 - The maximum 32-bit signed integer timestamp (January 19,
2038).
1698377386000 - A valid 13-digit Unix timestamp (October 26, 2023).
9999999999999 - A far future date (November 20, 2286).
2024.10

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file

---------

Co-authored-by: johnsicili <john@createtoday.io>
2024-08-30 15:29:06 +02:00
Bogdan Chadkin 32ba0d6344 refactor: rename position control to inset control (#4030)
We have two position controls which drive me crazy when I try to work
with any of them. `inset` is a shorthand for top/right/bottom/left so
should be a more straightforward name rather than "position" which we
use for background-position and object-position in another control
already.
2024-08-30 14:32:48 +02:00
Ivan Starkov 816ff5ef9c fix: Show page titles (#4026)
## Description

Page titles were lost

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-29 14:33:51 +03:00
Bogdan Chadkin 6d5f18c87d refactor: migrate select control to style object model (#4025)
Ref https://github.com/webstudio-is/webstudio/issues/1536
https://github.com/webstudio-is/webstudio/issues/3399

No visual or functional changes, just changed the source of computed
value.
2024-08-29 13:07:20 +02:00
Oleg Isonen 4a42c3b111 feat: add download property to link component (#4024)
Closes https://github.com/webstudio-is/webstudio/issues/957
Closes https://github.com/webstudio-is/webstudio/issues/4018

## Description

Added a download property instead of magically doing that with
attachment

<img width="242" alt="image"
src="https://github.com/user-attachments/assets/9608e84d-6870-4a1b-9b19-6be52d382d07">


## Steps for reproduction

1. add a link
3. see download switch
4. when on, should download whatever is in the link

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-29 12:56:42 +02:00
Ivan Starkov f7487fd1bc chore: New Builder Auth (#4010)
## Description

### Full track


https://github.com/webstudio-is/webstudio-saas/issues/317#issuecomment-2289241819

So thoughts about session

https://github.com/webstudio-is/webstudio-saas/issues/317#issuecomment-2314515772

Some explanations what is fixed and how

https://github.com/webstudio-is/webstudio-saas/issues/317#issue-2465048823

Next PR:
- [x] - Old share links auto redirect
- [x] - Try make better error message having that current PR will logout
all users.

## Steps for reproduction

1. Login using `google login` or `dev login` try to open projects on
dahsboard, create new, clone delete etc.
2. Try to open projects on dahboard, see each is on it's own domain and
work
3. Try to open project link (without share token) with other user -
should fail.
4. Try publish/clone any links and operations.
5. Share project from `userA`:
 - try to open it with other `userB`
   - see `userB` is not logged in to that project
- try to get using fetch from console anything about `userB` or `userA`
i.e rest etc endpoints on apps.webstudio.is domain
 - try to open incognito, check it works.
6. Open few project, then logout from dashboard, reload project page
 - See login page
 - Try to login as same uer - see it works
 - Or try to login as another user - see auth error


## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-29 12:38:39 +03:00
Jaya Krishna Namburu 48e1967a38 fix: show rotate and skew in the transform property dropdow listn (#4022)
## Description

Show `rotate` and `skew` next to the transform list dropdown values.
When applied it should show just the transform in the layer list.

<img width="497" alt="Screenshot 2024-08-28 at 9 24 03 PM"
src="https://github.com/user-attachments/assets/3dd4bc45-f5a2-46a9-b0fa-91e6ee1646b8">
<img width="492" alt="Screenshot 2024-08-28 at 9 23 53 PM"
src="https://github.com/user-attachments/assets/68078d59-9d92-419a-8585-f54540d0d36f">


## Steps for reproduction
- Add a transform layer list.
- Now, click on the layer to edit the layer and search for transform.
- The dropdown list should show `rotate` and `skew` next to the dropdown
list.
- When added it should show `Transform` alone in the label.


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

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
2024-08-29 05:40:06 +02:00
Bogdan Chadkin c3cd25a868 refactor: switch menu and toggle controls to style object model (#4023)
Here migrated menu control and toggle control from style panel
to new style engine and improve UX a bit.

Instead of disabling button, it gets "disabled" style and tooltip with
warning. Though user still can use control to override advanced value in
place.

<img width="298" alt="Screenshot 2024-08-28 at 18 37 09"
src="https://github.com/user-attachments/assets/c1c083aa-5e6e-4dfe-b136-b18eb8d54383">

<img width="261" alt="image"
src="https://github.com/user-attachments/assets/7bf8a7cb-d344-4c4d-8bfb-79813b39526d">
2024-08-28 20:08:41 +02:00
Oleg Isonen 98cb2ef576 fix: hide outline when ephemeral update is in progress (#4011)
Ref https://github.com/webstudio-is/webstudio/issues/3914
Closes https://github.com/webstudio-is/webstudio/issues/3800

## Description
This allows to see borders/outlines when changing ephimeral styles e.g.
scrubbing border-outline width or color

This is not 100% fixing the problem, as you still can't see the
border/outline when you change non ephimeral value, but there is not
much we can actually do, because outline has to be blue for clarity,
making it look like the user color, would be potentially very confusing.

## Steps for reproduction

1. change any ephimeral styles like padding drag/drop or scrub any input
2. see outline is hidden during that change

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-28 16:48:53 +02:00
Bogdan Chadkin f67e2e3778 refactor: decouple style updates from react (#4021)
Removed setProperty, deleteProperty and createBatchUpdates from react
hook. All parameters can be accessed from global stores.


Note: review with hidden spaces.
2024-08-28 16:43:25 +02:00
Bogdan Chadkin 1643fcde54 refactor: migrate to property section label (#4017)
Ref https://github.com/webstudio-is/webstudio/issues/3914

New property label is used for section titles.

<img width="359" alt="Screenshot 2024-08-27 at 21 18 25"
src="https://github.com/user-attachments/assets/681cf4d8-c124-45e0-9a9b-6914d12cc838">
2024-08-28 12:12:30 +02:00
Jaya Krishna Namburu 615cbd8084 feat: Show the properties that are already applied on the node at the top of the transition property list. (#3992)
fixes #3982  #3977 

## Description

This PR aims to improve the experience for selecting
`transition-property` values while selecting from the dropdown.
And now, we show the `Rotate` and `Skew` next to the `Transform` layer
name to exactly show what properties are being effected when something
is applied on transform.

<img width="243" alt="Screenshot 2024-08-22 at 8 18 29 PM"
src="https://github.com/user-attachments/assets/6931c0bb-c180-4e7a-b5ba-710e84e3240f">

And the properties on the node are show at the top under the `Defined`
sections.
<img width="243" alt="Screenshot 2024-08-22 at 8 19 17 PM"
src="https://github.com/user-attachments/assets/6a63d9f3-bfdd-4af9-a03e-e912ab2d9b10">


## Steps for reproduction
- Add a transition layer and set the property to transform. 
- This will show the layer name as `Transform (Rotate, Skew)`
- Change the node to multiple breakpoints and it should change the
defined properties list items.
- When there are no properties set on the node, the `Derived` section
should not show on the list items.
- Should be able to select the item from dropdown using the arrow keys
when in focus.
- Select the list item using the mouse.

## Code Review

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

## Before requesting a review

- [x] made a self-review
- [x] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
2024-08-28 10:23:51 +02:00
Oleg Isonen 58c15dea36 chore: always use error, not e (#4016)
## Description

This has always been our convention, I have a feeling our linter used to
check this. Now its also important so that AI doesn't give you wrong
suggestions.

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-27 18:13:20 +02:00
Bogdan Chadkin eed6f10e88 refactor: add property inline label for complex controls (#4015)
Here replaced NonResettablePropertyName with PropertyInlineLabel. It no
longer requires to drill currentStyle. Switched to it in transitions and
backgrounds.

<img width="353" alt="Screenshot 2024-08-27 at 11 15 22"
src="https://github.com/user-attachments/assets/8396f5af-49ca-4711-b035-bd84032798a8">

Also fixed background labels truncating
<img width="288" alt="Screenshot 2024-08-27 at 02 11 25"
src="https://github.com/user-attachments/assets/135cdc7f-07fa-4f7d-9f5b-cf456e66cdfc">
<img width="295" alt="Screenshot 2024-08-27 at 02 11 32"
src="https://github.com/user-attachments/assets/7c018f2e-6d8f-4abe-8e1c-997108399ba3">
2024-08-27 15:01:15 +02:00
Ivan Starkov 829e11c410 chore: Add deployments cleanup workflow (#4014)
## Description

Tired of deployment messages

https://github.com/orgs/community/discussions/36919

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-27 08:32:14 +03:00
Bogdan Chadkin 33299c4b6e refactor: switch to new property labels for basic properties (#4013)
Ref https://github.com/webstudio-is/webstudio/issues/1536
https://github.com/webstudio-is/webstudio/issues/3399

Here switched all basic properties to new property label. Section labels
and advanced properties are left for another PRs.

Removed unnecessary scroll inside tooltip (always looked ugly).

<img width="335" alt="Screenshot 2024-08-26 at 22 09 18"
src="https://github.com/user-attachments/assets/ef2d7b47-c627-4165-a996-f376b40e1b8c">
2024-08-26 22:58:21 +02:00
Bogdan Chadkin c1b76b5083 experimental: generate property tooltip from style object model (#4012)
Ref https://github.com/webstudio-is/webstudio/issues/1536
https://github.com/webstudio-is/webstudio/issues/3399

Here added more information about property value source like breakpoint,
instance, style source and state to style object model.

Now this info can be used in property label (simpler version of property
name).

Migrated color, font weight and font family properties to new labels.

<img width="350" alt="Screenshot 2024-08-26 at 17 41 23"
src="https://github.com/user-attachments/assets/0d643647-7472-44cf-96f7-c7da2307d067">
2024-08-26 20:16:17 +02:00
Bogdan Chadkin 9ec235e993 experimental: provide style value source in computed style (#4009)
Ref https://github.com/webstudio-is/webstudio/issues/1536
https://github.com/webstudio-is/webstudio/issues/3399

Here added "source" property to computed style decl. It represents a
color of property labels.
Improved selected state and style source logic.
2024-08-26 12:03:46 +02:00
Bogdan Chadkin d7efd7f314 refactor: remove legacy build format from project build (#4008)
Migrated ai to compact format and moved conversion to build endpoint for
cli (will be migrated later).
2024-08-24 20:50:47 +02:00
Ivan Starkov 45e748f248 chore: Remove index hack, move canvas layout outside for readability (#4006)
## Description

iframe now points to `/canvas` route
$ (splat) route has no UI, and now does only technical part.
_index route will be builder route on builder urls i.e.
`{ProjectId}.apps.webstudio.is` (next PR)

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-08-24 14:54:43 +03:00
Bogdan Chadkin 8460cefac6 refactor: remove and verify domain by id (#3971)
Here exposed domain id and used it for remove and verify operations to
avoid additional roundtrips to db.
2024-08-24 11:39:05 +02:00