Commit Graph
5224 Commits
Author SHA1 Message Date
Oleg IsonenandRoman Pominov f9f64934db Style source input (#776)
## Description

1. color coding of style sources, handling DoubleClick and ESC
<img width="376" alt="Screenshot 2023-01-13 at 00 20 18"
src="https://user-images.githubusercontent.com/52824/212208704-df1aa071-7f67-43b8-9e1a-c4986b2c80d5.png">


## Steps for reproduction

1. open storybook
3. double click to edit name
4. esc to revert editing
5. new colors and states

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

Co-authored-by: Roman Pominov <rpominov+github@gmail.com>
2023-01-13 13:35:07 +01:00
Roman Pominov 9ff254bd2a Add action that re-creates figma-tokens branch when it gets deleted (#781)
See https://discord.com/channels/955905230107738152/1063389035705401386
2023-01-13 15:24:49 +03:00
Bogdan Chadkin 3abb54a875 Migrate to nanostores (#779)
Ref https://github.com/nanostores/nanostores

Nanostores is another open source implementation of reactive states.
Supports a lot of frameworks and provides useful utilities like computed
stores. Api is slightly different

```
store.get(): Value
store.set(value: Value)
```

`useStore` resolves only value so I temporary added custom `useValue` to
not rewrite whole project. Since we gonna use computed atoms it makes
more sense to invoke useStore where atom value is used instead of
reusable hook.
2023-01-13 15:13:40 +03:00
Bogdan Chadkin 44a7083fde Drop css rules from instance (#775)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Finally got rid of legacy instance.cssRules.
Removed style utils for working with tree.
Now will be easier to normalize tree.
2023-01-13 13:04:21 +03:00
Roman Pominov 5fac01020f Update Button (#751)
New `Button` implementation based on the component in Figma. Closes #450
2023-01-13 09:43:30 +03:00
Oleg IsonenandRoman Pominov 0f90b779f7 Current item in style source UI (#774)
## Description

1. Now we can pass currentIndex and user can click on an item to make it
current.

## Steps for reproduction

1. open style source UI in stories
2. click item to make it current

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

Co-authored-by: Roman Pominov <rpominov+github@gmail.com>
2023-01-12 23:05:48 +01:00
Bogdan Chadkin 145155f12e Use normalized styles in style panel (#773)
Here rewritten style info computing with normalized styles list. Was
able to get rid of sending element css rules from canvas.
2023-01-13 00:14:54 +03:00
5d88734142 Sync figma tokens (#772)
Co-authored-by: Oleg Isonen <oleg008@gmail.com>
Co-authored-by: Taylor Nowotny <86495896+taylornowotny@users.noreply.github.com>
2023-01-12 14:08:05 +03:00
Bogdan Chadkin 2c3027d10b Improve size section layout according to design (#760)
Ref https://github.com/webstudio-is/webstudio-designer/issues/759

Spacing a little not clear so wrapped with common grid

<img width="237" alt="Screenshot 2023-01-10 at 16 55 40"
src="https://user-images.githubusercontent.com/5635476/211570996-0c3349ee-a4d7-4b95-9143-2afd8436da2d.png">
2023-01-12 13:00:03 +03:00
Bogdan Chadkin 9ec401f834 Update store in style panel directly (#771)
Before we sent messages from designer to canvas, patched data and sent
whole data back to designner.

This created latency so we had to keep local state and synchronize it
with effects.

Here I patched store and used its state in designer which is same as
local state. So we no longer need effect synchronization (and bugs
because of it).
2023-01-12 12:49:34 +03:00
Oleg IsonenandRoman Pominov 6a5fa7822a Sortable style source items (#770)
## Description

1. This adds ability to drag&drop style source items

## Steps for reproduction

1. open stories
2. get 2+ items
3. start dragging

## Code Review

- [ ] hi @rpominov , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
- help finish the sortable implementation: restrict drop targets, maybe
add a preview item to the draggable, can go without it though for now



## 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: Roman Pominov <rpominov+github@gmail.com>
2023-01-12 10:21:58 +01:00
Bogdan Chadkin a00460fbe8 Synchronize transactions created in designer (#768)
We finally can change states connected to immerhin from designer. Here I
added subscription to designer changes and fixed cyclic events with new
"source" parameter provided on transaction creation.
2023-01-11 22:06:50 +03:00
Oleg Isonen c7d7ede59a Implement disable function for style source input (#761)
## Description

1. Added a way to disable/enable style source item

## Steps for reproduction

1. source item menu > disable
2. source item menu > enable

## Code Review

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

## 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)
- [x] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [x] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-01-11 11:26:03 +01:00
Bogdan Chadkin 6387029b3c Synchronize canvas store with designer (#762)
Here used immerhin subscribe method to send patches from canvas to
desiger instead of uploading full states when their value is changed.

Syncrhonization is still one-way. Need more changes in immerhin to make
two-way patches work.
2023-01-11 13:15:43 +03:00
Oleg Isonen 9afd279797 Style source input (#752)
## Description

Final goal is this UI
https://www.figma.com/file/EfzZ2w94KpmUviZJSBgxCd/%F0%9F%92%AD-Webstudio-Design-Work?node-id=4059%3A31089&t=OfXAB2MIAR7fyjfC-0

This is not complete by far, so far added functionality:

- [x] Menu
- [x] Rename
- [x] Duplicate
- [x] Remove
- [x] Edit directly in the style source
- [x] Allow renaming on click on style source item

## Steps for reproduction

[1. see
video](https://user-images.githubusercontent.com/52824/211120782-07d75fd0-4fcc-4676-8411-3a5966ee2e2c.mp4)


## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
- [ ] hi @rpominov , I need you to do
  - 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-09 17:26:59 +01:00
Bogdan Chadkin 8a691b92d1 Update normalized styles directly (#757)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Migrated updating and rendering to normalized styles. There are still a
few cases to migrate so left legacy root instance updates.

Styles are updated with immerhin consistently with whole project.

Can be tested changing styles and deleting breakpoints.
2023-01-09 12:17:20 +03:00
Bogdan Chadkin 7d90c3f56c Bump packages (#753)
Gonna be big release.
2023-01-06 17:31:39 +03:00
Bogdan Chadkin 6387accf0d Render static css from normalized styles (#750)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Gradually starting to migrate to new styles format. Here replaced
getCssRules and getPresetStylesMap with getStyleRules and
getPresetStyleRules utilities.

Will reuse both at once on release.
2023-01-06 16:44:03 +03:00
Bogdan Chadkin 7c5c737bfb Normalize styles in database (#749)
Ref https://github.com/webstudio-is/webstudio-designer/issues/696

Here only migration and transforms for load and patch. Styles have the
following type and stored in Tree.styles column.

```
Array<{
  breakpointId: string,
  instanceId: string,
  property: StyleProperty,
  value: StyleValue
}>
```

Did migration with cursor pagination with 1000 trees per transaction.
2023-01-06 14:38:21 +03:00
Bogdan Chadkin f72b7452b8 Fix publish build (#748)
Publish workflow ran turbo build directly which broke after remix
upgrade with broken build.
2023-01-05 22:34:25 +03:00
Bogdan Chadkin f2a851cb5b Bump remix to 1.9.0 (#740)
- https://github.com/remix-run/remix/releases/tag/remix%401.8.0
- https://github.com/remix-run/remix/releases/tag/remix%401.9.0

Build issue still not fixed
(https://github.com/webstudio-is/webstudio-designer/pull/725)
2023-01-05 21:27:55 +03:00
Bogdan Chadkin d79c96566b Store preset style separately from tree (#724)
Before we populated preset style on instance creation. This does not let
us to distinct preset style from local one.

As an option we could use preset style hardcoded in meta though this may
affect user when we change defaults.

Here I added presetStyle column in Tree table with the list of styles
for component.

```
Array<{
  component: string,
  property: string,
  value: StyleValue
}>
```

Will style controls as grey for such styles.
2023-01-05 21:27:33 +03:00
Roman Pominov 91e209e974 rename Spacing to Space (#745)
Renamed Spacing section to Space in code and in UI
2023-01-05 14:59:32 +03:00
Bogdan Chadkin f076352b29 Fix linked flex gap and replace icons (#737)
Ref https://github.com/webstudio-is/webstudio-designer/issues/538
https://github.com/webstudio-is/webstudio-designer/issues/537

Refactored linked (renamed from lock) gap. Watching values with effect
is replaced with changing row/column values in inputs callbacks.

Had to use css value input directly to maintain intermediate value for
both inputs while scrubbing.
2023-01-05 13:45:21 +03:00
Roman Pominov 1d69f953a0 Remove tokens file from the old location (#739) 2023-01-05 12:57:19 +03:00
Roman Pominov 62d870ad8e Use tokens from Figma in Stitches (#728)
Design tokens from Figma are now available in Stitches
2023-01-05 12:22:05 +03:00
Bogdan Chadkin 5fe9364cb1 Improve units in style panel (#735)
Ref https://github.com/webstudio-is/webstudio-designer/issues/366

- generate grouped units for non length values
- show unit select when initial unitless

So we get all 3 points from the issue

- all properties has only supported units
- hidden but supported units still can be entered
- unsupported values are validated

<img width="243" alt="Screenshot 2023-01-04 at 14 12 29"
src="https://user-images.githubusercontent.com/5635476/210546684-ca696096-f78c-445f-bbc3-04db7326239b.png">
<img width="224" alt="Screenshot 2023-01-04 at 14 14 54"
src="https://user-images.githubusercontent.com/5635476/210546689-396c7d42-e6f0-42a9-869c-7b231baa3d71.png">
2023-01-04 18:20:15 +03:00
Roman Pominov bf75cbb664 Keyboard support in spacing control (#723)
## Description

Adds keyboard support to the Spacing control. Closes #666

## Steps for reproduction

1. Focus spacing control using TAB
2. Blue outline should appear and "Margin Top" should get highlighted
3. Arrow keys should change highlighted item
4. `Enter` should open popover for the highlighted item
6. Mouse navigation should still work when control is focused
2023-01-04 15:28:10 +03:00
Bogdan Chadkin cdba1c7149 Fix unitless initial values (#734)
Ref https://github.com/webstudio-is/webstudio-designer/issues/366

There were many unitless initial values with "px" unit. Here I extracted
all possible unit types from properties syntaxes. csstree provides a
list of unit groups which in the future will let us provide correct list
of units for css value input.
2023-01-04 13:57:54 +03:00
Oleg Isonen 9dfef774e3 Add a stylesheet name for easier debugging (#731)
## Description

Multiple style elements are easier to differentiate when they have some
hint on the purpose

## Steps for reproduction

1. select style element on canvas, see data-webstudio attribute with a
name

## Code Review

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

## 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)
- [x] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [x] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2023-01-03 21:39:25 +01:00
Mateusz Burzyński 28a2d85465 Tweak Instance type (#732) 2023-01-03 21:27:25 +01:00
Bogdan Chadkin 81194d8422 Remove incorrect keywords from generated data (#730)
While fixing units found a lot of keywords appear from css functions
which are complex values and should be ignored. So here I changed
traversing of properties syntaxes to support only top level values and
keywords.

Mostly gone color words

```diff
-6639 lines  116 KB
+4808 lines  85.8 KB
```

See diff for more info
2023-01-03 23:23:04 +03:00
Bogdan Chadkin 5a2b3b8eec Parse properties initial value (#726)
Ref https://github.com/webstudio-is/webstudio-designer/issues/366

Parsed initial values to get correct unit instead of px for some
properties. There is still edge case with unitless values I'm gonna fix
in another PR.

Also bumped mdn-data and removed overrides fixed on mdn side.
2023-01-03 19:57:16 +03:00
Bogdan Chadkin 9c71929b25 Upgrade to remix 1.7.6 (#725)
https://github.com/remix-run/remix/releases/tag/remix%401.7.0
https://github.com/remix-run/remix/releases/tag/remix%401.7.4

du -ckd1 node_modules
-795648
+798524

Not much changes though I found since
[1.7.5](https://github.com/remix-run/remix/releases/tag/remix%401.7.5)
build started to hang when run with turbo or recursive pnpm run.

Looks like in this commit some stream or connection not closed when
build is finished.

https://github.com/remix-run/remix/pull/4410

Let's see if not fixed in newer versions and then file an issue.
2023-01-03 18:24:44 +03:00
Roman PominovandOleg Isonen 97c1564437 Figma tokens sync (#727)
Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-01-03 13:57:51 +03:00
Ivan Starkov d73ec1b459 Do not show flex properties in style panel when layout is not flex (#722)
## Description

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

Do not show flex properties in the style panel when a layout is not flex
closes #687

<img width="272" alt="image"
src="https://user-images.githubusercontent.com/5077042/210067036-4571be1d-4745-48a3-be7f-45f91791a6a9.png">

Here I patched `appliesTo` of properties `alignItems`, `justifyItems`
see https://github.com/mdn/data/issues/585

## Steps for reproduction

Opens designer panel, check no flex props in display: block layout

## 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-02 14:15:33 +03:00
Bogdan Chadkin eacbd7d702 Show in popover where remote style comes from (#715)
Ref https://github.com/webstudio-is/webstudio-designer/issues/29

Here added info in popover where cascaded and inherited styles come
from.

<img width="304" alt="Screenshot 2022-12-28 at 14 47 01"
src="https://user-images.githubusercontent.com/5635476/209816321-edeebc17-c905-497e-8501-f5eb02103c60.png">
<img width="243" alt="Screenshot 2022-12-28 at 14 47 07"
src="https://user-images.githubusercontent.com/5635476/209816325-abdc766d-f8cb-415d-b784-ed70940aa150.png">
<img width="281" alt="Screenshot 2022-12-28 at 14 47 19"
src="https://user-images.githubusercontent.com/5635476/209816327-cc5bc70b-3c76-4273-867b-b13c32c1522a.png">
<img width="268" alt="Screenshot 2022-12-28 at 14 47 47"
src="https://user-images.githubusercontent.com/5635476/209816329-dd2d674f-39bd-4565-ab43-249c853909b3.png">
2022-12-31 11:33:10 +03:00
Ivan Starkov a9eb17fb5d Fix select options case (#721)
## Description

closes #465

Select option names are now "Pascal Cased"
`+` now `Select` sets `StyleValue` instead of deprecated `string` in
`setParams`

## Steps for reproduction

see  #465

## Code Review

- [x] 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
2022-12-30 20:02:38 +03:00
Oleg Isonen 44a53109fe Style panel css value input layout was broken (#720)
## Description

because we removed width:100% from input it seems like ideal strategy is
to always have minWidth: 0 defined since it just fixes flexbox
everywhere

## Steps for reproduction

1. open style panel


## Code Review

- [ ] hi @istarkov , 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-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
2022-12-30 16:42:43 +01:00
Roman Pominov 0d4a3ef0ed Support option/shift in spacing's scrub (#717)
## Description

Adds option / shift support to scrub in spacing. Closes #668

## Steps for reproduction

- Try to scrub in spacing while holding SHIFT or OPTION (ALT in Windows)
- Try to press and release SHIFT / OPTION multiple times during scrub
- Try to press SHIFT / OPTION while hovering over a property (other
properties will highlight even without scrub)
2022-12-30 13:30:49 +03:00
Musi 4817778649 Fix selected breakpoint to delete (#718)
Issue:
Breakpoints panel suggests delete currently selected instead of specific
breakpoint #691

## Description

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

## Steps for reproduction

1. click edit breakpoint in top bar
2. delete other breakpoint than the currently selected
3. expect to show the message to delete the breakpoint and not the
currently selected in the confirm message

## Code Review

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

## Before requesting a review

- [x] made a self-review

## Before merging

- [x] tested locally
- [x] tested on preview link
2022-12-30 09:37:53 +01:00
Ivan Starkov 787978e4b5 Restrict assets uploading by MAX_ASSETS_PER_PROJECT env variable (#714)
Set at VERCEL env 
<img width="930" alt="image"
src="https://user-images.githubusercontent.com/5077042/209917100-86d1f7e9-a5ca-4aaa-a877-456850fa5153.png">


## Description

Restrict assets by MAX_ASSETS_PER_PROJECT env variable.

## Steps for reproduction

- [x] - set MAX_ASSETS_PER_PROJECT = 4 as env variable for Vercel

Try upload more than 4 files.
Get Error: "`Max ${count} assets per project reached`"

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - test it on preview
- [ ] hi @TrySound plz check code

## 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
- [x] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2022-12-30 11:37:42 +03:00
Ivan Starkov f9996fe195 Fix css input (scrub, etc) Beautify options and input for css-value-input (#716)
## Description

ref #465 for css-value-input

Add beauty names to keywords, a little bit better search for keywords.

+ Fixes non-working scrub.
+ Fixes jumping cursor.


## Steps for reproduction

1.
Write `min-content` inside `width` field - All options you see must have
`Pascal Case`
Select value through menu - inputValue must be also in `Pascal Case`

2.
Edit width input, write `Min Content`, and click Enter - must be saved
with `Min Content` value.
(internally must be keyword with value=`min-content`) 

3.
Edit width input, write `min-content`, and click Enter - must be saved
with `Min Content` value.
(internally must be keyword with value=`min-content`) 

4. 
Write `min content`, click tab - must be saved with `Min Content` value.
(internally must be keyword with value=`min-content`)

5. Edit input in any place of cursor it must not jump to the end.


## Code Review

- [ ] hi @kof, I need you to do
  - test it on preview

## Before requesting a review

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

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [x] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2022-12-29 10:15:35 +03:00
Bogdan Chadkin 42c1ef8285 Show remote style source in UI (#713)
Added remote (ex inherited) highlight for controls.
Migrated menu control to new icon button.

<img width="228" alt="Screenshot 2022-12-28 at 11 17 00"
src="https://user-images.githubusercontent.com/5635476/209782189-9aa4b8e6-f7a6-4f90-9579-56a0c1d86bf7.png">
<img width="232" alt="Screenshot 2022-12-28 at 11 17 36"
src="https://user-images.githubusercontent.com/5635476/209782191-6a84c61f-c0c5-4892-ae3b-0f8480f2d49d.png">
<img width="232" alt="Screenshot 2022-12-28 at 11 18 36"
src="https://user-images.githubusercontent.com/5635476/209782192-e9ce0fcc-6d70-40c8-a2a7-91d7dea2f0a1.png">
<img width="219" alt="Screenshot 2022-12-28 at 11 24 46"
src="https://user-images.githubusercontent.com/5635476/209782195-dc794dcb-2ac6-4703-8ecf-2fca511f4306.png">
2022-12-28 15:58:27 +03:00
Bogdan Chadkin 6f1df5378d Fallback to cascaded and inherited when value not set (#712)
Ref https://github.com/webstudio-is/webstudio-designer/issues/29
https://github.com/webstudio-is/webstudio-designer/issues/649

Now instead of showing computed styles which come from parent instances
or other breakpoints we can show actual value we set there.
2022-12-28 09:23:58 +03:00
Oleg Isonen 2f0ac59895 Style Source Input (#692)
#422 

## Description

This PR adds the StyleSourceInput component. It's not complete yet and
when we are finished we might move a lot of this logic to combobox, not
sure yet, because it depends on how much custom stuff we are going to
need in this input. MUI implements it using combobox and `multiple`
property but we may need some stuff that won't fit.

- [x] Add new items
- [x] Delete items with backspace
- [x] Truncate too long items
- [x] Autocomplete

Follow up PR will include

- [ ] Use color coding for background color
- [ ] Create a token from style panel
- [ ] Select an existing token from style panel
- [ ] Delete Token from style panel with backspace
- [ ] Sort tokens
- [ ] Enable/disable a source
- [ ] Rename using menu
- [ ] Delete using menu
- [ ] Disable deleting local source
- [ ] Sort the sources using d&d

## Steps for reproduction

1. Go to
https://www.chromatic.com/component?appId=6382151c8b47d4399fb9fc69&csfId=designer-features-style-panel-style-source-input--initial&buildNumber=532&k=63ab0f47f9dfa67d6ee09558-1200-interactive-true&h=17&b=-4

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

- [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)
- [x] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [x] added tests
- [x] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2022-12-27 22:04:20 +01:00
Ivan Starkov b17b22276d Add status field to assets table (#711)
## Description

I need this filed in the following PR, to count assets before upload.
And restrict the total number of assets per project.

## Steps for reproduction

## Code Review

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

## 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
2022-12-28 00:02:53 +03:00
Ivan Starkov c8bd38d9fb Add assets upload restriction 1 file per request (#710)
## Description

As of now it's possible to directly upload via rest multiple files. 
The issue is that to get files count in request we need to parse
request.
Here I restrict uploading to just 1 file on request.

Next PR: Restrict file count per project.

Use hide whitespaces for review.

<img width="331" alt="image"
src="https://user-images.githubusercontent.com/5077042/209684306-c1917dcb-7a57-4cb4-9a15-f0d06e0eca53.png">


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

- [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
2022-12-27 23:40:58 +03:00
Bogdan Chadkin 9020f389f5 Use style info to display "local" values in style panel (#709)
This is a simplification. Since we already pass style info everywhere it
can be used to color labels, buttons and icons in blue instead of
recomputing local state with hook.
2022-12-27 20:35:05 +03:00
Bogdan Chadkin fc25ad1179 Add style info with source data (#704)
This is a step toward
https://github.com/webstudio-is/webstudio-designer/issues/29

When merge browser style and local styles we can specify the source of
the style. Later we can add additional info about inherited and cascaded
styles.
2022-12-27 15:50:16 +03:00