4865 Commits
Author SHA1 Message Date
Bogdan Chadkin 5e39b06d6b experimental: support history in address bar (#3377)
Address bar need to fill every time user want to test the page. Here
added history suggestions which let users reuse peviously entered
params.

Had to implement own combobox-like behavior to support syggestions
universally on all inputs.

<img width="384" alt="Screenshot 2024-05-18 at 17 35 54"
src="https://github.com/webstudio-is/webstudio/assets/5635476/4f5add04-cfe9-4ba0-a824-821011bbdd81">
0.163.0
2024-05-18 23:22:03 +03:00
Bogdan Chadkin 2fd7c6d307 fix: strip backslashes from curl when paste (#3376)
Fixes https://github.com/webstudio-is/webstudio/issues/3375

The arguments parser we use missed a case with explicit backslashes and
I missed it in our tests. Here removed it with regex.
2024-05-18 17:49:09 +03:00
Jaya Krishna Namburu ef01841b6f feat: Add UI section for filters and backdrop-filters (#3348) 2024-05-18 07:12:38 +02:00
Oleg Isonen d54d053689 fix: fix zoom detector (#3372)
## Description

1. Zoom detector that warns user next to breakpoints selector had bugs

## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-18 00:37:17 +02:00
Bogdan Chadkin 95b651c36b feat: improve resource body (#3374)
Here's 2 major changes

- switched to native body validation without json auto-formatting while
editing
- automatially add Content-Type: application/json header when object is
set from binding expression

This refactoring opens room for more improvements.

<img width="478" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5635476/5559a6ab-7e08-4b47-b0a1-924818c006b4">
2024-05-17 20:55:32 +03:00
Bogdan Chadkin dc0236fafe experimental: save address bar on enter or close (#3373)
To keep in history only consistent paths and avoid overfetching
resources I changed address bar saving logic. Before each type in
address bar params triggered save. Now only "enter" while param is
focused or address bar popover is closed triggers saving.

Can be tested with new story.
2024-05-17 16:37:48 +03:00
Bogdan Chadkin 698584c664 refactor: switch variable name to native validation (#3371)
Here refactored name field with native validation
and accessed it with form data in on submit.
Basic zod validation will wllow to avoid issues with missings fields.

Note: review with hidden whitespaces

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
2024-05-17 12:54:02 +03:00
Bogdan Chadkin e87cc005bb experimental: add graphql resource control (#3368)
Here added new "GraphQL" option into variable "type" select. It allows
to switch to special resource subset with "query" and "variables" fields
instead of single json body.

<img width="571" alt="Screenshot 2024-05-16 at 17 54 27"
src="https://github.com/webstudio-is/webstudio/assets/5635476/db9ab321-18e9-4208-a46e-13bd7a88b6c7">
<img width="324" alt="Screenshot 2024-05-16 at 17 54 06"
src="https://github.com/webstudio-is/webstudio/assets/5635476/07b9f6d4-117c-4974-b31c-a581bfdf4668">
0.162.0
2024-05-16 20:57:03 +03:00
Ivan Starkov 0b48e9d314 feat: Add Time Component (#3369)
## Description

Mimics https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time 
The main difference as we use it to convert datetime field into Human
readable format

Play here:

https://time.development.webstudio.is/builder/dd5668ed-76c3-4c82-aacd-4fa21411d5ae

TODO:
- [ ] - We need to think about init text see image below

## Steps for reproduction

We need to think about init text

<img width="1320" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/b5236314-1184-4561-8ca9-22d7a7824fee">


<img width="271" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/4e5a338d-35ae-412a-817c-07643e918f6f">



## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-16 20:10:37 +03:00
Oleg Isonen ba1f582324 feat: Fullscreen preview when on base breakpoint (#3276)
Closes https://github.com/webstudio-is/webstudio/issues/2324

Explanation https://share.descript.com/view/8NayOadrxo8

Biggest problem it addresses is that users on base breakpoint want to
see the site in a full width without having to resize each time.

Additionally user doesn't want it to resize when switching between
preview and canvas on a custom selected size.

1. removed remaining hook wrappers from nanostores
2. moved the resize handles to the outside of the canvas and gave them
some space - fixes the problem with dragging to the edge and then not
being able to get them back because mouse grabs the browser itself
3. On base breakpoint and higher when there is no min-width breakpoint
and user switches to preview, we use the entire workspace, then going
back, we calculate based on base breakpoint start.
4. On all other breakpoints we keep the size user has chosen between the
preview and canvas, we don't reset it.

## Steps for reproduction

1. without min breakpoints on canvas
- on base, switch to preview, see maximum canvas size, switch back to
canvas, see base canvas width
  - on every breakpoint and in between see that it keeps the size
1. add min-width breakpoint, on base, switch to preview, see the same
size

## 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/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
2024-05-16 11:08:08 +02:00
Bogdan Chadkin 53ba464ed4 refactor: use native validation for resource headers (#3367)
Here switched resource headers to native validation. Now it finally
blocks closing variable popover and shows errors. Works even for
multiple headers with the same input.name.

Had to workaround InputField cases like ref -> inputRef and
event.currentTarget -> inputRef.current.

<img width="393" alt="Screenshot 2024-05-16 at 02 07 12"
src="https://github.com/webstudio-is/webstudio/assets/5635476/49d172ca-a87b-4b41-8fe8-a2d7b3079b59">
2024-05-16 10:57:30 +03:00
Bogdan Chadkin dae9952aa9 refactor: use native validation for resource url (#3366)
Here integrated native fields validation into our form utilities. It
will let us have more isolated validation complexity within each field.

The trick was to detect if any error are not shown. Solved by iterating
form.elements and checking its input.validity.valid and data-color=error
attribute.

<img width="417" alt="Screenshot 2024-05-16 at 01 08 37"
src="https://github.com/webstudio-is/webstudio/assets/5635476/ce112f00-aafd-4388-bb0b-a64baccaffac">
2024-05-16 02:01:32 +03:00
Bogdan Chadkin c57d75c911 refactor: align text area error with input field (#3365)
Here replaced state=invalid with color=error in textarea to align with
input field and fixed focused input with error style.

<img width="233" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5635476/bf649fec-cfdc-423f-a668-977d23aa1738">
2024-05-15 23:16:58 +03:00
Oleg Isonen bf7f0210ee feat: add email to the dashboard menu (#3364)
Closes https://github.com/webstudio-is/webstudio/issues/3277

## Description

As a user I want to be able to see what email my login is using

## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-15 21:26:16 +02:00
Bogdan Chadkin 1d0a8ed112 refactor: add object expression utilities (#3363)
Here added utilities to update expressions partially for example in
graphql json body we need to update separately query and variables
expressions but store as single body expression.
2024-05-15 20:13:44 +03:00
Oleg Isonen d81b727a02 feat: Warn user when they use browser zoom on canvas (#3362)
Fixes https://github.com/webstudio-is/webstudio/issues/3295

<img width="401" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/52824/f12226e2-45ea-4cf6-85ac-05a1a6d4b3ce">


## Description

User may be accidentally on a zoom and this will result in unpredictable
media query application.
We show warning only when user has non 1 zoom level

## Steps for reproduction

1. click button
2. expect xyz

## 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/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
2024-05-15 16:04:44 +02:00
Ivan Starkov eea7a5a408 fix: Style non-XML sections as disabled on page edit/create (#3357)
## Description

ref #3343

Overlay or hidden support for headers etc to make it look more disabled

<img width="479" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/b390ff27-ad49-490b-bf22-d8acb15b792a">


## Steps for reproduction

Create/Edit Page, change type on XML

## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-15 16:04:20 +02:00
Bogdan Chadkin 8bf04f66a9 refactor: define resource control explicitly (#3360)
Here simplified detecting system resource control with explicit resource
field. Without it ui falls back to http ui.

Will be useful for graphql ui later.

Also disabled system resource option for non-paid users

## Testing

- create sitemap resource
- close variable popover
- open again and see system control instead of default http control
2024-05-15 16:55:20 +03:00
Ivan Starkov 36d477e5f5 fix: Slow performance on a large site during text editing (#3351)
## Description

Update edited element on blur


https://fast-canvas-edit.development.webstudio.is/builder/ab3439dc-8eab-4050-a5b4-71247fba7d4c

## 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.example`
and the `builder/env-check.js` if mandatory
0.161.0
2024-05-14 19:19:04 +03:00
Ivan Starkov 8cdc103263 feat: Simple bot protection that should elimiminate most of the spam on our forms (#3350)
## Description

Add simple protection against non js and jsdom bots

Idea is to add hidden js generated field on submit, and check that
matchMedia is working.


## Steps for reproduction

Go here
https://saas-form-rdlrc.wstd.work/

then check via curl

```bash
curl 'https://saas-form-rdlrc.wstd.work/?index=&_data=routes%2F_index' \
  -H 'content-type: application/x-www-form-urlencoded;charset=UTF-8' \
  -H 'referer: https://saas-form-rdlrc.wstd.work/' \
  --data-raw 'ws--form-id=2TIgyB2vQViDMitiYiGSK&name=wewe&email=wewe&ws--form-bot=18f72a6'

curl 'https://saas-form-rdlrc.wstd.work/?index=&_data=routes%2F_index' \
  -H 'content-type: application/x-www-form-urlencoded;charset=UTF-8' \
  -H 'referer: https://saas-form-rdlrc.wstd.work/' \
  --data-raw 'ws--form-id=2TIgyB2vQViDMitiYiGSK&name=wewe&email=wewe'

curl 'https://saas-form-rdlrc.wstd.work/?index=&_data=routes%2F_index' \
  -H 'content-type: application/x-www-form-urlencoded;charset=UTF-8' \
  -H 'referer: https://saas-form-rdlrc.wstd.work/' \
  --data-raw 'ws--form-id=2TIgyB2vQViDMitiYiGSK&name=wewe&email=wewe&ws--form-bot=jsdom'
```
## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-14 19:18:51 +03:00
Jaya Krishna Namburu f1aa8db946 fix: allow users to use hex and rgba values in css-filters (#3356)
## Description

fixes #3355 

Allows filter parser to parse `rgba` and `hex` values when copy pasted.
I added some tests for filters too, we added initiall before as the css
filters parser returns false positives. But now, i added all the valid
tests, so at least we can catch things like this in future.


## Steps for reproduction
- Use the following filter values to test them.
```
drop-shadow(10px 10px 25px blue)
drop-shadow(10px 10px 25px rgba(0, 0, 255, 1))
drop-shadow(10px 10px 25px  #0000FF)
```

## 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)
- [x] added tests
2024-05-14 18:06:19 +02:00
Bogdan Chadkin ce8298bf9f fix: settings panel breaks when resource url is an expression (#3353)
JSON.parse is not safe to parse expressions. Better execute it with
try/catch.
2024-05-14 18:36:49 +03:00
Jaya Krishna Namburu 483b943625 chore: change layout for shadow UI (#3352)
## Description

Handle layout changes for individual shadow properties.
<img width="245" alt="Screenshot 2024-05-14 at 12 35 52"
src="https://github.com/webstudio-is/webstudio/assets/11075561/5facc8d8-ff21-4399-ad3a-69b56b3b2df6">
<img width="242" alt="Screenshot 2024-05-14 at 12 35 45"
src="https://github.com/webstudio-is/webstudio/assets/11075561/00295503-c4bd-43c3-8536-bb675b9074cc">

## 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-05-14 10:49:26 +02:00
Bogdan Chadkin ea5b5c8a32 experimental: autocomplete path params (#3346)
Here added support for autocompleting inferred path params where their
values are not specified by user.

<img width="312" alt="Screenshot 2024-05-12 at 14 33 23"
src="https://github.com/webstudio-is/webstudio/assets/5635476/0576039d-4fab-4499-923b-61867c12e096">
2024-05-13 03:08:23 +03:00
Bogdan Chadkin 12e00186ab refactor: drop unused mailchannels form handler (#3347)
We need to simplify form handlers story so better remove unused code
first.
2024-05-13 02:56:07 +03:00
Bogdan Chadkin 6d7e092dd3 refactor: bump asset uploader dependencies (#3336)
fontkit types added missing pieces. Figured otf is interpreted as ttf so
no need to have it as separate type.

Testing
- upload font
- upload image
2024-05-12 13:12:38 +03:00
Oleg Isonen 8aca48042d fix: Fix breakpoints editor layout (#3345)
## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-12 09:46:11 +02:00
Bogdan Chadkin 520ee940b9 fix: avoid canvas failure when image/link props invalid (#3344)
Ref https://github.com/webstudio-is/webstudio/issues/2798

Here fixed failing whole canvas when object is passed to image src or
link href. Both src and href are casted to string same way html does
with its props. It does not solve the issue universally but at least
covers most popular ones.
2024-05-12 10:41:48 +03:00
Bogdan Chadkin 31ceb2bc44 fix: support multiline graphql in curl (#3342)
Here fixed the issue with parsing curl by switching argv parser.
2024-05-11 21:32:32 +03:00
Oleg Isonenandistarkov 2496f68d32 feat: Add System Resource instead of $resources url (#3341)
## Description

ref #3308

<img width="274" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/dd7ae367-76d8-40cc-9eec-d795aaab54eb">

<img width="286" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/6f57142d-ad6a-43ef-92ba-dff4afce38bf">


# TODO:

- [x] - Remove copy for curl
<img width="344" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/bdd6b92b-5436-4537-b724-a5ecca08e7ca">


## Steps for reproduction

Add Variable, System Resource, open Select, check texts

## 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.example`
and the `builder/env-check.js` if mandatory

---------

Co-authored-by: istarkov <istarkov@gmail.com>
2024-05-11 17:55:49 +03:00
Jaya Krishna NamburuandOleg Isonen cfe222c375 refactor: use style-layer-list for all layers based sections in style-panel (#3328)
## Description

This PR refactors the values in style-panel that handles complex values.
Properties like `box-shadow`, `text-shadow`, `filter`,
`backdrop-filter`, `transition` handles multiples values which needs to
be displayed as list. And then allow users to edit them using a content
panel. This PR removes all the individual layers of each property and
created a common layer list item.

## Steps for reproduction

1. Add values to all the sections,
2. Re-order the layers between the values of each property.
3. Deploy / Export the project. 


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

---------

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2024-05-10 18:14:09 +02:00
johnsicili efa5445952 fix: add sample link to content embed component (#3335)
I forgot to add a link in the first revision. Will an href with "#"
work?

## 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.example`
and the `builder/env-check.js` if mandatory
0.160.0
2024-05-09 17:34:39 +02:00
Ivan Starkov 45e5c39751 feat: Hide style settings on non html pages (#3337)
## Description

Do not show styles at all on non html page

## Steps for reproduction

Open any page with document type xml, see no style panel is present

## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-09 18:00:08 +03:00
Ivan Starkov 595b443ee0 feat: Show xml category for xml, hide in other cases (#3338)
## Description

#3337 related

## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-09 17:59:47 +03:00
Bogdan Chadkin eb2e397d0a build: drop eslint-plugin-import (#3333)
Turns out no-internal-imports did not forbid anything out of the box but
requires specifying specific folders to forbid. This does not scale well
and this rule mostly harms because requires either excluding each
package with submodules or suppressing it with comment.
2024-05-09 18:53:35 +04:00
Bogdan Chadkin 6afc136bc1 build: drop eslint-plugin-react (#3332)
Most rules protect from legacy and class component apis.
Many rules are checked by typescript.
A few rules just do not bring much value.
The package brings too many dependencies.
2024-05-09 14:46:30 +04:00
Bogdan Chadkin cacfbee307 experimental: add content embed aka rich text component (#3315)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Embed Content is a component with a way to bind html from cms with
ability to style itself and all descendants generated from cms rich
text. All Content Embed children are "virtual" Descendant instances with
predefined selector.

<img width="1404" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5635476/8d7cf210-32cb-4e63-bfe7-8af8c3e2d78d">
2024-05-09 13:20:47 +04:00
Ivan Starkov 29abc47820 fix: Do not check user authenticated on trpc (#3330)
## Description

We should not check user auth on trpc, 
context security is enough

## Steps for reproduction

Open in Incognito

https://trpc-auth.staging.webstudio.is/builder/95821bd9-040a-4294-aa7f-edf26d7f1ebe?authToken=137726f9-7914-4807-8d62-091eea59296b&mode=edit

Click publish

## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-08 23:29:13 +03:00
Ivan Starkov e806bcbf5c feat: Close the dialog when a navigable link within it is clicked (#3329)
## Description

Close the dialog when a navigable link within it is clicked
Fixes the issue when we have anchor links inside Sheet

## Steps for reproduction

### Project Example:

https://href.staging.webstudio.is/builder/95821bd9-040a-4294-aa7f-edf26d7f1ebe
### Published:
https://link-inside-sheet-saas-sk7pk.wstd.work/

Open sheet
Click links, links should work




## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-08 22:50:57 +03:00
Jaya Krishna Namburu ce1f9026cd feat: Add support for text-shadow property in style-panel (#3318)
## Description

This PR adds support for using backdrop-filter property in the
style-panel. Here are more details on the property to test it around.
https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow

## Steps for reproduction

1. Add an element to the canvas.
2. Click on the "+" icon in the style panel next to the `Text Shadows`
section.
3. Edit the default filter that is added.
4. Swap the layers and publish the project.

## 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-05-08 17:55:03 +02:00
Ivan StarkovandOleg Isonen 0571d2d50e build: Ability to publish Pages with document type XML (#3316)
## Description

ref #3308 

Ability to render Pages with document type equal to `xml` 

If page with document type xml is created and has path `/sitemap.xml`
this page is rendered as sitemap
otherwise implicit sitemap.xml is generated.

On publish we use following logic for rendering.

With doctype === xml
- we are rendering XmlNode as is
- `Body` rendered as `(props) => props.children`, 
- all other elements as `() => null`


- [x] - sitemap.xml must be excluded from sitemap

## Steps for reproduction

### Example Saas Sitemap with $resource and custom section and headers
mixed with XmlNode

- App builder
https://xml-gen.staging.webstudio.is/builder/d6bcc915-6634-4e2d-9ef1-90e8e3836003?pageId=KrgWBi6ANVxH2BfRbar19
- Published https://saas-sitemapxml-x1g2n.wstd.work/sitemap.xml

### Implicit sitemap
- App builder
https://xml-gen.staging.webstudio.is/builder/96168940-4fbd-454a-9a03-ba4f2dffbbec
- Published https://saas-january-th6m1.wstd.work/sitemap.xml


Example with custom section and non XmlNode elements
<img width="784" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/47520bf8-bb77-4c0f-b44d-011cf2cf9814">



### Example Saas without explicit sitemap



## 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.example`
and the `builder/env-check.js` if mandatory

---------

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2024-05-08 09:49:33 +02:00
Jaya Krishna Namburu f5297231c5 feat: Add support for backdrop-filter property in style panel (#3317)
## Description

This PR adds support for using `backdrop-filter` property in the
style-panel. Here are more details on the property to test it around.
https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter

## Steps for reproduction

1. Add an element to the canvas.
2. Click on the "+" icon in the style panel next to the `Backdrop
Filters` section.
3. Edit the default filter that is added.
4. Swap the layers and publish the project.

## 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-05-08 08:22:10 +02:00
Jaya Krishna Namburu c1961506d4 feat: parse complex values with available parsers for sections (#3319) 2024-05-08 07:27:49 +02:00
Ivan Starkov b770a516af fix: Form action in case of undefined should use Remix Form to avoid reload (#3327)
## Description

Form action in case of undefined should use Remix Form to avoid page
reload

## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-08 02:29:00 +03:00
Ivan Starkov aa10864739 fix: Do not show bind button if it disabled (#3325)
## Description

Do not show bind button inside `<fieldset disabled`
That will mean that button itself is disabled and don't need to be shown

## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-08 01:41:59 +03:00
Ivan Starkov 08ea5c3875 fix: dev command (#3324)
## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-08 01:21:37 +03:00
Ivan Starkov 0a0675d7c6 build: Improve dev perf a little bit removing all (except prisma) esbuilds. (#3189)
## Description

Vite uses `webstudio` exports see resolve.conditions

## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-07 22:37:13 +03:00
Oleg Isonen e354c58e2d feat: Exclude the page from search by default (#3323)
Closes https://github.com/webstudio-is/webstudio/issues/3322

## Description

Users want to test in prod before including in sitemap

## Steps for reproduction

1. click button
2. expect xyz

## 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/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
2024-05-07 21:03:27 +02:00
Ivan Starkov 6b5edcdb54 fix: Buttons native disabled support (#3320)
## Description

See storybook, buttons inside disabled fieldset should be disabled. As
of now buttons didn't support native disabled style

See pixel comparison

## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-07 19:07:31 +03:00
Bogdan Chadkin 305436f820 experimental: add descendent component (#3313)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Here added support for new `<ws:descendent />` component. It allows to
style any children or descendents of components. Primary usage is for
embed content which renders html and need to style tags.

Descendent component accepts "selector" prop which can be suffix like `
img`, ` .image` or `::first-child` pseudo-element.

Potentially it could be used as tag styling for any element.

Can be tested in any element by dropping "Descendent" component from
"internal" category.
2024-05-06 23:36:34 +04:00