Commit Graph
1054 Commits
Author SHA1 Message Date
Bogdan Chadkin ff7c1c923e Install missing deps with types (#647)
In https://github.com/webstudio-is/webstudio-designer/pull/646 I checked
with build. Now found more issues with typescript.

Also forgot to migrate to jest/globals "project" package.
2022-12-17 11:41:34 +03:00
Oleg Isonen 703a9fe215 Merge pull request #639 from webstudio-is/621-smallest-breakpoint-should-start-from-0
Start the smallest breakpoint at 0
2022-12-16 18:35:38 +00:00
Bogdan Chadkin 3d3b7e6d80 Install missing deps and restrict ranges (#646)
Pnpm helped to find a few dependencies were missing in projects. Some
root deps with "*" versions restricted to simplify upgrade and prevent
unwanted upgrade while migrating to pnpm.
2022-12-16 17:38:27 +03:00
Bogdan Chadkin 752768abbc Use explicit imports from @jest/globals (#645)
pnpm prevents access to jest and @types/jest from packages so we need to
explicitly install it. Though @types/jest is not officially maintained
and often late for months with new major which bloats node_modules with
two versions of jest transitives.

Here is alternative way to use official types. The only downside is
complains these types has less descriptions.
2022-12-16 16:35:22 +03:00
Oleg Isonen b79df63f33 Merge branch 'main' into 621-smallest-breakpoint-should-start-from-0 2022-12-16 13:33:25 +00:00
Roman Pominov dcd7d8c43a Fix performance issue with scrub when used inside popover (#633)
https://discord.com/channels/955905230107738152/1052545317922406440

> so the problem is useScrub wants to remove focus from input:
https://github.com/webstudio-is/webstudio-designer/blob/c70d9ff21a64da12a0562d046246a5e359d556e9/apps/designer/app/designer/features/style-panel/shared/css-value-input/css-value-input.tsx#L111

> but popover wants to keep focus inside content while it's open (not
configurable):
https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/popover/src/Popover.tsx#L261-L263

> and they fight
2022-12-16 14:13:48 +03:00
Bogdan Chadkin d05b1bc21f Resolve tsconfig package (#643)
While migrating to pnpm I got an issue with our extends relying on
node_modules. pnpm have only symlinks and do not have hoisted
node_modules in the root.

Here I switched extends to package name as all tools can resolve it and
tweaked remix tsconfig to extend from packages folder instead of
node_modules.
2022-12-16 13:09:33 +03:00
Oleg Isonen 4cf8090a25 Merge branch 'main' into 621-smallest-breakpoint-should-start-from-0 2022-12-16 09:07:03 +00:00
Ivan Starkov 124f96ebe9 Fix images appears disappears during upload/delete. (#623)
closes #605

`useAssets` now use Provider to be sure that state (server data load)
updates will not be lost.


- [ ] Set random upload errors locally, and test that even with errors
it will work.

Changed Client types from instersected server Asset types to include
Asset i.e.
was 
```
type ReviewAsset = Asset & { status: 'uploading', ... }
```
now
```
export type UploadedClientAsset = {
  status: "uploaded";
  asset: Asset;
  preview: PreviewAsset | undefined;
};

export type UploadingClientAsset = {
  status: "uploading";
  asset: Asset | undefined;
  preview: PreviewAsset;
};

export type DeletingClientAsset = {
  status: "deleting";
  asset: Asset;
  preview: PreviewAsset | undefined;
};
```

As previous behavior was hard to manage, were mistakes like adding
client-only props to the Asset type. It was hard to add additional props
like having preview and asset simultaneously (will be needed in next PR
to avoid image flicker)
2022-12-15 22:35:32 +03:00
Oleg Isonen 7f62539435 start the smallest breakpoint at 0 and use the upper bound to set the canvas size 2022-12-15 18:09:04 +00:00
Roman Pominov 90b00fc36a Scrub fixes (#636)
- Fixed #626
- Limited movement of cursor to just one coordinate. Not sure it's a
good idea, but currently in `main` we move both coordinates for
"horizontal" but only one for "vertical", so I've made it consistent.

## Before requesting a review

- [ ] if the PR is WIP - use draft mode
- [x] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
- [ ] what kind of review is needed?
  - [x] conceptual
  - [ ] detailed
  - [ ] with testing

## Test cases

- [ ] step by step interaction description and what is expected to
happen

## 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-15 17:36:53 +03:00
Bogdan Chadkin 122bd8adb5 Track selected rect close to element (#627)
Ref https://github.com/webstudio-is/webstudio-designer/issues/598

When tracking selected element from the root it's hard to get current
element which can be changed with props.

One more issue is storing element in state doubles amount of renders and
in selected instance logic we have a chain of state -> effect -> state
-> effect cases.

Here I store element in ref so we avoid rerender when set element to
state. Then tracked element rect is not written to state and sent to
designer directly.

Since the effect is unmounted along with element we do not need to use
mutation observer to track parent changes and can just recompute rect on
remount.
2022-12-15 16:01:40 +03:00
Bogdan Chadkin 1459fd7cbd Remove treeId from props updates (#635)
Will help with
https://github.com/webstudio-is/webstudio-designer/issues/628

treeId is stored in every props update which complicates data flow and
requires passing it everywhere. Here I instead pass it inside of
transaction.

This allowed us pass undefined in props data when select instance so we
no longer need to create empty instance props. Updates will create it
lazily.
2022-12-15 15:56:27 +03:00
Oleg Isonen 142fbda626 defaultStyle presetStyle 2022-12-14 23:51:01 +00:00
Ivan Starkov af90b31945 Bump versions (#616)
## Before requesting a review

- [ ] if the PR is WIP - use draft mode
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
- [ ] what kind of review is needed?
  - [ ] conceptual
  - [ ] detailed
  - [ ] with testing

## Test cases

- [ ] step by step interaction description and what is expected to
happen

## 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-12 23:56:10 +03:00
Mateusz Burzyński 35af8358e9 Move @webstudio-is/design-tokens to @webstudio-is/react-sdk prod deps (#602)
This should fix the problem reported on this line:
https://github.com/webstudio-is/webstudio-saas/actions/runs/3657427162/jobs/6181006430#step:6:52
, cc @andrasbacsai

Even though [you only reach for a
type](https://github.com/webstudio-is/webstudio-designer/blob/1a66acb79c8c560b3a54b55512c2779991a68eff/packages/react-sdk/src/tree/root.ts#L11),
you still should declare this package among your dependencies -
otherwise, it won't be installed by your consumers and thus the TS
compilation will fail for them.
2022-12-12 15:44:32 +01:00
Bogdan Chadkin aba5506e13 Add proprety reset button in popover (#583)
Ref https://github.com/webstudio-is/webstudio-designer/issues/29

<img width="281" alt="Screenshot 2022-12-10 at 12 03 54"
src="https://user-images.githubusercontent.com/5635476/206842519-5812b7d5-2c60-4941-93a7-8a980f6abae0.png">
2022-12-12 15:11:24 +03:00
Oleg Isonen 1a66acb79c fix the type 2022-12-12 11:39:54 +00:00
Ivan Starkov 12a3da3140 Bump versions 2022-12-12 14:17:23 +03:00
Ivan Starkov 54f16748d2 Fix switch 2022-12-12 13:51:29 +03:00
Ivan Starkov 1ac167d959 Add initial props 2022-12-12 00:14:43 +03:00
Oleg Isonen 83033f25b3 Merge branch 'main' into 592-font-family-button-changes-size 2022-12-11 14:45:39 +00:00
Oleg Isonen 1a7a7381b4 minWidth also fixes the problem with disrespecting layout contraint 2022-12-11 14:45:07 +00:00
Bogdan Chadkin 0620b5bd08 Setup custom hotkeys for sidebar tree (#594)
Ref https://github.com/webstudio-is/webstudio-designer/issues/579

useHotkeys blocks escape for whole app which breaks radix select as
well. Here I replaced it with onKeyDown on tree root which localized all
interactions.

Ideally remove useHokeys with all its implicit logic everywhere else.
2022-12-11 17:39:53 +03:00
Oleg Isonen 24ea4f8dae with more text button was becoming larger even though the layout has a constraint 2022-12-11 14:10:54 +00:00
Bogdan Chadkin 7637d486a7 Redesign text toolbar (#567)
Ref https://github.com/webstudio-is/webstudio-designer/issues/555
https://github.com/webstudio-is/webstudio-designer/issues/107

Implemented icon button according new design,
added hover and disabled states for non-default variant.

Migrated text toolbar from toggle group to icon button.
Toggle between superscript and subscript.

<img width="285" alt="image"
src="https://user-images.githubusercontent.com/5635476/206522786-28cc6b7d-6336-4c13-8eb7-b83428598dcb.png">

<img width="315" alt="image"
src="https://user-images.githubusercontent.com/5635476/206523165-1b4a080d-0c8d-41a1-b5a9-47c197b78998.png">

<img width="197" alt="image"
src="https://user-images.githubusercontent.com/5635476/206521819-14c1fbb3-6c37-4264-8f7b-cef256b4ab23.png">
2022-12-09 21:50:21 +03:00
Ivan Starkov 6cc2847cf6 Bump versions (#582)
For easier version change next time, now all has same version.
2022-12-09 21:52:10 +04:00
Ivan Starkov 2be8511780 Add new RGB Style, then fix typescript errors (#578)
The reason of use opaque types, as otherwise props like `value` reused
everywhere.



Implemented same as CssValueInputLogic - during input editing nothing
changed.
Error is shown on Enter click. Value resetted on blur.
2022-12-09 20:31:20 +03:00
Oleg Isonen 3a00378d01 Merge branch 'main' into 536-when-only-one-image-is-too-large-let-others-upload 2022-12-09 14:58:04 +01:00
Oleg Isonen 4ed0a41a17 Merge branch 'main' into 536-when-only-one-image-is-too-large-let-others-upload 2022-12-09 11:28:27 +00:00
Oleg Isonen 6c9839d4f8 apparently Infinity - Infinity is NaN 2022-12-09 11:26:14 +00:00
Oleg Isonen c625298605 Merge branch 'main' into fix-media-query-specificity 2022-12-09 11:01:53 +00:00
Oleg Isonen df72608b2d fix the sort order when minWidth is undefined 2022-12-09 10:45:06 +00:00
Andras Bacsai a995647084 fix:eslint, bump versions 2022-12-09 09:26:52 +01:00
Andras Bacsai 013e52361e Merge branch 'main' into fix/eslint-improvements 2022-12-09 09:08:50 +01:00
Andras Bacsai c39058bc07 fix: eslints 2022-12-09 08:40:37 +01:00
Oleg Isonen 8c02d46bb1 fix media query specificity 2022-12-09 01:05:59 +00:00
Oleg Isonen 0faa28c0ef Merge branch 'main' into 536-when-only-one-image-is-too-large-let-others-upload 2022-12-08 19:45:15 +01:00
Oleg Isonen cfdecb6f73 stop loading assets with project 2022-12-08 18:32:34 +00:00
Bogdan Chadkin 3bc942fdb8 Deprecate legacy icon button in design system (#574)
We are implementing new design with different variants so first
deprecate old implemention and then step by step migrate to new version.
2022-12-08 19:47:47 +03:00
Andras Bacsai c3b0e4c114 add radix eslint check 2022-12-08 14:22:51 +01:00
Andras Bacsai 07a626a5c6 eslint fix 2022-12-08 14:11:29 +01:00
Andras Bacsai 9efecb0da5 fix lints 2022-12-08 14:07:10 +01:00
Andras Bacsai c8d67198ea add no-internal-modules eslint 2022-12-08 13:41:50 +01:00
Andras Bacsai 27469787a0 fix eslint 2022-12-08 13:21:37 +01:00
Andras Bacsai 2c1752e4d7 add eslint rules + fixes 2022-12-08 12:53:15 +01:00
Roman Pominov e8c52bd589 Fix props clone (#568)
- We've lost an `await` at `client.instanceProps.create` when we moved
to tranasactions.
- Also I've removed "If our client is not a transaction client, we need
to create a transaction", I think the reason this code exists is that we
tried to preserve transaction that was originally added because we
thought it creates parallelism.
2022-12-08 09:49:06 +03:00
Ivan Starkov cb7f22f7a4 Bump packages versions (#566)
## Before requesting a review

- [ ] if the PR is WIP - use draft mode
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
- [ ] what kind of review is needed?
  - [ ] conceptual
  - [ ] detailed
  - [ ] with testing

## Test cases

- [ ] step by step interaction description and what is expected to
happen

## 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-07 22:31:38 +04:00
Ivan Starkov bb6a1d28e3 [progress] Naive aspectRatio (#556)
## Before requesting a review

- [ ] if the PR is WIP - use draft mode
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
- [ ] what kind of review is needed?
  - [ ] conceptual
  - [ ] detailed
  - [ ] with testing

## Test cases

- [ ] step by step interaction description and what is expected to
happen

## 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-07 22:05:49 +04:00
Ivan Starkov f67e12035a Fix scrub uses other instance value (#563)
The issue is if we select on canvas instance of one Box for example, and
then other box, scrub had in the state value of first selected Box.



https://user-images.githubusercontent.com/5077042/206211694-19124e0b-5b90-4aef-8848-7ebe7f1d7bae.mov
2022-12-07 20:52:55 +04:00