16 Commits
Author SHA1 Message Date
Bogdan Chadkin 02ca084a0c refactor: upgrade to csstree v3 (#5455)
The new version is aware of modern colors and other new css features.
2025-11-23 14:32:12 +03:00
Ivan Starkov ca4b0f89bc experimental: Animation publishing (#4976)
## 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:
0000)
- [ ] 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
2025-03-11 11:19:01 +05:00
Ivan Starkov 68a28b4eee experimental: Proof of concept of the Animation component using ScrollTimeline (#4797)
## Description

ref #2645

Proof of Concept for the Animation Component Using ScrollTimeline

For FF and Safari `scroll-timeline-polyfill` is used.

SSR Support https://animate.development.webstudio.is/playground
Storybook Part 1. 

https://6382151c8b47d4399fb9fc69-limlyrmprp.chromatic.com/?path=/story/sdk-components-animation-scroll-animations--in-out

Next steps:

- Add stories with additional examples i.e. closest usage, images etc.
https://scroll-driven-animations.style/
- Add support to view animations
- Add view animations examples
- Add enter/leave actions and animations support
- Builder UI
- Add lottie, rive etc compatibility (should work through
context.getAnimations()[0].effect.getComputedTiming().progress)

## 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:
0000)
- [ ] 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
2025-02-01 14:57:36 +03:00
Ivan Starkov e785804b19 chore: Update remix and netlify (#4262)
## Description

fixes
https://discord.com/channels/955905230107738152/1292985076702908500/1292985076702908500

tested deploy, builder, seems like all is fine


## 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-10-11 11:14:15 +03:00
Ivan Starkov 0b0707e61f chore: Project login (#3990)
## Description

New Project login without any automation or link changes.

corresponding PR
https://github.com/webstudio-is/webstudio-saas/pull/319


## Steps for reproduction

- Goto [Tmp/Login manul
page](https://oauth.staging.webstudio.is/tmp/login)
- Manually login/logout to project domains

## 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-08-24 08:58:54 +03:00
Ivan Starkov dc09616be0 fix: Image Manager. Ensure picture click and delete functionality work consistently (#3514)
## Description

closes #3504

Reflow caused by Style element rerender sometimes cause focus lose.
It can be or chrome issue or Mutattion observer used in radix focus
scope.



## 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-07 13:48:55 +03:00
Ivan Starkov 4deeaca2b3 build: cloudflare cli template (#3157)
## Description

Fully based on this guide
https://developers.cloudflare.com/pages/framework-guides/deploy-a-remix-site/

## 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-13 19:04:41 +03:00
Bogdan Chadkin 10ca57d5ad chore: bump radix (#2423)
- select
(https://github.com/radix-ui/primitives/commit/a3dadb0a825524dd60629d426538dac74930791a)
- avatar
(https://github.com/radix-ui/primitives/commit/baf98624513229d65ff033152f6c0c7b74e2fcba)
- colors
(https://github.com/radix-ui/colors/commit/878dd0a118db8151b854979a2a7001ee6493bcec)
- dialog
- dropdown-menu
- popover
- popper
(https://github.com/radix-ui/primitives/commit/929e9f962ccb148dc6467684d1df8cec746dcae7)
- portal
- scroll-area
- toast
- focus-scope
(https://github.com/radix-ui/primitives/commit/2ce556da2faf526d6349a8d431293a8d0cc9b36c)
- tooltip
- navigation-menu
2023-10-06 13:01:35 +04:00
Ivan Starkov 357f35d7a5 feat: Implement Rate Limiting (#2393)
## Description

This PR integrates a rate-limiting mechanism into the app using Vercel's
edge-layer middleware in combination with the Hono framework. This
middleware is written in JS with full JSDoc TypeScript typings.

### Architecture & Strategy
Vercel Middleware: Serves as the front-line defense, running at the edge
for optimal performance.
Hono Framework: For granular control, we utilize Hono middlewares for
applying or skipping rate limits.
Additionally, non-expensive routes benefit from an ephemeral cache to
further optimize performance

### Current Limitations
Due to a dependency on CommonJS, we cannot use TypeScript fully.
Consequently, session configurations are not yet shared across multiple
files. All utility functions are present in a single file for the time
being.


### Logic Breakdown
- Assets: Rate limiting skipped.
- Service Calls: Rate limiting skipped.
- /rest/ai/* Endpoint: Rate limit of 20 requests per 5 minutes,
identified by userId or IP.
- Unauthorized Users: Rate limit of 5 requests per 5 seconds, based
solely on IP.
- Authorized Users: Rate limit of 20 requests per 5 seconds, based on
userId.

### Next Steps
Plan to migrate to ESM for enabling TypeScript support for better
maintainability.
Use multiple regional KV

### Debug endpoint.
[Rate limit debug
endpoint](https://webstudio-builder-kscynssns-webstudio-is.vercel.app/rate-limit-debug)


## 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-10-03 12:16:18 +00:00
Ivan Starkov 4753c2ac46 Fix shared link name is not editable (#2279)
## Description

Shared link name is not editable because every input change closes
popover with the input.

Here is the fix and the explanation.

This is already fixed in rc radix versions and will be in the next
stable release

https://github.com/radix-ui/primitives/blob/28bebf2c6992d056244845c898abeff45dec2871/packages/react/focus-scope/src/FocusScope.tsx#L115

Without this PR the issue looks:

Editing input 
<img width="353" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/b6ba547c-4286-45f2-b351-9122780cb482">
cause this button 
<img width="216" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/4d6a26c3-3336-4995-b0b4-c38200e34e07">
to switch onto `pending` state
<img width="211" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/f214d9a9-3454-4b1b-8603-48224fa370d1">
what cause handleMutations to move focus onto parent popover 
Child popover lost focus and closes.


## Steps for reproduction

Click Share, Edit link name, 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.example`
and the `builder/env-check.js` if mandatory
2023-09-08 10:13:09 +03:00
Bogdan Chadkin c40f5e507d Replace @types/css-tree override with patch (#1783)
Split from https://github.com/webstudio-is/webstudio-builder/pull/1634

We may need more things from css-tree and reexporting everything is
harder to maintain so here added patch instead of types override.
2023-06-14 17:51:13 +03: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
Mateusz Burzyński 678c9a273f Generate declaration files before publishing packages (#1351) 2023-04-07 07:14:18 +02:00
Bogdan Chadkin 2757da21d6 Migrate storybook to vite (#1209)
Webpack builder is very slow and hard to use becaause of it. It gave us
a lot of issues recently.

So here I migrated to vite builder. The experience is great. It caught a
bug in shallow-equal package, though fixed in latest release.

There was one issue with reload. When modify packages and rebuild
storybook watcher detects a lot of changes and goes into infinite loop.
Solved by importing packages sources directly with export conditions
vite allows to configure. Now any changes in packages can be reflected
in builder storybook without manual reload, restart and additional
watching.

We would get much better experience with remix if they allow to
configure this.

Also had to remove @storybook/addon-interactions which are incompatible
with vite builder.
2023-03-10 12:51:38 +03:00
Bogdan Chadkin b3c87af7c1 Migrate to pnpm for package management (#641)
- setup corepack for pnpm and forbid yarn usage with "engines" field
- converted yarn lockfile into pnpm lockfile with `pnpm import` command
- replaced yarn with pnpm in scripts and github actions, had to use
custom cache to support corepack

This PR is only migration. Will use new pnpm features in other PRs.

```diff
du -ckd1 node_modules (yarn)
- 1125032

du -ckd1 node_modules/.pnpm
+ 857456
```

Install time (including cache downloads) in github actions reduced from
42s to 23s


## 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?
  - [x] conceptual
  - [X] 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-22 12:16:13 +03:00
Mateusz Burzyński 86292353bc Unify Storybook config (#585)
This PR moves most of the Storybook configs into a single, private,
package that can be imported/required by your packages. It aims to keep
the config the same for all of them as much as possible - so, for
example, all of the packages are now using Webpack 5 in their
Storybooks.
2022-12-17 21:50:59 +01:00