1606 Commits
Author SHA1 Message Date
Ivan Starkov 13afe43cc5 Update ussets and project (#985)
## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-10 13:39:35 +03:00
Ivan Starkov 2012428327 Update ver 0.26.0 (#984)
## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-10 14:12:21 +04:00
Ivan Starkov 58ae2f49b2 Update npm packages (#982)
## Description

1. What is this PR about (link the issue and add a short description)

Update npm packages

## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-10 12:21:59 +03:00
Ivan Starkov ed2645292b Add support of saas edge-api trpc preview router (#971)
## Description

1. What is this PR about (link the issue and add a short description)

This branch will allow preview deployments of trpc authorization and
other saas services
Currently in this branch following variables are set:

```env
TRPC_SERVER_URL=https://wstd.work/services
TRPC_SERVER_API_TOKEN=secrettoken
```
It should use preview saas trpc service having `ory_setup` name
Here `https://wstd.work/services` is router url, router using
`x-branch-name` reroutes traffic to the right saas preview

This is for test ONLY, variables would be removed if all is ok and
testing will proceed on saas side

## Steps for reproduction

Create a new Project, create auth tokens, and check it works.
Check saas service preview logs that requests are there.



## Code Review

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

## Before requesting a review

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

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-10 12:13:57 +03:00
Ivan Starkov 3e39df6970 Change Env usage from process.env to import (#973)
- [x] - Doesn't work locally and at server, different issues,
investigating, added comment why we use process.env at proxy
- [x] - Fix proxy  

## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

All public env variables (which can be shared to a client) are moved
into `~/env/env.public`
All other variables are moved into `~/env/env.server`

Vendor-prefixed vars like VERCEL_URL got beautiful names having that we
already had beautiful names.

Shared Proxy fixed to has access only to env.public


## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-10 11:46:22 +03:00
Bogdan Chadkin 1e5caee26d Fix multiple local style sources (#981)
Ref https://github.com/webstudio-is/webstudio-designer/issues/807

Missed this case. We should always rely on either raw data or use
computed store within single update.
2023-02-10 11:43:03 +03:00
Oleg Isonen 77d55f2ae8 fix left sidebar tablist border 2023-02-09 23:24:25 +00:00
Bogdan Chadkin 0a5a9dc7c1 Refactor insertInstance with instances index (#978)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Got rid of unused utilities in project packages and added new
insertInstanceMutable tree utility and insertInstance command.
2023-02-09 23:46:02 +03:00
Bogdan Chadkin 7d631aaa83 Represet style source selections as map (#976)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Patches by indexes are replaced with patches by keys so we could get
almost conflict free collaboration.
2023-02-09 19:03:15 +03:00
Bogdan Chadkin abdfbf2384 Refactor instance reparenting with instances index (#977)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Index allows us to pretraverse the tree and provide utils for fast
access anything in the tree.

Also removed old implementation from project package.
2023-02-09 19:00:04 +03:00
Oleg Isonen e50fa46629 bring back aspect ratio 2023-02-08 21:56:36 +00:00
Bogdan Chadkin 8fb4c59c77 Represent style source as map (#975)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Same as props. Fast access and fast update. So we no longer need
separate store with style sources index.
2023-02-09 00:33:01 +03:00
Bogdan Chadkin 136a7bd157 Represent props on client as map (#972)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

While normalized array of props give us flexibility with atomic updates
we still cannot use it for collaboration because patches are applied
with index in this array which may leads to unexpected results when two
users collaboate on the same tree, for example both put new prop and
edit it before synchronization by the same index, we are getting
conflict.

To avoid such issues we can switch client representation to maps. Almost
all data have ids to use in map as keys. Map makes collaboration almost
conflict free.
2023-02-08 20:23:41 +03:00
Bogdan Chadkin 0200ea2c57 Implement basic style source ui (#962)
Ref https://github.com/webstudio-is/webstudio-designer/issues/807

Here basic support for styles sources in style panel

- new token creation
- existing token adding for instance
- token removing from instance
- sorting with dnd
- style source selection for styles  editing

Added feature flag to hide it on prod for now.
2023-02-08 13:13:50 +03:00
Oleg Isonen 266d62c339 Animate menu button on hover (#967)
Closes https://github.com/webstudio-is/webstudio-designer/issues/964

## Description

Animate the topbar menu button from logo to hamburger. menu on hover as
well as remove unnecessary styles

## Steps for reproduction

1. open designer
2. hover logo
3. click icon

## Code Review

- [ ] hi @rpominov , 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-08 10:26:28 +01:00
Bogdan Chadkin 3e442bb1f0 Synchronize initial state of client stores (#960)
Ref https://github.com/webstudio-is/webstudio-designer/issues/959

We usually rely on default which is the same everywhere. Though with
assets initial state comes from server so it should be synchronized.

The issue was not visible because we also load assets in runtime which
does not seem to happen on project switch.

Fixed by sending initial state to designer.
2023-02-07 18:41:33 +03:00
Bogdan Chadkin eb66eccca1 Move selected style source into separate store (#955)
Ref https://github.com/webstudio-is/webstudio-designer/issues/807

this will let to reuse the logic and newly generated local style source
with style source input.
2023-02-07 00:17:06 +03:00
Ivan Starkov d00c646b10 Disable share and publish buttons if not owner (#952)
## Description

1. What is this PR about (link the issue and add a short description)

Disable share and publish buttons if not owner

Also changed Deprecated Coponents on FloatingPanel

<img width="305" alt="image"
src="https://user-images.githubusercontent.com/5077042/216975690-8ed2bd08-c077-4b78-add9-1d10a16b0ff5.png">

## Steps for reproduction

Share the Link with View/Build permissions.
Open that link in incognito mode.
Try to share / publish project.

<img width="293" alt="image"
src="https://user-images.githubusercontent.com/5077042/216948687-d58370ba-f91c-4558-ad54-5700ee318493.png">

<img width="293" alt="image"
src="https://user-images.githubusercontent.com/5077042/216948811-3e8b33f9-bd87-4752-917c-89f1affbb08d.png">

<img width="401" alt="image"
src="https://user-images.githubusercontent.com/5077042/216975898-af52725d-ae9b-49b3-8519-e66b7cc469bf.png">

## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-06 15:56:18 +03:00
Ivan Starkov 4a5aadf5ec Assets view mode (#951)
## Description

1. What is this PR about (link the issue and add a short description)

In view mode, we need to prevent users from deleting / creating assets
in UI. (Server-side protection already done in the previous PR)

The other way can be just to hide buttons from the UI.
Also tooltip duration for disabled actions can be smaller.

## Steps for reproduction

Share the Link with View permissions.
Open that link in incognito mode.
Try to create/delete an asset

<img width="265" alt="image"
src="https://user-images.githubusercontent.com/5077042/216938724-d8e0e3b3-28fe-405e-8997-0a8dd84a105e.png">


<img width="355" alt="image"
src="https://user-images.githubusercontent.com/5077042/216938784-a1a59926-b41e-4193-8584-8387cae221f6.png">

<img width="263" alt="image"
src="https://user-images.githubusercontent.com/5077042/216939092-13d59ddd-c601-4ebb-b536-d7c0bd4a572a.png">

<img width="308" alt="image"
src="https://user-images.githubusercontent.com/5077042/216940665-f185e9b7-84c3-4ad7-8c61-43b3447a5777.png">


## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-06 15:56:05 +03:00
Oleg Isonen b8829fc1c6 Remaning toolbar updates (#949)
## Description

1. Added page name
2. Using now Toolbar from radix
3. Added Toolbar from radix to ds
4. Updated layout for centering the breakpoints button among other
things

<img width="961" alt="Screenshot 2023-02-05 at 21 11 47"
src="https://user-images.githubusercontent.com/52824/216846091-4b2113a4-38f7-41bf-969d-485cbe16b22c.png">


## Steps for reproduction

1. click button
5. 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-06 13:07:15 +01:00
Bogdan Chadkin 052d049073 Refactor closest droppable with instances index (#945)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

A lot of our utilities can reuse indexed instances instead of
retraversing tree. This will also simplify migration to normalized
instances.

Here I refactored droppable instance lookup.
2023-02-06 14:16:52 +03:00
Bogdan Chadkin 49e82f8f2d Rename singular props and styles names (#953)
We decided to get rid of "Item" naming, here renamed everything left.

- PropsItem -> Prop
- StylesItem -> StyleDecl
2023-02-06 14:16:14 +03:00
Bogdan Chadkin 46582c8f88 Fix double delete when focused navigator tree (#946)
Looks like calling onDelete in navigator duplicates global delete
shortcut.
2023-02-06 12:45:39 +03:00
Ivan Starkov 5af9c4e5d4 Disable sync for user/token with "view" permit and show view mode icon (#941)
## Description

1. What is this PR about (link the issue and add a short description)

Disable sync for user/token with "view" permit and show view mode icon

<img width="294" alt="image"
src="https://user-images.githubusercontent.com/5077042/216642624-00a75655-d8a8-49de-9818-a2bec00c637b.png">


## Steps for reproduction

Create Share view link. Copy link. Insert into the incognito window. See
the screenshot above. Any changes should not cause savings.

_Assets saving, for now, are not prevented_

## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-06 12:28:13 +03:00
Ivan Starkov c0c58e23cb Add assets permissions checks (#948)
## Description

1. What is this PR about (link the issue and add a short description)

Add assets permissions checks serverside.
Mostly adding context 

## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-06 12:18:54 +03:00
Bogdan Chadkin 7e494fb59a Track delete shortcut on both canvas and designer (#947)
Here's the issue. We track shortcuts on canvas and designer though
designer invoke hotkeys with shared configuration and loose edge cases.
For example delete should not be invoked on inputs though shared
configuration enforce it. If we disable inputs then undo/redo will stop
working.

So for better safety we should track shortcuts in both designer and
canvas with the same code and update synchronized stores instead of
synchronizing shortcuts.
2023-02-05 23:44:27 +03:00
Oleg Isonen 06a7c81d13 Topbar layout and buttons redesign (#943)
## Description

1. Topbar components replaced
2. Toolbar Toggle component added to the ds



https://user-images.githubusercontent.com/52824/216761913-1f801137-af36-400c-ad99-7b01c0e356d8.mp4



## Steps for reproduction

1. open designer

## Code Review

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

- [ ] @taylornowotny I need you to 
  - check for visual 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-05 19:13:25 +01:00
Ivan Starkov 50e17d44ee Show preview initially for view only users (#940)
## Description

1. What is this PR about (link the issue and add a short description)

Show preview initially for view only users

ref #548


## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-03 18:19:55 +03:00
Oleg Isonen 1d5d736915 Optimistic rename project (#939)
## Description

1. We reuse zod schema on the client now, so if server sends and error
we crash entirely, we don't expect an error that we need to show at the
moment. In the future we will have cases where we can't fully validate
on the client and an error may come from server.
2. Once client validation has passed we immediately close the dialog
without waiting for response.

## Steps for reproduction

1. click rename in project on dashboard

## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-03 15:49:05 +01:00
Bogdan Chadkin cec0e16912 Delete instance without pubsub (#937)
Synchronized stores allow us to change data anywhere we want so we can
get rid of pubsub in almost all cases.

Here removed delete instance subscription and used delete instance
command.
2023-02-03 15:36:21 +03:00
Oleg Isonen 3beb0d01e3 Optimistic project deletetion (#938)
## Description

1. optimistic delete



https://user-images.githubusercontent.com/52824/216601949-743ee55b-2f4b-42bd-9c4f-b94f4b76bce8.mp4



## Steps for reproduction

1. delete project without waiting for response

## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-03 13:35:14 +01:00
Bogdan Chadkin 2b404f2864 Use synchronized store for assets (#936)
Before assets were synchronized with pubsub between canvas and designer.
Here I switched to synchronized store.
2023-02-03 13:06:25 +03:00
Ivan Starkov cc447fbc63 Update packages (#934)
## Description

1. What is this PR about (link the issue and add a short description)

I want to update saas based on #928

## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-03 11:41:41 +03:00
Bogdan Chadkin aff014f4d0 Use projectId as composite id in tables (#932)
Ref https://github.com/webstudio-is/webstudio-designer/issues/896

Here changed Asset, Build and Tree tables to composite ids with
projectId to improve security and simplify project management.
2023-02-03 11:39:21 +03:00
Oleg Isonen a8e063b081 Pending state for create project in dashboard (#931)
## Description

1. Adds pending state to submit button

## Steps for reproduction

1. click create project
2. see button shows as pending

## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-02 21:19:01 +01:00
Ivan Starkov 119f1cf78c Unify and simplify fetch and errors for endpoints and packages used in SaaS (#930)
## Description

Unify and simplify fetch and errors for endpoints and packages used in
SaaS
ref #928

## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-02 22:40:00 +03:00
Oleg Isonen cffb6dc071 Sort dashboard projects by createdAt (#927)
## Description

Add createdAt field to projects and sort by it in dashboard

## Steps for reproduction

1. open dashboard
2. rename a project
3. project should stay in the same order, before that change it would
always jump at the end

## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-02 20:13:36 +01:00
Bogdan Chadkin 073062a4bf Move breakpoints to Build table (#926)
Ref https://github.com/webstudio-is/webstudio-designer/issues/744

We are trying to co-locate data and simplify cloning/copying. Here I
migrated Breakpoints.values into Build.breakpoints.

This makes Build responsible to all data scoped to project build similar
to tree scope.

We get projectId defined for free and no need additional sql
maintenance.
2023-02-02 21:43:03 +03:00
Bogdan Chadkin 370718f5a2 Replace bson-objectid with nanoid (#925)
- bson-objectid is harder to use with ObjectId().toString()
- nanoid is safer alternative
(https://github.com/paralleldrive/cuid2#the-contenders)
- auto import works better
2023-02-02 18:50:26 +03:00
Ivan Starkov 505fdac672 Fix production publish (#922)
## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-02 13:23:23 +03:00
Ivan Starkov b05a36defe Update versions (#920)
## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-02 13:02:49 +04:00
Oleg Isonen 438697f2cb Add share dialog to dashboard (#916)
To add it to dashboard I had to move things around

https://user-images.githubusercontent.com/52824/216138251-260a8a7e-fc86-424b-aaff-bb11c79c307d.mp4

## Steps for reproduction

1. click on share in menu in dashboard and in topbar from builder
2023-02-02 11:43:43 +03:00
Bogdan Chadkin 118e07aeb0 Migrate styles to style sources variant (#917)
Ref https://github.com/webstudio-is/webstudio-designer/issues/807

Styles are resolved based on style sources of every instance. Here
finally migrated whole logic to new variant.

For now the only local style source is used as default for style
updates. In the next PR will add support for tokens.
2023-02-02 01:22:46 +03:00
Roman Pominov d110075af0 Fix font in project card (#914)
Used a wrong token in #912
2023-02-01 21:24:52 +03:00
Bogdan Chadkin 174b7124f2 Add style sources stores (#913)
Ref https://github.com/webstudio-is/webstudio-designer/issues/807

Here added style sources and style source selections stores, added
updates along styles and covered with tests. Patch utilities for rest
endpoint are not used to avoid collision with temporary logic in styles.

Next step will be integration styles with style sources on client.
2023-02-01 20:55:19 +03:00
Ivan Starkov 8eb14be0c8 Sync preview mode through sync-stores (#915)
## 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-01 19:26:54 +03:00
Roman Pominov 0e173ec85e Text fixes (#912)
1. New `Text` component, existing is deprecated. Closes #825
2. Deprecated `Paragraph` component (the replacement is `<Text as="p">`)
3. Added `textVariants` that can be used like this `css({
...textVariants.regular })`
4. Removed `typography`, now `textVariants` or `textStyles` can be used
instead
5. Added `theme.fontSize`, `theme.lineHeight`, `theme.fontWeight`,
`theme.letterSpacing` that use values from Figma
6. Deprecated existing `theme.fontSize`, `theme.lineHeight`
7. Installed `Roboto Mono` font
2023-02-01 16:54:00 +03:00
Oleg Isonen 27a00fdc79 Dashboard remaining dialogs (#907)
## Description

1. Rename and delete dialogs + cleanup

## Steps for reproduction

1. click project item menu to rename 
2. click project item menu to delete 

## Code Review

- [ ] hi @rpominov , 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-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-02-01 13:32:35 +01:00
Bogdan Chadkin 22e54f8167 Fix copy paste styles and props of descendants (#911)
Found we do not copy styles and props for descendant instances. Here
also removed copy/paste data from react and added a few new tree
utilities.
2023-02-01 13:52:53 +03:00
Bogdan Chadkin abee2f1cf4 Make copy paste data agnostic (#909)
Copy paste of instances was implemented closly coupled to our schema.
Here I make I implement it with simpler interface without dependency on
types. Type and version are instead passed as configuration.

Next step will be decoupling instance copy paste from react and
simplifying data management with nanostores.
2023-02-01 12:45:15 +03:00