Commit Graph
396 Commits
Author SHA1 Message Date
Ivan Starkov 00c02201a0 Add domains to publish (#1694)
## Description

At publish we would allow to check domains we want to publish. As of now
we publish all project domains.

But already pass them from UI, so future move would be just UI changes,
without touching API

- [x] - Fix "no access to project domains using service api call"

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

- [ ] 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-06-01 17:59:10 +04:00
Bogdan Chadkin 0d35e39822 Add sdk-components-react-remix package (#1691)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1129

Here added sdk-components-react-remix with all remix components moved
away from react-sdk.

Exposed 3 entry points

- @webstudio-is/sdk-components-react-remix
- @webstudio-is/sdk-components-react-remix/metas
- @webstudio-is/sdk-components-react-remix/props
2023-05-31 11:45:38 +07:00
Oleg Isonen 226603e1e0 Sort components by order property in WsComponentMeta (#1681)
## Description

We want to be able to specify the order in which components are shown in
the panel.

Right now the order property is not set where needed, because I am
waiting for feedback from @taylornowotny

## Steps for reproduction

1. Open add components panel
2. See components are in the right order

## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
- [ ] hi @taylornowotny  , I need you to do
- give some thought to both components that need to be first which we
set specific order to (the rest will go as is)
- recheck the categories, I feel like our split into categories is not
intentional

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-30 23:34:19 +02:00
Ivan Starkov dafa7e8b35 Publish by buildId (#1689)
## Description

The idea is to deploy by `buildId` instead of `projectId`.
Every build now can have `deployment` metadata params (currently
`domains` only, but in the future can be any additional metadata, like
vars etc)

Publish is simplified (-2 workers), the same trpc as for other saas api
is used to publish, see `cms.publish`
(also local development is simplified as edge-api at saas works on local
dev perfectly)

isDev and isProd are not needed anymore. Any published build has
`deployment` metadata, and various builds can be active now on different
domains.

Build clone now seriously faster as no parse/serialize steps involved at
all.

Partial index `CREATE UNIQUE INDEX "Build_dev_index" ON "Build"
("projectId") WHERE "deployment" IS NULL;` created so we could be sure
that no more than 1 dev build exists.

createBuild and cloneBuild are now splitted, and seriously simplified

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

- [ ] 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-30 23:44:05 +04:00
Bogdan ChadkinandOleg Isonen c08e57cdbd Hide props and styles tabs for html embed (#1686)
Html embed has display: contents and should not be styled or have props.

---------

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-05-31 02:40:15 +07:00
Bogdan Chadkin 7c6d06bfd8 Use meta stored in atom in builder and canvas (#1687)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1545

All complex use cases already switched to get meta from arguments and
from atom.

Here migrated the last cases and dropped legacy meta register in
react-sdk package. Now we ready to split components into separate
packages.
2023-05-30 17:45:12 +07:00
Bogdan Chadkin 66d82afca7 Drop unused asset table fields (#1635)
Cleanup after refactoring. Now we can get rid of Asset.location because
asset location is defined by environment. And remove fields moved to
File table.
2023-05-30 17:25:50 +07:00
Bogdan Chadkin 40ffb639ad Enforce node protocol (#1685)
Enable unicorn eslint rule to enforce `node:fs` like specifiers for node
modules.

Previously `node:` prefix helped to find server code bundled in browser.
2023-05-30 13:42:38 +07:00
Bogdan Chadkin 7c66afef74 Add requiredAncestors and invalidAncestors to meta (#1684)
Here added two component restrictions to meta.

requiredAncestors prevent inserting components outside of required ones
here restricted ListItem to always be inside of List.

invalidAncestors prevent inserting components inside of invalid ones
here prevented nested buttons
2023-05-30 12:33:44 +07:00
Giuseppe 6d1e901950 Add insertTemplate helper (#1683)
Introduce a generic `insertTemplate` helper and use it in
`insertNewComponentInstance`. This allows to insert an existing template.
2023-05-29 14:18:23 +02:00
Bogdan Chadkin fe00228f7e Prevent user from editing outdated builds (#1682)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1664

Here added Build.version which is updated on every patch. The client
should provide latest received version to compare with stored in db.
When version mismatched user is suggested to reload.
2023-05-29 18:52:48 +07:00
Bogdan Chadkin 5f15ef7e48 Update inspector panels design (#1680)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1644

- added instance info to all panels
- fixed style sources design
2023-05-29 17:52:19 +07:00
Bogdan Chadkin 60f2b1e442 Accept components map in renderers (#1679)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1129

Here refactored registered components away from global state in
react-sdk package in favour of components map.

The map can be easily computed in runtime or generated for worker.
Default and custom (remix) components registering is unified now and
both libraries can be split into separate packages.

Temporary added "@webstudio/react-sdk/components" entry point to get a
record of components.
2023-05-29 14:21:13 +07:00
Ivan Starkov 25255cbfa5 Add project domain validations (#1675)
## Description

Services we need like `image-transform.wstd.io`, `local.wstd.io` 
can intersect with user-created domains. _in some cases that will cause
disastrous results_

Do not allow to create domains we already use, and reserve `wstd-sys-`
and `wstd_sys_` for future services we can create



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

- [ ] 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-26 14:26:47 +04:00
Bogdan Chadkin 40e97a1086 Replace meta.children with meta.template (#1676)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1569

Here we change template in meta to include current component instead of
implicitly creating it.

This way we can provide insert composition of components instead of
single one for example input+label. Or even wrap current component like
label>input.

Another usecase is ability to set local styles and props for current
component.

Note: review with hidden whitespaces
2023-05-25 23:41:08 +07:00
Ivan Starkov 37c8608eae Custom Domains (#1564)
## Description

How it looks. (Not everything aligned or have features like in design)


https://github.com/webstudio-is/webstudio-builder/assets/5077042/349c7fae-afd8-478d-9eba-701b002f0fd4

Most API methods return `{ success: true } | {success: false, error:
string}` because in the future they need to be moved into server
workflows, and do not exist or return anything.

## Steps for reproduction

Run locally, at localhost I've created a fake domain creation API, to be
able to test UI.

## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-25 19:11:54 +04:00
Ivan Starkov 1ab0f8661e Update NPM (#1674)
## Description

npm update

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

- [ ] 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-24 22:57:13 +04:00
Ivan Starkov a51b2caa25 Fix proxy (#1673)
## Description

Forwarding all headers caused errors in some cases.

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

- [ ] 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-24 22:56:51 +04:00
Ivan Starkov c3496753d0 Release 0.67.0 (#1669)
Release 0.67.0
2023-05-23 23:56:22 +07:00
Oleg Isonen cf0190b87e Rename properties section (#1670)
## Description

Aligning with the design



## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-23 18:44:29 +02:00
Bogdan Chadkinandistarkov 2ee5be960b Forward request in image proxy (#1666)
We need to forward existing request with headers.
Secure by restricting origin.

## Code Review

- [ ] hi @istarkov, 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory

---------

Co-authored-by: istarkov <istarkov@gmail.com>
2023-05-23 18:05:19 +04:00
Giuseppe 6a9c4c013c Initial CSS parser (#1652)
## Description

This PR moves the parse-css-value utility that was before part of the
builder app to the css-data package.

In this package we are adding an initial `parse-css` utility that will take
CSS and convert to a format that we can work on within Webstudio. For
now it is relatively simple and it supports only CSS classes parsing.
2023-05-23 09:47:13 +02:00
Ivan Starkov 429c4c115d Release 0.66.0 (#1665)
## Description

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

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

- [ ] 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-22 19:47:01 +04:00
Bogdan Chadkin 37f376573e Add html component (#1624)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1563

Looks like dangerouslySetInnerHtml is quite safe and do not allow to
break outside layout.
Plus as important point it works with ssr.

To execute scripts while injecting used range hack described here
https://ghinda.net/article/script-tags. innerHTML does not execute
scripts.
2023-05-22 20:08:48 +07:00
Bogdan Chadkin 32f2deef60 Add overwritten values support (#1660)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1658

Updated following components in design system
- css value list item
- icon button
- label
- nested icon label
- section title
- toggle button

Updated following UI in builder
- toggle control
- flex grid
- space UI
- collapsible section
- property name
2023-05-22 18:34:10 +07:00
Bogdan Chadkin c7ac312702 Store component meta in atom (#1661)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1545
https://github.com/webstudio-is/webstudio-builder/issues/1129

Here register all component metas to atom which is sychronized with
builder.

Replaced getComponentNames with registered metas keys. We no longer need
to maintain this list.

Old registration still there because there is a lot of usages of
getComponentMeta.
2023-05-22 17:01:00 +07:00
Bogdan Chadkin 6f6a4e7d34 Register props meta into store (#1655)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1545
https://github.com/webstudio-is/webstudio-builder/issues/1129

Here moved props meta into store. Both default and custom meta should be
registered as by default its empty.

Removed merging of overriden props with overrides because our cli still
resolves all types in component.

Supported two-directional store initialization by checking if there was
any .set calls. This let us send initial data from canvas.
2023-05-21 19:48:44 +07:00
Roman Pominov e76981bb0b Use up to date unit in css input scrub (#1654)
## Description

Fixes a bug:

1. Enter a `px` value into any CSS value input
2. Reload page to make sure everything re-mounts
3. Go to the same input and change unit to `rem`
4. Scrub
5. Unit flips back to `px`

Closes https://github.com/webstudio-is/webstudio/discussions/31
2023-05-21 12:13:25 +03:00
Bogdan Chadkin 25c1fb3706 Drop css endpoint (#1656)
See https://github.com/webstudio-is/webstudio-builder/pull/1565

We don't use it anymore and it's conflicts with vanilla-extract
integration in remix.
2023-05-20 14:27:43 +07:00
Bogdan Chadkin 9d0285f56b Support bold and normal font-weight (#1641)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1535

Here instead of hacky preconverting to numeric font-weight value support
"normal" and "bold" as input for font weight control.

Defaults can be checked on h1 and body.
2023-05-20 10:32:49 +07:00
Bogdan Chadkin 39d9d5c9ba Make meta serializable (#1649)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1129
https://github.com/webstudio-is/webstudio-builder/issues/1545

Here put all components meta icons into strings and fixed usage with
innerHTML. This allows us to load components only from canvas and send
to builder.
2023-05-19 20:41:31 +07:00
Oleg Isonen 25a110b778 Use user-select: none by default (#1642)
Closes https://github.com/webstudio-is/webstudio-builder/issues/1639

And https://github.com/webstudio-is/webstudio/discussions/29

## Description

We are changing default behavior to not user selectable and allowing it
where it's practical, like copying project name as a deletion
confirmation

## Code Review

- [ ] hi @rpominov , 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-18 19:15:40 +02:00
Roman Pominov 12e4014656 Panel tabs (#1653)
## Description

1. Added `PanelTabs` to design-system. Closes #966
2. Used `PanelTabs` in inspector panel. Closes #1643
2023-05-18 19:46:30 +03:00
Ivan Starkov ad574fefc2 Nested Input Button (#1650)
## Description

Closes #1646


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

- [ ] 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-18 14:32:11 +04:00
Bogdan Chadkin 5439343437 Mark files as deleted (#1638)
Ref https://github.com/webstudio-is/webstudio-builder/issues/193

To make undo of assets deletion work we need to stop deleting files from
storage to restore assets without loosing actual file.

Here added File.isDeleted and file.updatedAt fields to mark as deleted.
This way we can run scheduler to actually delete files which are marked
for some time already. And undo of asset deletion now works.
2023-05-17 17:11:07 +07:00
Roman Pominov b5c8716460 selectedInstanceIsRendered -> selectedInstanceRenderState (#1640)
Fixes review comment:
https://github.com/webstudio-is/webstudio-builder/pull/1632#discussion_r1196082482
2023-05-17 12:03:20 +03:00
Roman Pominov b186c3c85c Fix project card menu z-index (#1637)
## Description

Fixed a bug where menu is obscured by the big letters of another
project's card

![image](https://github.com/webstudio-is/webstudio-builder/assets/825702/93d8f948-6c35-44b8-8c20-e1267bd0b219)
2023-05-17 11:55:58 +03:00
Bogdan Chadkin f9add7acdd Fix breakpoints width and rendering (#1631)
Ref https://github.com/webstudio-is/webstudio/discussions/30

Here fixed width update which always relied on base breakpoint instead
of selected one.

Another issue found and fixed is wrong order of rendered breakpoints.
2023-05-17 01:23:52 +07:00
Roman Pominov d04e0e83ec Fix scroll reset in style panel (#1632)
## Description

1. Closes #1617

Before this PR `selectedInstanceIsRendered` behaved like this:

Switching to instance that **is** on canvas: `true -> false -> true`
Switching to instance that **is not** on canvas: `true -> false`

Issue: we can't tell apart brief `false` in the first case, and final
`false` in the second

After this PR:

Switching to instance that **is** on canvas: `true -> undefined -> true`
Switching to instance that **is not** on canvas: `true -> undefined ->
false`

Now we can distinguish temporary `undefined` from permanent `false` and
don't hide style panel during `undefined`

## Steps for reproduction

Case 1:

1. Select a Box instance
2. Scroll style panel
3. Select another Box instance
4. Scroll should not reset

Case 2:

1. Select a Box instance
2. Select a Success Message instance in a Form
3. Style panel should show "Select an instance on the canvas" message
2023-05-16 16:03:56 +03:00
Roman Pominov 68243c6876 Assets copy-paste (#1636)
## Description

1. Closes #1325
2. Assets used in styles are copied
3. Assets used in props are copied
2023-05-16 14:34:42 +03:00
Bogdan Chadkin 438af049bd Create assets with patches (#1633)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1335

Successor of https://github.com/webstudio-is/webstudio-builder/pull/1376

Assets no longer created while uploading. Asset patch now tracks new
assets to save in db.
2023-05-15 22:22:16 +07:00
Ivan Starkov cad34a3040 Fix types (#1629)
## Description

Makes AllComponent type better


Found null bug.

Enforced for all components 
```
    [componentAttribute]: instance.component,
    [idAttribute]: instance.id,
```
to be non-optional. 

cc @TrySound should fix your issue with Html component


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

- [ ] 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-15 12:21:12 +04:00
Oleg IsonenandJayaKrishnaNamburu b4b86a6c89 Outline style property (#1630)
## Description

https://github.com/webstudio-is/webstudio-builder/pull/1596

---------

Co-authored-by: JayaKrishnaNamburu <namburu1995@gmail.com>
2023-05-14 18:40:12 +02:00
Bogdan Chadkin 3fcf37e02b Add image proxy route (#1453)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1179

Here added image proxy - simple remix route to interop image requests
locally and in preview. We have now only single image loader which
accepts image base url.

Here support only local deployment. Preview and saas preview to
RESIZE_ORiGIN env.
2023-05-14 23:25:34 +07:00
Oleg Isonenandnettohadi ef49e85362 Set loading state when opening project from dashboard (#1627)
Closes https://github.com/webstudio-is/webstudio-builder/issues/1334

## Description

When project item is clicked, we are fetching the project data via
router, if its slow - we show loading indication

## Steps for reproduction

1. open dashboard
2. set network throttling in dev tools to super slow
3. open a project

## Code Review

- [ ] hi @istarkov , 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory

---------

Co-authored-by: nettohadi <32300655+nettohadi@users.noreply.github.com>
2023-05-14 14:23:51 +02:00
Ivan Starkov 2374b5f22b Fix assets vercel uploading (#1626)
## Description

1. Add 404 instead of redirect
2. Fix vercel/remix upload

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

- [ ] 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-13 18:11:41 +04:00
Bogdan Chadkin 50a54a7c70 Drop unused deps (#1623)
Found these dependencies are not used in our project. Can be safely
removed.
2023-05-13 15:06:01 +07:00
Ivan Starkov d14c07f190 Fix hydration (#1621)
## Description

closes #1557

## Steps for reproduction

Install
https://chrome.google.com/webstore/detail/dark-mode/dmghijelimhndkbmpgbldicpogfkceaj
plugin
See our website doesn't work but current PR is


## 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-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2023-05-13 11:52:03 +04:00
Bogdan Chadkin dd92436fe6 Upload file instead of form data (#1620)
Form data is complex format to work with and web api does not support
its stream parsing and we had to use remix utilitties.

Here upload file as is so node or worker gets stream and do anything
with it. So this is one less dependency on node.

These streams are still bufferred but we can improve this at least for
images later to not exceed vercel memory.
2023-05-12 21:15:23 +07:00
Bogdan Chadkin 810a87b990 Store content type before upload (#1619)
Content type is important when detect image or font parser and required
(or recommended?) for uploading to s3.

Here temporary saved it in File.format and reuse in upload. Later
overriden with parsed format.

This is a preparation to uploading only blob without additional
information.
2023-05-12 14:28:44 +07:00