Commit Graph
3073 Commits
Author SHA1 Message Date
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
Ivan Starkov 47aa6d88be Remove framer-motion for a link list add collapsible (#910)
## Description

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

Share list uses Collapsible instead of Framer motion

## Steps for reproduction

Click Share button, see expand of list items

## 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 13:24:25 +04:00
Ivan Starkov 8e5d0a2186 Shared tokens UI + Api (#894)
## Description

ref #548

Add shared links with builder/viewer permissions.

`editor` permission is now disabled as we don't know a simple way to
allow editing images and text only cc @TrySound would need your opinion
on this.

createTrpcRemixProxy now wraps input in `JSON.stringify` and unwraps
before the TRPC call. Otherwise, all params are FormData string entries
and may cause errors.

createTrpcRemixProxy useQuery/useMutation now returns Remix useFetcher
state parameter.


**`patch` auth call added, we must do any Auth mutate operations in a
single call, otherwise if some call failed we are in troubles.**
Example on token relation update.
Remove viewer relation.
Add editor relation. <- If the call failed here user just loses all
permissions.
In case of patch both operations are completed in a single transaction -
(delete+insert)





## Steps for reproduction

Having migrations works locally only with 
`isFeatureEnabled("share2")` flag.

Click the share button then add/rename/update/copy share links.

The previous Share button is removed.

**TODO In Next PR:**

Different UI for builder and viewer links i.e.
[this](https://github.com/webstudio-is/webstudio-designer/issues/548#issuecomment-1406947059).

## Code Review

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

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

## 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)
- [ ] 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 10:51:20 +03:00
Bogdan Chadkin f6f368898b Switch to utils for style management (#906)
Replaced manual array manipulations with array utils and reused styles
index to compute style info.

This will let to do less work when switch to build styles.
2023-02-01 00:52:50 +03:00
Bogdan Chadkin 02654371b5 Support multiple style sources in preview (#905)
Ref https://github.com/webstudio-is/webstudio-designer/issues/807

Designer data still rely on legacy style format though here I migrated
preview styles to combination of style source selections and styles from
build.
2023-01-31 18:02:25 +03:00
Oleg Isonen c4ae76c4bb Dashboard dialogs (#901)
## Description

1. This PR implements  a create project dialog
<img width="579" alt="Screenshot 2023-01-31 at 13 17 45"
src="https://user-images.githubusercontent.com/52824/215771142-7694a048-ba54-4d6e-94bf-befbdc94268c.png">



## Steps for reproduction

1. go to /dashboard
2. click create project

## 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-01-31 16:01:14 +01:00
Roman Pominov 4ad1a3f4b2 Floating panel refactor & new Popover & MenuItemButton (#902)
1. Fixed review comments from #857 (as discussed in dm)
2. Deprecated existing Popover 
3. Implemented new Popover (closes #824)
4. Added MenuItemButton (closes #866)
2023-01-31 12:27:46 +03:00
Ivan Starkov 26e8343851 Update remix (#903)
## Description

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

Seems like this killed my dev expierence

https://github.com/remix-run/remix/issues/3123

Fixed in 1.12 gonna try, as otherwise I have 100% cpu load, and need to
stop `pnpm dev` before any changes

## 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-01-31 12:13:37 +04:00
Roman Pominov e4b96bc50b Dialog component & other updates to design-system components (#857)
1. Implemented Radix/Dialog with styles of Figma / Floating Panel:
[Demo](https://dialog-and-button--638245578b47d4399fba191a.chromatic.com/?path=/story/library-floating-panel-dialog--dialog).
Closes #831
2. Implemented Radix/Popover with styles of Figma / Floating Panel:
[Demo](https://dialog-and-button--638245578b47d4399fba191a.chromatic.com/?path=/story/library-floating-panel-popover--popover)
3. Aligned Separator with Figma
4. Aligned Title with Figma
5. Fixed some issues in Button. Closes #829
6. Cleaned up how demos under Library look visually
2023-01-30 20:02:08 +03:00
Oleg Isonen 90ce5a06b1 Connection/queue status (#893)
Fixes https://github.com/webstudio-is/webstudio-designer/issues/863

## Description

Icon used is temporary, until we have a better one. We can merge this
because we only show it when offline, so most people won't see it
anyways.

- [x] check if the sync was successful, if not - don't remove it from
the queue (or put it back) . Right now we are optimistically removing
from the queue when syncing
- [x] after 3 unsuccessful attempts to sync - show the disconnected icon
- [x] add a tooltip (like in figma) that explains that we will sync as
soon as we are online again
- [x] use `addEventListener('offline'` event listener to explain in text
of the tooltip that internet is not available, otherwise assume by
default server is not available.
- [x] When there are unsaved changes and user tries to close the window
- use onbeforeunload to tell them about it and that they will loose the
unsynced changes otherwise (until we add offline capability to save
those and sync them once online)



https://user-images.githubusercontent.com/52824/215371856-2d76a364-3918-42b6-a4eb-9693c54d5690.mp4



## Steps for reproduction

1. go to chrome network and set connection to offline or go to the wifi
and turn it off (if you are not locally running the server)


## 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-01-30 16:56:45 +01:00
Bogdan Chadkin 6c4ea46521 Add buildId and projectId relations to Tree table (#895)
Ref https://github.com/webstudio-is/webstudio-designer/issues/742
https://github.com/webstudio-is/webstudio-designer/issues/807

Here I added build and project relations to Tree to have to improve auth
security and simplify access without parsing pages.

This is necessary to migrate styles into new style sources format.
2023-01-30 14:54:41 +03:00
Ivan Starkov df580ce304 Update remix (#892)
## Description

```bash
pnpm up -r -L '@remix-run/*' 
pnpm up -r -L 'react-router-dom'
```

`react-router-dom` removed.


## 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-01-30 08:23:08 +03:00
Ivan Starkov 6b2c50a183 Authorization (#836)
## Description

Add authorization layer to a project.

1. It introduces AppContext type inside `trpc-interface` project. As
this type can be shared across all projects.

2. `createContext(request):AppContext` is placed inside the designer app
it creates context and passes all params known on `remix/server` side
into authorization context.

3. Depending on env variables or SAAS trpc can be used or local so
`authorizationRouter` is a small wrapper around Zanzibar Ory Keto at
SaaS, and implements some subset of ORY operations here.

4. Checks are done on `db` level scripts.

5. On the saas side trpc wrapper around ory is already implemented and
can be checked after this will be merged.

Not everything is checked right now. Should be added later with some
caching at least during single request.

Also not this for this PR.

UI should be different for users with read/edit permissions. Also non
owners can't share links etc



TODO:
- [ ] - Migration - preview token creation for existing projects.

OSS Permission emulates following ORY schema, but without implementing
adding viewers editors etc.

```ts
/**
 * !!! THIS IS NOT typescript code !!!
 * This is Ory permission language (small subset of typescript)
 * https://www.ory.sh/docs/keto/guides/userset-rewrites
 * https://www.ory.sh/docs/keto/reference/ory-permission-language
 *
 * See .prettierrc semicolons are disabled, as it breaks ory language parser (fixed but not in cloud)
 **/

import { Namespace, SubjectSet, Context } from "@ory/keto-namespace-types"

class User implements Namespace {}

class Token implements Namespace {}

class Email implements Namespace {
  related: {
    owner: User[]
  }
}

class Project implements Namespace {
  related: {
    owner: User[]
    editors: (Token | User | SubjectSet<Email, "owner">)[]
    viewers: (Token | User | SubjectSet<Email, "owner">)[]
  }

  /**
   * Relation rewrites:
   * For example if User:AliceUUID is owner of Project:AliceProjectUUID, then
   * we return Allowed for all 3 checks
   * `keto check User:"AliceUUID" own Project "AliceProjectUUID"`
   * `keto check User:"AliceUUID" edit Project "AliceProjectUUID"`
   * `keto check User:"AliceUUID" view Project "AliceProjectUUID"`
   * But if User:"BobUUID" is viewers of Project:AliceProjectUUID, then
   * `keto check User:"BobUUID" view Project "AliceProjectUUID"` returns Allowed
   *
   * `keto check User:"BobUUID" edit Project "AliceProjectUUID"` returns Denied
   * `keto check User:"BobUUID" own Project "AliceProjectUUID"` returns Denied
   **/
  permits = {
    view: (ctx: Context): boolean =>
      this.related.viewers.includes(ctx.subject) ||
      this.related.editors.includes(ctx.subject) ||
      this.related.owner.includes(ctx.subject),

    edit: (ctx: Context): boolean =>
      this.related.editors.includes(ctx.subject) ||
      this.related.owner.includes(ctx.subject),

    own: (ctx: Context): boolean => this.related.owner.includes(ctx.subject),
  }
}
```




## Steps for reproduction

1. click button
6. expect xyz

## Code Review

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

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

## 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)
- [ ] 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-01-29 16:57:01 +03:00
Bogdan Chadkin b99d4bb308 Fix undo/redo when input is focused (#888)
Ref https://github.com/webstudio-is/webstudio-designer/issues/755

react-hotkeys by default prevents reacting when native elements are
focused. Here I globally enabled input, select and textarea for both
designer and canvas to catch undo/redo while focused.
2023-01-29 14:02:56 +03:00
Bogdan Chadkin 9221c23234 Delete instance styles and props (#887)
Ref https://github.com/webstudio-is/webstudio-designer/issues/828

Delete instance along with own and descendants styles and props.
This will let us to avoid bloating db with unused data.
2023-01-29 14:02:36 +03:00
Oleg Isonen e925d26bc9 Delete design tokens prototype (#873)
## Description

1. With all the new ideas and directions we don't need that initial
implementation

## 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-01-28 18:05:53 +01:00
Bogdan Chadkin 8d95c14f28 Fix copy paste of props and styles (#885)
Copy/paste of props and styles was broken while converting to normalized
data. Here fixed both by providing new instanceId.
2023-01-28 19:28:07 +03:00
Oleg Isonen dbaa617dca Ensure tab works on the flex grid control as a single control (#874)
Closes https://github.com/webstudio-is/webstudio-designer/issues/736

## Description

Before that you would have to tab through every knob from inside the
flex grid control to get to the next element. For now we are making it
just tabbable as a single thing. Later we can add arrow keys.

Also aligned colors with figma.

## Steps for reproduction

1. Make some element to flex container
2. Focus search on style panel
3. start tabbing, make sure you can tab through all controls in the flex
UI, like you would expect

## 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-01-28 16:23:21 +01:00
Bogdan Chadkin 8635dc6755 Switch to normalized props on server (#883)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Now all props is migrated on client side, we can drop legacy store and
switch to new format server side.
2023-01-28 15:24:23 +03:00
Bogdan Chadkin ff049a000c Inject props store to sdk (#871)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

We use store to render props in sdk components. Though it's easier to
maintain actual store in designer and provide necessary data to sdk.

Here I added utilities to inject computed store on module level. Now we
can get rid of legacy store and rewrite rest api to use normalized
props.
2023-01-28 10:48:13 +03:00
Bogdan Chadkin 56222a2759 Get rid of lib folder in designer app (#870)
This folder is killing me because I ignored lib globally because fzf/ag
(fuzzy search in my editor) cannot parse `packages/*/lib` in gitignore.
2023-01-28 10:43:39 +03:00
Oleg Isonen cba726a58f Share UI (#867)
## Description

Share UI implemented as a story



https://user-images.githubusercontent.com/52824/215069285-0ee7b214-8218-4ead-a468-07a22f65e433.mp4



## Steps for reproduction

1. open stories in designer
2. share project section

## Code Review

- [ ] hi @rpominov , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview
- [ ] hi @istarkov, please check if the interface I made fits the data
layer you built

## 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-01-27 18:38:58 +01:00
Bogdan Chadkin 3f4cc69976 Migrate designer to normalized props (#868)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Here added normalized props logic to transactions and replaced
useAllUserProps with computed store.
2023-01-27 17:02:53 +03:00
Andras Bacsai a9b2fdb7ed Merge pull request #862 from webstudio-is/cf-pages-integration
Bump designer version to be in sync with other components
2023-01-27 10:11:26 +01:00
Bogdan Chadkin bf50c0c547 Move project build schema into separate package (#864)
The new package will be responsible for schema and db access to all
build and tree data.

Decoupling will let us make sdk and project thinner.
2023-01-26 21:03:17 +03:00
Bogdan Chadkin 185fb27c85 Treat component name as generic string (#861)
We want to decouple schema stored in db from sdk which generates a list
of components. Components will be added dynamically later so better
avoid component name enum.
2023-01-26 17:33:26 +03:00
Andras Bacsai 16fcce1a68 Merge branch 'main' into cf-pages-integration 2023-01-26 14:56:53 +01:00
Oleg Isonen 6fbc8813e5 More dashboard tweaks (#855)
## Description

Styling in dashboard card

## Steps for reproduction

1. go to /dashboard

## 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-01-26 13:16:07 +01:00
Bogdan Chadkin 2e10e164f5 Bump shallow-equal (#853)
Ref https://github.com/moroshko/shallow-equal

New release got types and builtin generic form for both objects and
arrays.
2023-01-26 13:06:38 +03:00
Roman Pominov 4a9c7842e6 Minor menu fixes (#852)
1. Fixed #851 
2. Cleaned up Menu usage in some other places
2023-01-26 12:14:53 +03:00
Oleg Isonen dd40f745a5 Dashboard styling (#849)
## Description

Styling tweaks

## Steps for reproduction

1. open /dashboard

## 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-01-25 22:33:23 +01:00
Oleg Isonenandistarkov e0cd48aab5 New dashboard has reached feature parity with the old one (#835)
## Description

This is not a complete dashboard implementation, but it can now list,
create and open projects, so it can be deployed to production and
replace the old version while we work on the remaining features.

In addition implemented: renaming, duplicating, deletion (mark as
deleted), keyboard accessibility


## Steps for reproduction

1. click on card to open the project in the designer
1. click on a link at the card bottom if project is published to open
published version
1. click on new project and create new project
2. click on rename over menu to rename
3. click on duplicate
4. click on delete
5. Use tab to switch between projects, use arrow keys to switch between
focusable elements inside the project card

## Code Review

- [ ] hi @rpominov , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview
- [ ] hi @istarkov, we need to discuss how we want to build the future
APIs with TRPC and probably rewrite what I did here right away

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

Co-authored-by: istarkov <istarkov@gmail.com>
2023-01-25 21:17:50 +01:00
Bogdan Chadkin aba909ad63 Drop preset styles from db (#848)
After discussing with @kof figured we do not need to store preset styles
in db as after sdk upgrade components may still break.

Sdk versioning along with its hardcoded values will solve the problem
better.
2023-01-25 18:55:11 +03:00
Roman Pominov ee8e1bedd3 Menu design update (#799)
Closes #798.

I've implemented "Menu" and "Menu item" from Figma and updated our
components that use menus.

TODO at some later point:

  - Component: "Menu Item Large"
  - Type of "Menu" component: "Dropdown w/large items"
  - Type of "Menu" component: "Context menu"
2023-01-25 16:51:43 +03:00