Commit Graph
5224 Commits
Author SHA1 Message Date
Andras Bacsai 2c1752e4d7 add eslint rules + fixes 2022-12-08 12:53:15 +01:00
Andras Bacsai e524fed797 fix: able to use remote dev environments with IP address 2022-12-08 10:40:55 +01:00
Ivan Starkov b39e6a6376 Fix switch display (#569)
Switching display from flex on block caused error in input field

We were not able to parse display block etc

As this is not fixed for display props.
```
setProperty should be called with a style object, string is deprecated
```

So we got that "parsed not valid behavior" which we decided to be
invalid.
2022-12-08 12:07:05 +04: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
Oleg Isonen b52a4f752c Merge branch 'main' into 536-when-only-one-image-is-too-large-let-others-upload 2022-12-07 23:03:30 +01: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
Roman Pominov a0cc8a8502 allow to add tasks in usePersistentFetcher synchronously 2022-12-07 21:54:42 +04:00
Oleg Isonen 5203aff3a1 use usePersistentFetcher 2022-12-07 17:23:03 +00: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
Oleg Isonen 35d093d48f Merge pull request #562 from webstudio-is/disable-dark-theme
Disable dark theme for now until we got it up-to-date
2022-12-07 16:25:43 +01:00
Oleg Isonen adc268e7af disable dark theme for now until we got it up-to-date 2022-12-07 14:49:02 +00:00
Oleg Isonen d87e25b5f4 Merge pull request #561 from webstudio-is/fix-blockLevelElements
Fix dependency mapping for blockLevelElements
2022-12-07 15:11:50 +01:00
Oleg Isonen d24766f30d fix dependency mapping for blockLevelElements
For example property clear  was  not showing up in position section because of that
2022-12-07 14:05:36 +00:00
Bogdan Chadkin 05e69ac016 Give body separate type in sdk (#560)
Body is the only container which should not be listed. After discussing
with Oleg decided to give it separate body type.
2022-12-07 16:17:33 +03:00
Ivan Starkov ffae4bd403 Make CSSValueInput controllable, (#551)
CSSValueInput used useEffect and executed onChange etc events on its
own. What in case of any small changes caused loops and strange
behavior. Now should execute everything only as a result of user input.

`parseCssValue` - now stupid parse CSS value and someday will be used
only inside text-control.
setProperty - now accepts StyleValue, the string param is deprecated,
warning set.

CSSValueInput now not update styles during editing.

unit menu now not hiding during formulas etc

fixed bug with updating style on newly created items

fixed scrub bugs with unsubscribing

css-tree Adds 52101 gzip bytes. 
A lot of size is coming from here 

https://github.com/csstree/csstree/blob/97d7f3b95a3efd8f431af39986acc149dceefa59/lib/data.js
more than 1/3 of `esm` size (20+kb gz), and most huge are properties
json we need and use.

Doesn't look tree-shakeable, anyway can be loaded lazily as until
editing we don't need to validate CSS vars.

Investigating: 
- [x] - Changing any style Combobox with mouse cause multiple value
updates to previous and current value (was a blur event issue)
2022-12-07 14:32:34 +04:00
Mateusz Burzyński 2b84a3d62c Fixed publish by overriding the implicitly enforced yarn registry with the default one (#559) 2022-12-06 23:37:32 +01:00
Mateusz Burzyński 67fe15f4a9 Remove a redundant install step in one of the workflows (#557) 2022-12-06 23:20:50 +01:00
Oleg Isonen 5e14d895f7 Merge pull request #518 from webstudio-is/494-primitive-tokens
Primitive tokens
2022-12-06 15:41:33 +01:00
Oleg Isonen f0cb0a12a7 clone design tokens 2022-12-06 14:30:14 +00:00
Oleg Isonen 786aa418b4 code review changes 2022-12-06 14:05:13 +00:00
Oleg Isonen 175a62a91e wrap into transaction build.create and related functionality
simplify build.create logic, make it easier to add stuff to it
2022-12-06 12:43:22 +00:00
Oleg Isonen de77e76933 Merge branch 'main' into 494-primitive-tokens 2022-12-06 11:38:45 +01:00
Mateusz Burzyński 730b12b21b Deploy per-PR Storybooks on Chromatic (#519)
This publishes all available Storybooks to Chromatic - this happens per
push so you will always be able to check out the current state of things
in those Storybooks.

Since you have a lot of Storybooks... this isn't quite convenient. I
plan to combine all of those Storybooks into a single one (a single
storybook that will reference all of those smaller ones). I'd like to do
that in a follow-up PR though - let's now focus on getting this up and
running.
2022-12-06 08:32:51 +01:00
Oleg Isonen 5c01b4baa1 replace useState hack by a helper utility that is using ref and explaining what's happening 2022-12-05 16:32:44 +00:00
Oleg Isonen 42292b2930 rewrite validation using zod 2022-12-05 16:19:54 +00:00
Oleg Isonen c33368a113 forgotten files after they were moved 2022-12-05 10:25:44 +00:00
Oleg Isonen b3c095e2f6 use immer for clarity 2022-12-05 10:17:19 +00:00
Oleg Isonen 0b5cd3dcb9 ignore changes when closing with errors 2022-12-04 11:28:10 +00:00
Oleg Isonen cb0abf4d27 move logic into a hook 2022-12-04 11:13:03 +00:00
Oleg Isonen 0c0b495ff3 split token editor into separate file 2022-12-03 20:41:27 +00:00
Oleg Isonen 662bfa580a fix schema types 2022-12-03 17:16:12 +00:00
Oleg Isonen 23a0dd5172 move casting to where we parse data 2022-12-03 17:09:53 +00:00
Oleg Isonen 26ea46de5e separate seed from token 2022-12-03 17:01:50 +00:00
Oleg Isonen 3c088b2c04 Merge branch 'main' into 494-primitive-tokens 2022-12-03 15:38:31 +01:00
Oleg Isonen 20fd50e970 useState with callback instead of ref as a way to set something once 2022-12-03 14:32:43 +00:00
Bogdan Chadkin fb946ab296 Fix span component type (#552)
Mistyped when added type to components.
2022-12-03 16:33:06 +03:00
Oleg Isonen 4ff739961c design-tokens is too simple for now to have tests 2022-12-03 12:14:21 +00:00
Oleg Isonen 8d26bf781b move shared design tokens logic to a separate package 2022-12-03 12:09:22 +00:00
Oleg Isonen 0d07f9a27c Merge branch 'main' into 494-primitive-tokens 2022-12-03 11:41:08 +00:00
Oleg Isonen 6fd2d15ae3 scrollable tokens manager 2022-12-02 23:34:16 +00:00
Oleg Isonen 112ba9be89 tests 2022-12-02 21:01:53 +00:00
Oleg Isonen a3d9a68ee4 editing token 2022-12-02 20:36:49 +00:00
Ivan Starkov b6c6f57f2c Fix that images with asset had value inside db (#549)
ref #196

- [x] UserProps now [discriminated union by
type](https://github.com/webstudio-is/webstudio-designer/blob/img_asset/packages/react-sdk/src/user-props/schema.ts#L10-L31)

- [x] Data migrations done
2022-12-02 14:53:30 +04:00
Oleg Isonen a06a3db058 Merge branch 'main' into 494-primitive-tokens 2022-12-02 00:27:51 +00:00
Roman Pominov 55280b8348 use RemixLink in Link (#488)
Fixes #457
2022-11-29 13:42:40 +03:00
Bogdan Chadkin c883d8d1af Drop lost-pixel dependency (#545)
We use lost-pixel only as github action. Having it in dependenies adds
~270MB in node_modules and breaks vercel CI. With this change we can
remove hack around odiff.

## 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-11-29 12:36:16 +03:00
Bogdan Chadkin 6b761bb000 Replace tsc with esbuild to build packages (#543)
Build of whole monorepo without cache takes 1min or more on my laptop.
tsc is very slow tool for this. Also having rootDir in tsconfig prevents
checking outside of src folder.

Here I added "scripts" package with "build-package" bin. It does both
esm and cjs builds. --watch flag support completely replaces tsup for
us.

Now full rebuild of monorepo without cache takes only 10s including
prisma-client, http-client and designer builds.
2022-11-29 10:04:25 +03:00
Bogdan Chadkin 3e96357a2c Use sources as type deifnitions (#539)
Right now our build and CI take a lot of time. 1:40min - 2min on CI and
1min locally. We spend time on vercel, on main CI, on publish and
locally.

At the moment in packages anything outside of src folder is not checked
because of rootDir.

We have to generate "references" field on precommit.

All these issues can be avoided if remove .d.ts generation completely
and specify sources in "types" field. This way we get zero build time
for types and can switch to other build tool (like esbuild) for .js
generation and get almost instant build on vercel, on main CI and on
publish.

Downsides

- it can be slower (actually not really caz we delete .tsbuildinfo cache
anyway and we can still generate it with incremental flag)
- it contraditcs recommended practices for published packages (we can
generate .d.ts in publish script only and use "types" as source
internally)
2022-11-28 22:27:56 +03:00
Ivan Starkov fe3811a373 Move defaults into ws (#541)
meta props are moved to *.ws.ts
Component removed from *.ws.ts

This allows to merge ws props with registered components props
`registerComponents` now are 
-   registerComponents(customComponents);
-   registerComponentsMeta(customComponentsMeta);

_(Splitting will allow for code splitting to work.)_

Removal of `Component` (and then `Icon` prop) would allow serializing
*.ws.ts metadata between iframe and app designer

Next PR:

Move Icon into base64 or like.

publish/subscribe ws meta of registered components, so it can be reused
on the Designer side
I need this to pass props of registered components to Designer.
2022-11-28 21:14:35 +04:00