Commit Graph
3073 Commits
Author SHA1 Message Date
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 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 9d84e5fedf move height management to assets panel 2022-12-08 18:36:52 +00:00
Oleg Isonen 0885b092a2 unneeded flex-grow 2022-12-08 18:32:35 +00:00
Oleg Isonen 06737a23ca only load assets when panel opens 2022-12-08 18:32:35 +00:00
Oleg Isonen be2a99acee enable scrolling of panel content when there are many items 2022-12-08 18:32:35 +00: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 f460004d7c Merge branch 'main' into fix/eslint-improvements 2022-12-08 14:35:30 +01:00
Andras Bacsai cadd87e8a1 Merge pull request #570 from webstudio-is/fix/remote-dev
Able to use remote dev environments with IP address
2022-12-08 14:35:19 +01:00
Andras Bacsai 02d6e508dd Merge branch 'main' into fix/eslint-improvements 2022-12-08 13:44:07 +01:00
Andras Bacsai c8d67198ea add no-internal-modules eslint 2022-12-08 13:41:50 +01:00
Bogdan Chadkin 9e8bbffaa9 Check authenticated user against db (#542)
Ref https://github.com/webstudio-is/webstudio-designer/issues/92

We store user session in storage and checked its existance to check if
user is logged in. Though where we clear db or for example delete user
this session becomes stale so we should check if user exists in db too.
2022-12-08 15:28:39 +03:00
Andras Bacsai 6e738a2fc0 regex for ip address+port 2022-12-08 12:59:11 +01:00
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
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 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 adc268e7af disable dark theme for now until we got it up-to-date 2022-12-07 14:49:02 +00: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
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 20fd50e970 useState with callback instead of ref as a way to set something once 2022-12-03 14:32:43 +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 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
Bogdan Chadkin b4bf640dcc Replace flags with component type (#532)
Boolean flags may have a lot of combinations which can lead to
unexpected bugs. Better approach is to categorize nodes with specific
behaviours.

Here I added 5 types

- container - can accept other components with dnd
- control - usually form controls like inputs, without children
- embed - images, videos or other embeddable components, without
children
- rich-text - can be edited on double click
- rich-text-child - formatted text fragment, not listed in components
list
2022-11-28 15:04:53 +03:00