4413 Commits
Author SHA1 Message Date
Ivan Starkov 2209b21608 build: Release 0.125.0 (#2761)
## Description

release 0.125.0

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/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.125.0
2024-01-14 18:56:19 +03:00
Ivan Starkov a8918a70d2 feat: Appsumo support (#2759)
## Description

- [x] - Instead of stripe we don't know userId at the moment of
appsumo.activate so make userId nullable
- [x] - Add appsumo log entries to UserProduct view. 

<img width="308" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/e2b4f12f-f57f-401f-b8db-f7334d7b9187">


## 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-01-14 17:14:15 +02:00
Oleg Isonen e057ba1d91 fix: Better error message when user reaches max domains limit (#2758)
## Description

Just message text

## Steps for reproduction

1. add more than 5 domains on a free account

## Code Review

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


## 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-01-14 12:14:29 +01:00
Bogdan Chadkin a5ed1e99f2 fix: hide page params with cms flag (#2757)
Ref https://github.com/webstudio-is/webstudio/issues/2532

We are launching bindings without page params
which will be part of cms launch.
2024-01-14 17:12:39 +07:00
Bogdan Chadkin 694cfefe33 chore: resync fixtures 2024-01-14 15:52:42 +07:00
Oleg Isonen 5a5382c975 feat: Page folders (#2745)
Ref https://github.com/webstudio-is/webstudio/issues/404

## Description

Implement ablity to organize pages in folders, not a complete
implementation, only:

- Implements data structure for folders
- Allows to create folders and select a parent folder from a folder
- Reparents orphaned pages/folders for the future collaboration mode

## Steps for reproduction

1. open pages
2. add folders
3. nest folders
4. delete folders

## 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-01-13 16:39:57 +01:00
Bogdan Chadkin ed188ef215 feat: support binding in text content (#2756)
Ref https://github.com/webstudio-is/webstudio/issues/2532

- added new expression type to instance children
- added binding to text content setting
- prevented deleting variable bound to instance child
- rendered computed child in canvas and preview
- supported expression child in component generator

What's missing

- copy paste support (will add later)

<img width="880" alt="Screenshot 2024-01-13 at 09 59 58"
src="https://github.com/webstudio-is/webstudio/assets/5635476/1275d5b3-420b-4f97-9d72-407ff39932e5">
2024-01-13 16:50:08 +07:00
Jaya Krishna Namburu 93c9defb90 fix: Add source and reset details in tooltips for flex gap (#2752) 2024-01-12 17:01:55 +01:00
Bogdan Chadkin 8fa0d7590f feat: support editing text content in settings panel (#2754)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added "Text Content" system prop to all elements which allows to
edit plain text content though settings panel.

It will be used to support instance content binding instead of using
HtmlEmbed with code binding.

<img width="879" alt="Screenshot 2024-01-12 at 11 51 39"
src="https://github.com/webstudio-is/webstudio/assets/5635476/d88e1d56-7f6b-4ec1-9ea3-04cd40baa618">
2024-01-12 20:33:08 +07:00
Bogdan Chadkin 2a1d77b0b8 fix: fallback to default value in computed props (#2755)
This fixes the issue with "show" is false by default.
2024-01-12 17:48:58 +07:00
Bogdan Chadkin 427e40dd72 feat: hide variables outside of slots (#2751)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Slots will eventually become components. And components cannot have
direct access to page variables. Here added constraint to hide all
variables outside of slot component.
2024-01-11 16:49:06 +07:00
Bogdan Chadkin f85d7fa4fd feat: delete resources along with variables (#2749)
Ref https://github.com/webstudio-is/webstudio/issues/2532

- fixed deleting when delete in variables section
- fixed deleting when delete instance
2024-01-10 19:23:57 +07:00
Bogdan Chadkin ad233d158d feat: disable reset button for non-expression binding (#2748)
Ref https://github.com/webstudio-is/webstudio/issues/2532

This prevents users from pointless resetting non-expression bindings.

Also fixed text controls style when binding is bound.

<img width="485" alt="Screenshot 2024-01-10 at 16 29 47"
src="https://github.com/webstudio-is/webstudio/assets/5635476/8102a63f-7618-4a93-89a0-494219a8ef0a">
2024-01-10 16:54:32 +07:00
Oleg Isonen b2bf220ed6 chore: Rename all *Store to $store (#2747)
## Description

Pure renaming, nothing else.

## 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-01-09 13:32:51 +01:00
Bogdan Chadkin 0070ca41e1 feat: show bindings only on control hover (#2743)
Ref https://github.com/webstudio-is/webstudio/issues/2532

## Steps for reproduction

1. check all prop controls
2. check resource variable
2024-01-09 19:03:10 +07:00
Bogdan Chadkin ab4d5def09 feat: improve variable and binding popovers position (#2740)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here improved position of popovers to stack to the left of current
"context". So binding are placed on the left of settings panel and on
the left of variable popover panel. While variable popover panel is
always placed on the left of settings panel.

<img width="505" alt="Screenshot 2024-01-08 at 14 53 26"
src="https://github.com/webstudio-is/webstudio/assets/5635476/bfb5a46e-f00c-4666-a548-37267da1922b">
<img width="756" alt="Screenshot 2024-01-08 at 14 53 17"
src="https://github.com/webstudio-is/webstudio/assets/5635476/e2544c8b-a51c-4359-897a-e1545a26e767">
2024-01-08 18:15:59 +07:00
Dima Ivashchuk 8749114a89 Update README.md with lost pixel (#2742)
## Description

Add thanks to Lost Pixel section
2024-01-08 11:47:29 +01:00
Ivan Starkov ad6a8da1c9 build: Release 0.124.0 (#2741)
## Description

Npm release

## 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.124.0
2024-01-08 11:20:09 +02:00
Oleg Isonen e7b6c752b7 feat: Add loading lazy/eager to vimeo (#2738)
## Description

When video is off-screen and needs to be autoplayed, you can now put it
to loading=lazy and it won't load until its in viewport.




https://github.com/webstudio-is/webstudio/assets/52824/3fa59ab8-1e19-44b4-969b-3eb99f12fccf


## 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-01-08 11:19:47 +02:00
Ivan Starkov 672ee9a98a feat: Support atomic CSS on build (#2739)
## Description

Logic was changed only in `prebuild.ts`. All other changes or README or
autogenerated

Integrate atomic CSS support into CLI

The Vercel fixtures project now explicitly sets atomicStyles to true.
Netlify explicitly sets atomicStyles to false.
The custom template doesn't have a default setting, so atomicCss=true is
used."

## Steps for reproduction

See fixtures.

## 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-01-08 10:36:09 +02:00
Ivan Starkov 7bffdc0954 feat: Add Publish Settings section to Project settings (#2720)
## Description

<img width="496" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/f49af094-b843-4fb0-b324-90ab0b4dabb1">

## Steps for reproduction

Open Project, See Project Settings

## 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-01-08 09:15:29 +02:00
Bogdan Chadkin 4f64676db7 feat: improve variable popover (#2737)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here changed variable popover UI

- removed save/cancel buttons - save is happening on close
- replaced value/resource tabs with type select
- support additional string, number and boolean values
- add validation to value and resource forms

Also added form utilities to manage and compose field validation.
2024-01-07 23:40:48 +07:00
Oleg Isonen 9ed70babce fix: Ensure user can't enter invalid canvas width value in breakpoints editor (#2736)
## Description

User was able to delete the value and get a NaN error Ref
https://github.com/webstudio-is/webstudio/issues/2734

## Steps for reproduction

1. delete the value
2. see the min width rendered

## 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-01-06 19:12:36 +01:00
Bogdan Chadkin 210a2f40d6 feat: improve binding validation (#2730)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here changed how bindings are validated

- closing with broken expression will show errors and prevent close
- the next close will not block and keep the old valid expression
- close with valid expression invoked saving
- props no longer can change the type of input
- binding button becomes red and gets tooltip when value has invalid
type
- binding popover also shows non-blocking error about type
- each control provides own validation

<img width="465" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5635476/c19cca91-4558-4570-b257-1c10689a1113">
<img width="247" alt="Screenshot 2024-01-05 at 17 13 15"
src="https://github.com/webstudio-is/webstudio/assets/5635476/8702b2f2-1756-4262-924f-83f1d92eb4b4">
2024-01-07 00:59:13 +07:00
Oleg Isonen 4e43e9b2fd fix: blocking alerts accidentally got enabled for everyone (#2731)
## Description

In the last PR I forgot to uncomment the check

## 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-01-05 17:41:31 +01:00
ad224732cc feat: Link typography tokens and a new Link component in DS (#2729)
## Description

- Decided to not have separate colors for link, it should just use
regular text colors.
- Added a Link component to the design system, modelled after MUI Link
component

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

---------

Co-authored-by: Taylor Nowotny <86495896+taylornowotny@users.noreply.github.com>
Co-authored-by: Bot (build-figma-tokens.yml) <bot@localhost>
Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>
2024-01-05 12:51:47 +01:00
Bogdan Chadkin e810ea9b89 feat: switch props to binding popover (#2727)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here finally replaced variables panel with binding popover in all prop
controls.
Additionally did better support of expressions in file and url controls.

The tricky part is managing expressions on control components level
instead of global props panel level which gives us more granular control
of behavior though requires more boilerplate code in each control.

There are still some bugs for example with loosing focus when start
editing expression which I will fix in following validation fix.

## Testing

- check id in Body (string)
- aria-max something in Body (number)
- check "show" in body child (boolean)
- check href in Link (url)
- check src in Image (file)
- check state in Form (radio)
- check aria-autocomplete in body (select)
- check remove binding in resource fields
2024-01-04 12:14:17 +07:00
Oleg Isonen 97837bb4ed feat: Update dashboard card (#2726)
## Description

Implements the latest version of the dashboard card:

1. hover state of the link gets underline decoration (fixes
https://github.com/webstudio-is/webstudio/issues/2601)
2. added info icon with published date and created date (we don't have
edited date yet, not important enough I think)
https://www.figma.com/file/xCBegXEWxROLqA1Y31z2Xo/%F0%9F%93%96-Webstudio-Design-Docs?node-id=9598%3A11774&mode=dev

## Steps for reproduction

1. open dashboard
2. hover link to see decoration
3. hover info button to see tooltip with creation date and publish date
if project was published

## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)

## 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-01-03 09:40:15 +01:00
Jaya Krishna Namburu ed332ec37d fix: tooltips on background, box-shadow and transitions titles (#2699)
## Description

New branch taken from the #2691 as we need branch names should be
smaller now. Please refer to the PR for any comments/discussions etc.

## Code Review

- [ ] hi @istarkov , I need you to do
   detailed review (read every line)

- [ ] hi @taylornowotny, i need your help
   -  please check the tooltip contents for these three properties.
2024-01-02 07:13:18 +01:00
Bogdan Chadkin 408816346b feat: add variables to settings panel (#2722)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added variables section to settings panel similar to props section.
UI is slightly different from previous implementation.

- the list shows only variables defined specifically on current instance
- selecting item starts editing instead of "menu" button
- resource variables can be deleted when unused

<img width="519" alt="Screenshot 2023-12-31 at 18 01 35"
src="https://github.com/webstudio-is/webstudio/assets/5635476/55763a49-a031-4696-bbf8-6c16ea0effbe">
<img width="253" alt="Screenshot 2023-12-31 at 18 01 48"
src="https://github.com/webstudio-is/webstudio/assets/5635476/d6a768db-f8dd-4fe9-9820-8685dd991067">
<img width="519" alt="Screenshot 2023-12-31 at 18 01 35"
src="https://github.com/webstudio-is/webstudio/assets/5635476/e7701edc-eaeb-44e8-beb3-5e2c9c01be03">
2024-01-01 12:58:18 +07:00
Oleg Isonen 692bc16590 fix: Escape user-provided class (#2721)
## Description

Realized that user can put in a quote that will break the rendering

We also need an actual validation in the UI for class name, because its
not just an arbitrary string.


## 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
2023-12-31 21:00:17 +01:00
Bogdan Chadkin a22f9fe900 feat: add html editor (#2717)
Ref https://github.com/webstudio-is/webstudio/issues/2359
https://github.com/webstudio-is/webstudio/issues/2388

Here added codemirror based html editor for html embed component. It
supports basic autocomplete and highlights embedded css and js.

Splitted basic codemirror setup into CodeEditor component everything
else can be customized around it.

<img width="245" alt="Screenshot 2023-12-27 at 15 30 57"
src="https://github.com/webstudio-is/webstudio/assets/5635476/7bb7907a-0f5b-406b-8615-2029e6494839">
<img width="240" alt="Screenshot 2023-12-27 at 15 30 22"
src="https://github.com/webstudio-is/webstudio/assets/5635476/bc826e52-0597-4998-a534-e7053f25fb26">
2023-12-31 13:48:19 +07:00
Bogdan Chadkin a5bc12ed2c feat: add binding popover (#2719)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added new binding popover as a replacement for variables popover.
Integrated into resource fields and made button look like suggested by
Mark and Taylor.

<img width="317" alt="Screenshot 2023-12-30 at 13 26 12"
src="https://github.com/webstudio-is/webstudio/assets/5635476/141ea317-438f-428c-96a8-9f1919513e8c">
<img width="255" alt="Screenshot 2023-12-30 at 13 25 59"
src="https://github.com/webstudio-is/webstudio/assets/5635476/f8a3b5c7-4928-46f2-8d86-5ee264150d13">
2023-12-31 12:34:03 +07:00
Oleg Isonen c6bdef5084 feat: CSS engine has now a Style Sheet rendering with atomic classes which will lead to a 10x smaller bundle size (#2713)
## Description

CSS engine has now a Style Sheet rendering with atomic classes which
will lead to a much smaller bundle size

## 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
2023-12-30 21:08:37 +01:00
Oleg Isonen 5930064678 feat: Rename Site to Project because we are not just building a site builder (#2718)
## Description

Site is too narrow name for things that are pssible with webstudio


## 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
2023-12-30 10:40:09 +01:00
Oleg Isonen f76f0f19b8 fix: remove delay when showing spinner for openning projects (#2712)
## Description

Reason is we always see spinner, but with delay it feels less responsive

## Steps for reproduction

1. click project thumbnail
2. see spinner showing right away

## Code Review

- [ ] hi @try, 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
2023-12-29 13:26:37 +01:00
Bogdan Chadkin 11b799d4f7 feat: load resources in builder (#2714)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here improved resource management to load defined resources and store in
variable values to allow preview data. Builder requests data from proxy
route every time resources or their variables are changed.

<img width="1449" alt="Screenshot 2023-12-25 at 01 09 58"
src="https://github.com/webstudio-is/webstudio/assets/5635476/6614a356-0170-4606-9b60-d39b1bc09837">

Data to test is here
https://gist.githubusercontent.com/TrySound/56507c301ec85669db5f1541406a9259/raw/a49548730ab592c86b9e7781f5b29beec4765494/collection.json
2023-12-27 23:54:09 +07:00
Bogdan Chadkin f0b7a41824 fix: improve generating resources (#2715)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added resources fixture and fixed a few issues with it

- add optional chaining to collection?.map to safely skip iterating
missing data
- added any to resource responses to access remote data without type
errors
- always generate empty headers array
- skip empty body in generated resources
2023-12-27 23:42:50 +07:00
Bogdan Chadkin 1a904b00b4 feat: add resource variables support in builder (#2711)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added Value/Resource tabs to "new/edit variable" panel to support
creating both value and http request based variables.

Url, headers and body are expressions with support to all available in
scope value and page params variables.

Actual loading of resources in builder will be added later.

<img width="493" alt="Screenshot 2023-12-24 at 13 42 34"
src="https://github.com/webstudio-is/webstudio/assets/5635476/683876ec-4080-45fe-b2cc-e46e40256ce1">
<img width="481" alt="Screenshot 2023-12-24 at 13 42 20"
src="https://github.com/webstudio-is/webstudio/assets/5635476/b8937693-fb04-4ea5-a0aa-7092e3bec518">
2023-12-25 17:18:09 +07:00
Bogdan Chadkin 842c017c11 refactor: make resources universal (#2710)
Refactored resources generator to use universal http resource which
cover most cases.
- loadResource is imported from sdk
- accepts url (expression), method, headers (value is expression) and
body (expression)
- all variables and page params parameter are available for loader
expressions
2023-12-24 01:03:44 +07:00
Jaya Krishna Namburu 662f64988a feat: Add box-shadow ui panel for editing values individually for layers (#2706)
## Design

https://www.figma.com/file/xCBegXEWxROLqA1Y31z2Xo/%F0%9F%93%96-Webstudio-Design-Docs?node-id=8075%3A38024&mode=dev

## Description
Box-shadow floating panel to edit each layer values individually. 
fixes #2523 



![box-shadow](https://github.com/webstudio-is/webstudio/assets/11075561/67e16627-792e-430a-ae24-3bb59792b58f)
2023-12-21 07:26:53 +01:00
Bogdan Chadkin 0688dfdab7 feat: switch to expression edtior for expressions (#2707)
Ref https://github.com/webstudio-is/webstudio/issues/2532

- switched to expression editor for expression field in variables panel
- removed legacy code editor
- preview actual (not initial) values in variable list
- show actual values in variable list for parameters
- render autocomplete tooltip in body to prevent variables popover
scroll overflow
- wrap lines expression editor to avoid horizontal scroll
- fix html embed failing when non string value is specified

<img width="503" alt="Screenshot 2023-12-20 at 11 17 22"
src="https://github.com/webstudio-is/webstudio/assets/5635476/09a4ae36-2b02-416f-b290-3a82cda79851">
<img width="493" alt="Screenshot 2023-12-20 at 11 15 14"
src="https://github.com/webstudio-is/webstudio/assets/5635476/409c08e5-200f-45aa-908c-be5d0a2ba520">
2023-12-21 12:14:00 +07:00
Bogdan Chadkin 60dcb68776 feat: reimplement expression editor with codemirror (#2705)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here introduce the new expression editor as a replacement to code
editor. It is implemented with codemirror and will improve DX of our
bindings and cms usage.

- autocomplete now completes nested objects in variables
- javascript syntax is highlighted in expressions
- json values are formatted as multiline text
- autocomplete shows fields value/type

Additionally improved a couple of things

- json objects are wrapped with parentheses `({ param: "value" })` to be
treated as object instead of block in highlighter
- objects and arrays are rendered as "object" and "array" in variables
list for cleaner UI

Integrated in builder only for variable value and json prop value. Will
require additional logic to integrate as expression editor.

<img width="559" alt="Screenshot 2023-12-19 at 12 13 28"
src="https://github.com/webstudio-is/webstudio/assets/5635476/c3a3907a-9c08-4343-a1a7-ed12dbdb2404">
<img width="239" alt="Screenshot 2023-12-19 at 12 12 24"
src="https://github.com/webstudio-is/webstudio/assets/5635476/777a2ac5-db79-46c7-8438-538f03edcbf7">
2023-12-19 15:10:40 +07:00
Bogdan Chadkin b919bdd0ba fix: generate link hash in preview (#2700)
Closes https://github.com/webstudio-is/webstudio/issues/2696

broke this when refactored props computing, normalizing props should
always be called on whole props list to allow getting id prop from other
pages and instances and copmute hash.
2023-12-19 13:07:48 +07:00
Bogdan Chadkin dcd989108e feat: generate resource loaders (#2701)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added generation of server modules with resource loaders. These
loaders are invoked in remix loader and result is passed to page
component.

Check fixtures and tests.
2023-12-18 21:24:50 +07:00
Bogdan Chadkin 02534730de feat: support resources in schema and compiler (#2698)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added new schema type "Resources" to contain configuration of
requests to services. Their first use case is referencing from variable
to store loaded data.

For now added only client side generation. Later add support for server
code generation as part of remix loaders.
2023-12-16 15:44:49 +07:00
Ikko Eltociear Ashimine 4ca0ded92b docs: fix typo in migrations-cli/README.md (#2678)
Reseting -> Resetting
2023-12-15 00:59:14 +07:00
Bogdan Chadkin 7fe4b770d6 feat: support page path params in site compiler (#2682)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here remix route params are adapted to URLPattern format and passed to
generate page component as prop.

For this added 2 remix specific utilities
- convert subset of url pattern to remix route
- generate utility to adapt remix params to URLPattern params for
example for `/*` `params['*']` is replaced with `params[0]` and for
`/:slug*` `params['*']` is replaced with `params['slug']`
2023-12-15 00:34:51 +07:00
Bogdan Chadkin 42063e0d79 feat: validate page path (#2681)
Here added description tooltip and additional validation to constrain
UrlPattern syntax to fit most framework abilities.

<img width="765" alt="Screenshot 2023-12-13 at 15 58 11"
src="https://github.com/webstudio-is/webstudio/assets/5635476/f4124e66-a483-4228-b576-99b9d57afc31">
<img width="528" alt="Screenshot 2023-12-13 at 15 56 45"
src="https://github.com/webstudio-is/webstudio/assets/5635476/e3241ebe-bfb1-4e79-9ade-691700b9e08b">
2023-12-15 00:02:37 +07:00
Bogdan Chadkin e2d14eee72 fix: implement own hotkeys (#2684)
Fixes
https://discord.com/channels/955905230107738152/1184660413326053426/1184660413326053426

Primitives exposed by react-hotkeys-hook are quite useless and buggy for
us. Here added own simple implementation which should fit our needs.
2023-12-14 23:58:14 +07:00