Commit Graph
68 Commits
Author SHA1 Message Date
Ivan Starkov 8be665e68d experimental: SSG download support (#3783)
## Description

See corresponding [SaaS
PR](https://github.com/webstudio-is/webstudio-saas/pull/311) too

## Steps for reproduction

Click Publish/Export

<img width="363" alt="image"
src="https://github.com/user-attachments/assets/fbc1f4e5-3a2c-4bb9-9242-025196f991bc">


Deploy zip to netlify
<img width="1710" alt="image"
src="https://github.com/user-attachments/assets/daca4ead-6272-4729-8e82-0986301e5c8b">


## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-07-30 08:57:33 +03:00
Jaya Krishna Namburu d56df607f2 chore: move transforms section behind a flag (#3810)
## Description

This PR moves the `transforms` section behind a feature flag. The
section needs to add tooltips for all properties and scale need to have
a `lock` behaviour between the `scaleX` and `scaleY` properties.


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

- [x] made a self-review

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
2024-07-28 14:33:22 +02:00
Bogdan Chadkin a58f2eff04 build: run all tests and typechecks in CI (#3661)
Here improved our checks. No longet rely on "checks" script but run
"test" and "typescript" scripts from each package in monorepo.

Would also make each package less boilerplaty.
2024-07-02 18:21:05 +03:00
Oleg Isonen 25d72a11ff experimental: Paste from webflow 9 (#3602)
## Description

- updated mdn build
- fixed font-width
- render unset instead of var()
- skip properties with empty values
- temp rendering input instead of select
- remove the flag
- unprefix -webkit-appearance

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-06-22 23:23:29 +02:00
Ivan Starkov 85f0309c30 feat: Enable URL drop functionality in Image Manager (#3518)
## Description


https://github.com/webstudio-is/webstudio/assets/5077042/ea38835c-ec5c-4333-a982-f5bb9580d9e0

URLs can be dropped on Image Manager

+ small fixes.
- Files without extensions broke FileName control
- svg files were not shown on local builder after upload


## Steps for reproduction

Open Image Manager, drag urls


## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-06-10 09:52:18 +03:00
Ivan Starkov 0e1d1cf963 feat: Image Manager drag/drop suport (#3505)
## Description

This is 1st PR In a series of PR's

Next: Image URL Links upload support.

Image Manager now support files drag/drop
(Images, Fonts etc)

## Steps for reproduction

Drag files on image manager see it works.

## 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/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-06-07 15:59:02 +03:00
Oleg Isonen d56e857cb6 experimental: Paste from webflow (#3444)
Ref https://github.com/webstudio-is/webstudio/issues/2647

## Description

This allows to copy Heading only and only tested with minimal styles,
hence this is first stage, next I will add components and add tests with
complex styles.

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @TrySound , 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/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
2024-05-30 13:06:59 +02:00
Bogdan Chadkin 305436f820 experimental: add descendent component (#3313)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Here added support for new `<ws:descendent />` component. It allows to
style any children or descendents of components. Primary usage is for
embed content which renders html and need to style tags.

Descendent component accepts "selector" prop which can be suffix like `
img`, ` .image` or `::first-child` pseudo-element.

Potentially it could be used as tag styling for any element.

Can be tested in any element by dropping "Descendent" component from
"internal" category.
2024-05-06 23:36:34 +04:00
Bogdan Chadkin 7128bc9204 build: publish 0.151.0 (#3297) 2024-05-04 16:56:39 +04:00
Ivan Starkov cc72849a62 feat: Canvas drawing of xml element (#3245)
## Description

This is only for Canvas rendering.

<img width="829" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/b63efe11-effd-4ed7-b9ff-a19d4a19a125">

<img width="244" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/3f59819b-486a-4d75-8890-c5c14950393c">

Editable
<img width="269" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/e25af3b0-0903-4390-aec8-1fc7383ec24b">

For generating it will change a little.

## Steps for reproduction

[Play Ref
https://xml-element.development.webstudio.is/builder/cab934af-8615-411a-99c1-5822a98eac74](https://xml-element.development.webstudio.is/builder/cab934af-8615-411a-99c1-5822a98eac74)

## 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/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
2024-04-29 14:08:27 +03:00
Oleg Isonen c1b00787f8 chore: Remove old feature flags (#3147)
## Description

These feature flags are not needed any more

## 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/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
2024-04-12 17:28:54 +02:00
Oleg Isonen fcfcbd9480 feat: Support all css properties in Advanced section (#3061)
Closes https://github.com/webstudio-is/webstudio/issues/3058

## Description

We are going to support all CSS properties by allowing adding them in
the Advanced section

Todo

- [x] use css value input
- [x] rename the section to Other
- [x] Allow adding properties with +
- [x] delete grid-child section
- [x] descriptions for properties
- [x] check ai generated properties that don't exist in visual panel
(may need to add listed or automatically place in advanced whatever
wasn't handled above)
- [x] improve scrub perf 
- [x] show dots on closed section
- [x] don't show properties in advanced panel if they haven't been
listed but set in the visual panel
- [x] disable toggle group controls when advanced value is used
- [x] add advanced value to select control 
- [x] add advanced tooltip to border/outline controls 
- [ ] layout for long properties
- [ ] css value input for long values

## 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/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
2024-04-09 23:01:25 +02:00
Bogdan Chadkin ecc7c75e84 build: remove unused build scripts (#3123)
dev, build and dts are not necessary in not published packages and can
be removed. Builder vite setup is able to access webstudio export
conditions. Only prisma client need to be built before builder.

This will reduce CI time which runs build many times in various
workflows.
2024-04-09 20:46:22 +07:00
Bogdan Chadkin 13b6d79c3f refactor: drop theme switcher (#3110)
Theme switcher is very complicated and we may not introduce dark theme
for a while. Easier to drop it for now and reintroduce with brand new
solution.
2024-04-07 03:12:22 +07:00
Bogdan Chadkin 39f5f5b20d experimental: hide new form component behind flag (#3089)
Here added new "filters" flag which hides new form component form
components panel and renamed server form back to just form until we
agree on name.
2024-04-04 20:32:31 +07:00
Oleg Isonen 7abeab1d78 feat: Enable page templates in the marketplace (#2985)
With this we are getting a second category of templates - page tempaltes

## Steps for reproduction

1. Select category pages when submitting
2. then the same as with sectio templates

## 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/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
2024-03-12 11:32:59 +01:00
Oleg IsonenandBogdan Chadkin dd425afd6d experimental: marketplace for templates (#2916)
## Description

Foundation for the future marketplace where free and paid templates,
apps and other integrations can be offered. This first version is
limited to a few items that we will add there.

Generally, we call items we list on that marketplace "products" and they
can open an iframe either in the same left panel or in a dialog.

1. Product listing is effectively a webstudio website that can also be
functional standalone as well as inside the builder.
2. That website wraps individual section templates with a utility
component that handles click-to-insert

<img width="281" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/52824/0511f516-fb95-41b4-afa5-7a91f238c353">
<img width="290" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/52824/881fdee8-47ac-4d3a-ac01-7fdb9fdab236">


https://share.descript.com/view/bIgPI8aGiYA


## Steps for reproduction

1. no need to test for now

## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)

## 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/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: Bogdan Chadkin <trysound@yandex.ru>
2024-02-26 10:01:36 +01:00
Oleg Isonen f560256160 experimental: hide the CMS banner until released (#2937)
## Description

1. We accidentally released the CMS banner to everyone, which will be
misleading
2. Removed old feature flags

## Steps for reproduction

1. click button
2. expect xyz

## 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/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
2024-02-23 13:26:31 +01:00
Jaya Krishna Namburu 11d7fa28ed feat: Add redirects UI for 301 redirects to external URL's (#2779) 2024-01-25 17:05:22 +05:30
Bogdan Chadkin a5ed1e99f2 fix: hide page params with cms flag (#2757)
Ref https://github.com/webstudio-is/webstudio/issues/2532

We are launching bindings without page params
which will be part of cms launch.
2024-01-14 17:12:39 +07:00
Oleg Isonen 5a5382c975 feat: Page folders (#2745)
Ref https://github.com/webstudio-is/webstudio/issues/404

## Description

Implement ablity to organize pages in folders, not a complete
implementation, only:

- Implements data structure for folders
- Allows to create folders and select a parent folder from a folder
- Reparents orphaned pages/folders for the future collaboration mode

## Steps for reproduction

1. open pages
2. add folders
3. nest folders
4. delete folders

## 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/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
2024-01-13 16:39:57 +01:00
Ivan Starkov a87789f261 feat: Add fields to transaction log, add userPlanSettings (#2633)
## Description

Add additional fields to transaction log, so we can create billing
portal for users to unsubscribe/change etc of subscriptions

Plus:
- [x] Allow unlimited domains to all "pro" users
- [x] Add subscriptions link to users with subscriptions (created by n8n
schema on click)
<img width="213" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/08d40835-3273-4ca9-a0e3-8a4f7614da93">

- [x] Allow admin link sharing

## 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/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-11-19 22:43:31 +02:00
Bogdan Chadkin 4f5883834e feat: add variables to settings panel (#2573)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here integrated variables into props. Now it can be tested considering
instances tree.

<img width="488" alt="Screenshot 2023-11-06 at 13 10 33"
src="https://github.com/webstudio-is/webstudio/assets/5635476/5615478a-c762-4324-9e24-745cbd452ad0">
2023-11-08 10:56:12 +03:00
Jaya Krishna Namburu 60a6a7fbf2 feat: Add css transitions (#2511)
## Description

Adds support for `css-transitions` when users are in `local` state. In
any other state than local, the CRUD operations on transitions are
disabled.
2023-11-01 18:36:08 +01:00
Oleg Isonen 6d8dc531a6 feat: Enable AI for everyone (#2518)
## Description

With this we are enabling AI for everyone @itsNintu let's spread the
news on X.

## Code Review

- [ ] hi @TrySound , 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/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-10-24 23:10:17 +02:00
Giuseppe 0cefb0385c fix: Miscellaneous AI fixes (#2483)
Fixes:

- Disable Radix components via feat flag
- classNames should be optional when generating templates
- Prevent unwrapped JSX to fail
- Use shared computeSelectorForInstanceId when inserting templates and deleting instances
- Add extra instruction for GPT to fill required values just in case
2023-10-15 21:39:57 +02:00
Giuseppe 21cbb09f0e feat: Enable features via url (#2459)
Allows to enable features from the /dashboard endpoint by setting it via `features` url param
2023-10-12 19:35:18 +02:00
Giuseppe 43b2e7e23c feat: Merge copywriter with commands (#2419)
Unifies the operations AI endpoint with the copywriter feature. Introducing a chain to do feature-detection on user prompts.
2023-10-09 10:43:14 +02:00
Giuseppe b3dd7f18c4 feat: AI Operations (#2391)
Implements an operation-based system to accomplish a number of edit
tasks on a JSX+CSS representation of a selected Webstudio tree.

Every JSX element has the instance id as data-ws-id and therefore the
LLM knows what to edit.

The idea is to create a number of operations (aiOperations)
specs/schemas with Zod describing unique edit tasks, make a
discriminated union, convert them to JSON Schema. We then inject this
information and the current JSX+CSS in the LLM prompt asking the model
to generate an array of operations.

The LLM responds with an array of operations (aiOperations) to fulfill
the user request. We then process these doing the necessary
transformations to convert these to a Webstudio-friendly format
(wsOperations) and send them to the client where we apply them (see
applyOperations).

Some of these operations are going to be "intermediate" operations for
now.

Generating quality user interfaces might be challenging with LLMs.

Having to do so within a generic operations framework like the one
described above makes it even more challenging.

For this reason when it comes to generating user interfaces, the
Operation chain instead offers an operation called
generateTemplatePrompt that provides information about insertion point
in the existing UI and a prompt, possibly enhanced.

Another chain can use these information and a more sophisticated prompt
and model to then generate the user interface and return a
generateInsertTemplate wsOperation. Webstudio does exactly this in a
rest endpoint, using the template-generator chain with gpt4 instead of
gpt-3.5-turbo.
2023-10-06 09:07:59 +02:00
Ivan Starkov 8b22708cc7 feat: Switch on viewport-based srcSets for width-defined Images (#2415)
## Description

Previous PR: #2414

Now, by default, we set the width attribute when adding an image. This
change could cause mobile screens to load oversized images—specifically,
width * 2. To mitigate this, we're adopting the viewport width
descriptor for srcSets. This approach ensures optimized image loading on
smaller screens and maintains previous behavior on screens wider than
the image's actual size.

## Steps for reproduction

Add images of various sizes, see srcSet

## 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/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-10-04 18:35:00 +00:00
Ivan Starkov 86361756df feat: Optimize image loading to prevent layout shifts (#2414)
## Description

Instead of `aspect-ratio` css property set `width` and `heigh` html
attributes for the image and set css property `height` to `fit-content`
to preserve ratio.

This removes all known issues we had with images. 
- No layout shift on published site load
- No layout shift on  published site  and 404
- No small image size jumps during canvas resize

Next PR.

Apply full image optimisation even if width property is set (with some
adjustments).

## Steps for reproduction

Add image, see `width`, `height` html attributes has changed.
See css property `height` has changed to `fit-content`

## 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/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-10-04 16:39:53 +04:00
Jaya Krishna Namburu 35dab38dc0 chore: remove radix components flag (#2384)
## Description

Removes feature flag for radix elements in the editor.

## Code Review

- [ ] hi @TrySound , I need you to do
  - detailed review (read every line)
2023-09-27 19:44:25 +02:00
Giuseppe 03b2f369dc feat: Add AI Panel in Sidabar (#2367)
## Description

Adds basic logic to display AI features in the right sidebar. This is
under feature flag and disabled in prod.
2023-09-25 16:33:52 +02:00
Giuseppe 61c7960d3c feat: AI Package (#2307)
This PR introduces the baseline `@webstudio-is/ai` package which
includes:

1. A LLM Abstraction (types) for messages format to make requests to a
model
2. An implementation of the above that uses the OpenAI chat completion
endpoint
3. A common interface for chains. Chains are regular async functions
that can execute an arbitrary number of steps, including calling a LLM
via a model client.

The idea is that a builder API route can use any of these chains to
perform a task that requires AI. For example generate text copy, images,
a theme etc.
2023-09-25 10:59:44 +02:00
Bogdan Chadkin fb5414f93d build: use webstudio export condition for tools (#2347)
This fixes the issue with eventsource-parser package having source
export condition with different setup.

Now everywhere "webstudio" is used to reference our sources.
2023-09-20 22:14:34 +04:00
Ivan Starkov b538b74ef2 Enable CLI Usage in CI Environment (#2321)
## Description

- Allow overriding default templates with custom external or internal
ones.
- Ensure exact dependencies, e.g., workspace:* instead of workspace:^,
to address beta release issues.
- Enable passing buildId, authToken, and origin via flags during sync.
- Rename "host" to "origin" in the CLI.

Most code is custom template.

- [x] - Tested at SaaS

## 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/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-09-18 14:54:14 +03:00
Bogdan Chadkin 3f5d17aa6b Stop publishing sources and stories (#2261)
Here removed sources and stories from published packages. Sources were
used in the past instead off .d.ts. But since we generate them we can
reduce packages size significantly.

Cli install size

```diff
du -ck node_modules
- 33192
+ 29176
```
2023-09-07 10:53:34 +04:00
Bogdan Chadkin 1d8593f571 Mark unused packages as private (#2260)
We need to stop publishig all packages. Many of them not used and maybe
never be used in public. Though they bloat packages search, makes
publish step longer. Prisma client publishes 700MB package every time.
2023-09-07 10:47:20 +04:00
Bogdan Chadkin dbbbf84c34 Drop commonjs (#2255)
Seems like we no longer need commonjs in most packages. Only prisma
cannot be bundled on server because has binary.

Now new package setup is easier and require only esbuild instead of
custom solution.

Cli install size

```diff
du -ck node_modules
- 35516
+ 33192
```
2023-09-06 20:47:13 +04:00
Ivan Starkov f3f7f88df3 Add admin (publish) permissions to tokens (#2221)
## Description

Add admin permissions to shared links

<img width="328" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/972a46b9-154b-4426-9d8c-ab62ebf9a9e3">

<img width="283" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/d187da84-4d49-4308-b6ea-f09cb7a09e8c">


Share links for now disabled for admin role. Will do in the next
iteration after releasing above.


## Steps for reproduction

Create admin token link.
Open in incognito, see Publish is working.

## 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/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-09-04 12:10:29 +03:00
Ivan Starkov 034709c44d release-0.84.0 (#2082)
## Description

npm packages 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-08-09 22:48:34 +03:00
Oleg Isonen 9a52328d16 Change license from MIT to AGPL V3 (#1980)
The main reason for this change is the realization that a product needs
some more protection than a typical library. With this change it is
still an Open Source Core, but now corporations can't build on top of it
without contributing back to the OSS community or without buying a
license.
2023-07-26 01:06:21 +02:00
Ivan Starkov f5cbd28962 Add tooltip (#1957)
## Description

Left
- [ ] - storybook (next PR)
- [ ] - default styles (next PR)
- [x] - Add property to edit tooltip
- [ ] - Contraints - do not allow delete Trigger and Content (next PRs)
- [ ] - Icons  (next PRs)

### Whats done to make tooltip to work.

1. Portals support through passing
[selectorIdAttribute](https://github.com/webstudio-is/webstudio-builder/blob/20c3b9fdea4a6f8e7a2cc00211b6e4ca95db13a5/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx#L290)
2. [Hidden ScreenReader elements
detection](https://github.com/webstudio-is/webstudio-builder/blob/20c3b9fdea4a6f8e7a2cc00211b6e4ca95db13a5/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx#L129)
3. [New elements on Canvas
detection]https://github.com/webstudio-is/webstudio-builder/blob/20c3b9fdea4a6f8e7a2cc00211b6e4ca95db13a5/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx#L179



- [x] Collapsed
- [x] Do composeEventHandlers 
- [x] Radix add spans of tooltip content 
To support screen readers

https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
Radix here

https://github.com/radix-ui/primitives/blob/main/packages/react/tooltip/src/Tooltip.tsx#L552-L556
Cloning our content

https://github.com/radix-ui/primitives/blob/main/packages/react/visually-hidden/src/VisuallyHidden.tsx

## Steps for reproduction

1. click button
3. 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-07-24 14:50:15 +03:00
Bogdan Chadkin e98fe09eda Optimize typechecking (#1971)
Before we run two configurations of typescript on CI. Though this leads
to very long checks. Here I enabled "typecheck" script to generate dummy
.d.ts files to enable additional checks.

```diff
pnpm run -r typecheck (serial)
- 239.13s
+ 262.94s
pnpm turbo run size-test build checks dts --force (parallel locally)
- 2m30.609s
+ 1m47.622s
- pnpm turbo run size-test build checks dts --force (Ci)
- 6m 5s
+ pnpm turbo run size-test build checks --force (Ci)
+ 3m 22s
```
2023-07-24 11:38:19 +03:00
Bogdan Chadkin c5f84b7822 Run eslint from the root with cache (#1854)
While turborepo does not work for us we can try to solve long checks
time with builtin caching. Eslint provides similar one to prettier we
already use.

```
pnpm -r lint
51.53s

pnpm eslint . --ext .ts,.tsx --max-warnings 0
18.10s

pnpm eslint . --ext .ts,.tsx --max-warnings 0 --cache (with cache)
1.82s
```

In this PR I removed all lint scripts in packages and added global one
in the to github workflow. It saves like 30s on my laptop because pnpm.
Already stored cache makes linting almost instant.

Also bumped all eslint dependencies.
2023-06-26 10:08:15 +03:00
Bogdan Chadkin f06b35e35d Move types above import/require conditions (#1801)
Ref
https://github.com/webstudio-is/webstudio-builder/pull/1708#discussion_r1229878400
2023-06-15 10:46:42 +03:00
Bogdan Chadkin f15339e002 Check types outside of src folder (#1789)
We generate dts type for each package on publish.
It requires us to include only "src" to output same structure as in src
folder. Though we have configs and cli scripts outside of it which
should be typechecked, they cannot be ignored.

Ideally would be to have one-line commands in package.json. Though
typescript always has problems with build step. In this case the CLI
have everything to configure this except "include" and "exclude" flags.

So here to workaround that I added tsconfig.dts.json to distinct dts
generation and typechecking.

Blocker for https://github.com/webstudio-is/webstudio-builder/pull/1634
2023-06-14 23:37:24 +03:00
Ivan Starkov 3c34035a7a Remove domains flag (#1761)
## 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-06-12 18:30:26 +03:00
Bogdan Chadkin 274eabde4a Specify types with exports condition (#1708)
Saas is swithing to moduleResolution=bundler.
Here I replaced types top level field with exoprts condition in all our
packages. Thi should fix issues with new sdk components packages and
simplify using additional entry points.
2023-06-03 09:32:30 +03: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