Commit Graph
2732 Commits
Author SHA1 Message Date
Dimitri Ivashchuk 2ea9bee130 Merge branch 'main' into chore/switch-lost-pixel-to-legacy 2022-11-27 18:33:37 +01:00
d-ivashchuk 35b23f1bc4 ci 2022-11-27 18:33:01 +01:00
d-ivashchuk 61acb2dcac ci 2022-11-27 18:32:42 +01:00
Ivan Starkov a7125fe695 [release-fix] Fix adding new prop (#531)
- [x] - New property creation was broken
- [x] - Switch on `tag` was seriosly broken

<img width="403" alt="image"
src="https://user-images.githubusercontent.com/5077042/204138926-2ca2e13c-6e46-4ca1-9233-ffdc6475dad8.png">
2022-11-27 21:32:03 +04:00
d-ivashchuk 086b9fa789 “ci” 2022-11-27 18:21:55 +01:00
d-ivashchuk 80e2117bb7 move lost-pixel url to legacy version to ensure smooth transition to v1 of the platform 2022-11-27 18:09:53 +01:00
Bogdan Chadkin 6e5c0f9c1d Split Link and RichTextLink components (#530)
Droppable link an link created in text editor have different
requirements. We should split them. In the next PR they will get
different types so we will avoid similar issues in the future.
2022-11-27 17:25:24 +03:00
Oleg Isonen 52a4f9af6b added aspect ratio property to sizes 2022-11-27 13:46:53 +01:00
Bogdan Chadkin a8f1f407b7 Bump saas packages (#527)
Added publish script to image package and bumped everything changed
since latest bump by checking `git log -1 -- .`
2022-11-27 13:48:26 +03:00
Bogdan Chadkin b80b4c21f7 Remove paragraphs from text editor (#514)
Ref https://github.com/webstudio-is/webstudio-designer/issues/487

Before lexical created paragraphs when press enter which we tried to
visually represent as line break by removing margins and converted to
line break to instances.

This could lead to a few issues.

1. When paragraph block is inside `<a>` nothing can be typed in the
beginning and in the end of paragraph

2. Paragraphs can be styled by users which can break text editor
visually

Here I overwritten default Enter command and insert line break instead
of paragraph. To protect from external sources like paste from clipboard
added transform to merge all paragraphs if move than one.

We will still have one paragraph in the root with display: inline style.
Though it will cause less damage to editor with user styles.
2022-11-27 13:33:12 +03:00
Ivan Starkov 1ec17c41ec Remove assets flag (#525) 2022-11-27 14:04:59 +04:00
Ivan Starkov 9e3f3c46c6 Fix accidentally commented code at #516 (#524)
https://github.com/webstudio-is/webstudio-designer/pull/516#pullrequestreview-1194934498
2022-11-27 11:44:48 +04:00
Bogdan Chadkin 0d40747888 Use serialized loader types (#522)
New remix enforces types to be serialized.
Prisma output dates as Date instance and this is not customizable. Had
to fix only 2 cases.
2022-11-27 10:13:16 +03:00
Roman Pominovandistarkov a9fede0a1d Ability to replace SDK components (#516)
Whats done:
- [x] - Added getComponent, getComponentMeta (old getComponenMeta
renamed to getComponentMetaProps)
- [x] - Added `registerComponents` (for now able only override existing
components)
- [x] - Renamed react-sd `remix` folder to `app`
- [x] - At the `app` folder added `custom-components/Image` wrapper
component, which reads assets etc, and use `webstudio/image`
- [x] `getParams`, `setParams` added at `react-sdk/app/` as they are app
level


TODO:
- [x] Create "normal" `useParams` to be able to use data.params
https://github.com/webstudio-is/webstudio-designer/blob/c05f40818beaac8a811fe0a97ba49e30f01f5045/packages/react-sdk/src/app/custom-components/image.tsx#L15-L23
- [x] Reuse props meta from imported image - created issue
https://github.com/webstudio-is/webstudio-designer/issues/521

Co-authored-by: istarkov <istarkov@gmail.com>
2022-11-27 02:47:14 +04:00
Bogdan Chadkin 8172b077e8 Handle loader errors in error boundary (#520)
This will allow to infer loader data instead of writing type for it as
recommended in
https://github.com/remix-run/remix/releases/tag/remix%401.6.5.
2022-11-26 23:23:37 +03:00
Bogdan Chadkin 0036185747 Publish css-vars package to npm (#517)
This one is missing when upgrade packages in webstudio-saas
2022-11-26 17:56:21 +03:00
Oleg Isonen 4cc75b5c7a fix optional breakpoint 2022-11-26 14:17:59 +01:00
Bogdan Chadkin 44e5c8bc77 Fix npm publish token (#515)
Let's see if it will fix the issue
2022-11-26 01:40:12 +03:00
Oleg Isonenandistarkov 4c8989784b Primitive tokens (#507)
https://github.com/webstudio-is/webstudio-designer/issues/494

This PR Renders this UI and, when adding tokens - renders CSS variables
on the canvas: It's behind a feature flag.

<img width="411" alt="Screenshot 2022-11-25 at 15 51 00"
src="https://user-images.githubusercontent.com/52824/204009859-81ed72c4-e758-4973-be49-c8c65e6b4661.png">


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

Co-authored-by: istarkov <istarkov@gmail.com>
2022-11-25 19:51:54 +01:00
Bogdan Chadkin c2f895bc6b Use corepack to setup yarn (#377)
See https://nodejs.org/api/corepack.html

Corepack is a way to setup specific yarn/pnpm version on the fly.
Builtin with Node 16.9+

Requires to run `corepack enable`

Replaces https://github.com/webstudio-is/webstudio-designer/pull/370
2022-11-25 12:46:42 +03:00
Ivan Starkov 843467a691 Image (#502)
- [x] - Image optimization component moved into standalone package
- [x] - generate-arg-types moved into standalone package - one issue
with current yarn https://github.com/yarnpkg/yarn/issues/4964 (you need
to delete root node_modules, then yarn and yarn build to make
generate-arg-types to work)
- [x] - move json into `__generated__` folder, (allow import json from
__generated__ folders only)
- [x] - Icons moved all gen into `__generated__`
- [x] - css-data generated content moved to `__generated__`
2022-11-25 12:27:44 +04:00
Bogdan Chadkin 002e4c06e2 Merge pull request #511 from webstudio-is/bump-sass-deps
Bump saas deps
2022-11-24 21:19:06 +03:00
Bogdan Chadkin 7dbbfeb6b3 Fix sdk 2022-11-24 21:02:19 +03:00
Bogdan Chadkin 18d28b50cb Bump sass deps
We need to bump all sass deps to get esm support
and treeshake bundled code.
2022-11-24 20:59:41 +03:00
Bogdan Chadkin 16984b8bf7 Improve packages auto publish (#508)
Current solution often fails with

> You cannot publish over the previously published versions

Here I added small script which compares committed version and version
on npm and publish if do not match.

All scripts are run by turbo. So publishing new package is just changing
package script now.
2022-11-24 16:00:24 +03:00
Bogdan Chadkin 7f44d78279 Improve text editor styling and enable auto focus (#504)
Ref https://github.com/webstudio-is/webstudio-designer/issues/107

- fixed bold italic styling
- populate default style for instances created from text editor
- added unmount support to css engine
- auto focus text editor when start editing
2022-11-24 00:07:45 +03:00
Bogdan Chadkin 9b0d7f25b2 Output cjs in font package (#506)
Designer tests fail because of missing cjs in fonts package. Also fixed
iso string timezone in one test, was failing for me.
2022-11-23 22:55:31 +03:00
Oleg Isonen e57cc96808 fix eslint 2022-11-23 20:44:20 +01:00
Oleg Isonen 63ded04e13 fix currentIndex in font manager when new fonts are added 2022-11-23 20:23:14 +01:00
Bogdan Chadkin ac03e0b3b1 Fix esm in prisma migrations (#505)
Missed __dirname while migrating to esm. Works locally.
2022-11-23 20:59:53 +03:00
natlusyht b4f981f683 don't display empty unitless dropdown (#478)
don't display chevron if there are no items to display in the dropdown
and fix the bg on chevron's/unit text-field suffix button.

## 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-11-23 17:04:07 +01:00
Andras Bacsai 1cf0151366 Merge pull request #500 from webstudio-is/fix/canvasdata-type
fix: type CanvasData
2022-11-23 15:37:30 +01:00
Andras Bacsai 13e2e6bf56 remove error 2022-11-23 15:17:24 +01:00
Andras Bacsai 91239ef9d0 no need to double check string 2022-11-23 15:11:55 +01:00
Andras Bacsai aacfbd9eaf version++ 2022-11-23 15:02:04 +01:00
Andras Bacsai dae9e6de38 fix: type + tests 2022-11-23 15:00:39 +01:00
Andras Bacsai e12b3c0753 fix: type CanvasData 2022-11-23 14:50:38 +01:00
Andras Bacsai b48d551e64 Merge pull request #491 from webstudio-is/feat/pages-updates
Pages update for Edge version
2022-11-23 13:49:44 +01:00
Ivan Starkov e08aa99c43 [designer] Assets picker (#444)
ref #196



- Image reverted to ordinary Image
- Added supports of "ordinary" Image `src` selection with the Asset
manager. (The Idea that we save asset + prop value simultaneously, so
"ordinary" controls will work without issues, i.e. in case of the image
we save `prop="src" value="/imagpath" asset={...tonof info here...}`)
- Image optimizations removed (will be created in standalone package in
next PR)
- Now UserProps has type
https://github.com/webstudio-is/webstudio-designer/blob/c36519540c9d3493acfe0dcdd1c118ac4b6196be/packages/react-sdk/src/user-props/schema.ts#L33-L39
- Db type is:
https://github.com/webstudio-is/webstudio-designer/blob/6d5cc571cb4e3bf00ec95f166a0daf9420ef50ac/packages/react-sdk/src/user-props/schema.ts#L4-L10


Next PRs:
1. Restore the Image component with optimizations at standalone package
2. Pass the Image component to SDK and use it instead of the original in
case of optimizations are needed.
2022-11-23 16:15:22 +04:00
Andras Bacsai 3da21ede0e bump version 2022-11-23 09:38:03 +01:00
Andras Bacsai 9ac21be7f4 bump versions 2022-11-23 09:37:14 +01:00
Andras Bacsai b2363b7e2d move cssengine dependency to package 2022-11-23 09:31:02 +01:00
Bogdan Chadkin ad04473f26 Migrate packages to native ESM (#493)
Our designer bundle heavily bloated with not analyzable commonjs
generated by typescript.

The biggest problem comes from bundled icons library which esbuild
cannot tree shake because of cjs.

Another issue is broken code splitting. Packages in one piece are appear
in chunks and always loaded even with dynamic import and React.lazy.

To solve this I migrated each package to native node es modules.
Storybook and jest work almost without changes. Though it's not possible
to run remix in esm project (while still esm packages can be bundled for
ssr). And as a result designer jest failed because of cjs tests requires
from esm packages. As a solution I generated additional commonjs
artifacts in lib/cjs.

du -ck public/build
2336
1736
2022-11-23 10:12:58 +03:00
Bogdan Chadkin 983c3a60e8 Bump lost-pixel (#497)
Need to fix esm packages
2022-11-22 22:46:31 +03:00
Bogdan Chadkin 719f8a4d03 Fix dev in prisma-client (#496)
Had to add concurrently to run two watch commands in parallel
2022-11-22 20:37:17 +03:00
Andras Bacsai c7c31b14f6 fixes 2022-11-22 15:53:06 +01:00
Andras Bacsai af41705e61 fix issues 2022-11-22 14:35:28 +01:00
Andras Bacsai cefd76d9b7 fix issues 2022-11-22 14:25:09 +01:00
Andras Bacsai d7db67e461 fix: BuildParams type 2022-11-22 12:08:51 +01:00
Andras Bacsai fe8f25db33 remove package tests 2022-11-22 12:06:15 +01:00