Commit Graph
34 Commits
Author SHA1 Message Date
Oleg Isonen 6e10ae3809 fix: Fix Builder paste transfer data handling and publish sync edge cases (#5861)
- Fix publish sync for empty JSON data variables
- Retry transient asset downloads once with shared sync-client backoff
- Fix Builder paste handling for Webstudio transfer data
- Add transfer/data-envelope terminology and colocated runtime
data-format modules
- Rename page clipboard runtime operation to page transfer semantics
- Report malformed Webstudio/Webflow paste data through paste results
instead of inserting it as text
- Add browser-level E2E coverage for instance, page, folder, template,
generic plugin, malformed data, native input, and content-mode paste
flows

## Details

- Allows empty JSON data variables to sync/publish correctly.
- Adds asset download retry coverage and uses shared backoff logic.
- Introduces runtime `data-formats` modules for data envelopes, instance
transfer data, and page transfer data.
- Removes stale clipboard aliases and `validateTemplateStructure`.
- Keeps clipboard as a Builder UI transport concern while
runtime/protocol use transfer-data terminology.
- Changes paste plugins to return expressive success/error results so
callers can show toast errors and stop fallback insertion.
- Prevents malformed Webstudio transfer payloads from falling through to
text/HTML/markdown insertion.
- Handles malformed Webflow-owned paste data without throwing.
- Adds shared copy-paste fragment insertion helpers to reduce duplicated
breakpoint-warning/fragment-data logic.
2026-07-10 13:51:55 +02:00
Oleg Isonen d291e4b671 feat: Builder api runtime contracts guardrails for MCP (#5857)
This PR expands Webstudio MCP and CLI into a more complete agent
authoring interface. Agents can discover project capabilities, edit real
Webstudio content, use data/resources, verify visual output, and report
useful issues when workflows fail.

## MCP User Capabilities

- Create, update, duplicate, reorder, and delete pages.
- Create pages from templates and manage reusable page templates.
- Inspect project pages, instances, props, styles, assets, variables,
resources, and metadata.
- Insert Webstudio components and authored JSX fragments into pages.
- Edit text, props, styles, breakpoints, design tokens, and CSS
variables.
- Update page metadata, SEO fields, redirects, marketplace metadata, and
project settings.
- Create and use static data variables.
- Create and use dynamic resources fetched over HTTP.
- Use REST, GraphQL, and built-in system resources in authored pages.
- Bind data variables and resources to visible page content.
- Create resource-backed pages such as sitemap XML, structured SEO data,
and API-driven content sections.
- Preview current project state without requiring a publish step.
- Capture screenshots for visual verification.
- Verify responsive designs across desktop, tablet, and mobile
breakpoints.
- Use screenshot diff and OCR-style checks to inspect rendered output.
- Reset and refresh local MCP project state when needed.
- Discover available CLI/MCP commands from generated manuals.
- Use clearer examples for resources, data variables, JSX authoring,
previewing, and visual checks.
- Read marketplace product metadata without requiring a full project
snapshot.
- Get safer guidance when using low-level patch tools.
- Get a ready-to-copy Discord report template when MCP/CLI behavior is
confusing or broken.
2026-07-10 02:13:22 +02:00
Oleg Isonen 2a77c2a8b5 feat: Multiselect (#5834)
Closes https://github.com/webstudio-is/webstudio/issues/5310
2026-06-24 21:20:33 +02:00
Oleg Isonen ac29cf7d1d feat: Keyboard shorthands for instance positioning and slot bug fixes (#5821)
Closes https://github.com/webstudio-is/webstudio/issues/4586
Closes https://github.com/webstudio-is/webstudio/issues/4619

## Summary

Fixes shared Slot editing so linked Slot occurrences stay consistent
across structural edits and labels.

## Changes

- Fixed moving a direct Slot child out of a Slot so the child is removed
from all linked Slot occurrences.
- Fixed unwrapping a direct Slot child so the child is removed from all
linked Slot occurrences.
- Added linked Slot label sync when renaming from Navigator or Settings
panel.
- Added/updated tests for canonical Slots, legacy Slots, nested Slot
children, keyboard moves, unwrap, reparent, and label sync.
- Simplified stale Slot detach logic that was incorrectly cloning only
the selected Slot occurrence.

## Testing

- `pnpm --filter @webstudio-is/builder test --
app/shared/instance-utils/...`
- `pnpm --filter @webstudio-is/builder test --
app/builder/shared/commands.test.ts`
- `pnpm --filter @webstudio-is/builder typecheck`
- `pnpm lint`
- `git diff --check`
2026-06-16 02:25:28 +02:00
Oleg Isonen b006947a85 feat: WIP realtime collaboration to builder (#5726)
https://github.com/webstudio-is/webstudio/issues/46
2026-04-27 23:19:21 +02:00
Oleg Isonen d339dc55cf feat: Add token conflict detection and resolution for marketplace templates (#5609)
- Add Token class and token() helper in template package for JSX token
support
- Refactor insertFragmentWithConflictResolution to
detectFragmentTokenConflicts
- Refactor insertPageWithConflictResolution to detectPageTokenConflicts
- Move dialog display to callers for better testability
- Add conflictResolution parameter to page-utils
- Add comprehensive tests for token functionality and conflict detection
- Fix bug: remove .values() call on arrays in breakpoint handling
2026-02-05 22:34:17 +01:00
Oleg Isonen 11ba996f13 feat: New token conflict resolution logic (#5524)
Fixes https://github.com/webstudio-is/webstudio/issues/5491

## Description

- When pasting an instance with tokens, we can compare the name and the
contents. If they are identical, we can choose the existing one and
avoid having any conflicts.
- When pasting a token and the name is already used, add a numeric
suffix to it.
- find duplicate tokens command that will go based on content even if
name is different


## 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-12-18 17:31:31 +01:00
Oleg Isonen dcdac0eaa7 feat: Project settings dialog accessible from dashboard (#5514)
## 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-12-15 17:23:16 +01:00
Bogdan Chadkin 655b887ab9 feat: support paste from other browsers (#5181)
Users started to build own marketplaces. And we found paste something
copied from other browser like firefox -> chromium based app doesn't
work. This is because OSs guarantee only text/plain to be stored in
system clipboard.

Here I changed copy paste logic to copy as text/plain and paste as both
application/json and text/plain if possible.
2025-05-04 18:41:00 +04:00
Bogdan Chadkin b798809870 refactor: decouple system store from variables (#4888)
We are moving away from binding system to variables and instead gonna
have one global variable.

Here moved system values into separate store coupled to pages instead of
variables.

Also fixed suggestions in address bar, probably broke while design
system refactorings.

Testing
- submit form with one named input
- check system value is rendered
- check system value can be inspected
2025-02-18 23:28:29 +07:00
Bogdan Chadkin 870de384e3 feat: restore variables by name when copy-pasting (#4824)
Ref https://github.com/webstudio-is/webstudio/issues/4768

Unset variables when copy and restore when paste.

Now you can copy instances with references to `system` variable and it
will be connected on another page as well when you paste.
2025-02-04 10:59:06 +07:00
Bogdan Chadkin 94f219c249 refactor: rewrite core components templates with jsx (#4756)
Here refactored all core components with jsx templates and moved them to
sdk package. Fixed all imports as well.
2025-01-17 18:29:40 +07:00
Bogdan Chadkin bb8e41ab57 refactor: migrate builder tests to vitest (#4415)
Really, this was too easy
2024-11-13 14:39:17 +04:00
Bogdan Chadkin f36fe2fa55 refactor: store selected instance in awareness state (#4378)
For now sync awareness with selected instance selector. Added selectPage
and selectInstance utilities to update awareness properly.
2024-11-07 12:38:10 +04:00
Bogdan Chadkin 6b1ea5eb4a refactor: move selected page into awareness state (#4371)
Ref https://github.com/webstudio-is/webstudio/issues/4364

We need to implement universal linking of current user view. For this I
added "awareness" state which reflects terminology from collaboration
libraries.

First migrated selected page id and fixed usages.
2024-11-06 02:29:52 +04:00
Oleg Isonen 700c9b95ab feat: Improve autoplacement when inserting component via 1-click in components panel or via paste (#3422)
Closes https://github.com/webstudio-is/webstudio/issues/3149

## Description

As a user when I have Heading, Text or similar instances selected which
have a single text node instance, I expect an added component to insert
AFTER such instances.

## Steps for reproduction

1. add heading
2. select heading instance
3. 1-click box
4. see box was added after the heading
5. repeat the same with paste
6. repeat the same with any instance that has only text inside

## Code Review

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

- [ ] hi @johnsicili , I need you to do
  - 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-27 10:18:22 +02:00
Bogdan Chadkin cacfbee307 experimental: add content embed aka rich text component (#3315)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Embed Content is a component with a way to bind html from cms with
ability to style itself and all descendants generated from cms rich
text. All Content Embed children are "virtual" Descendant instances with
predefined selector.

<img width="1404" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5635476/8d7cf210-32cb-4e63-bfe7-8af8c3e2d78d">
2024-05-09 13:20:47 +04:00
Bogdan Chadkin dad898e6a4 refactor: move expressions into base sdk (#3032)
We need to move stuff not related to react out of react-sdk into
universal sdk package.
2024-03-19 02:02:07 +07:00
Bogdan Chadkin 39ee44b94e experimental: add system variable (#2997)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Here added system variable to every page body instance. It will be used
to replace path params and support search params.

For now will be hidden until cms launch.

Added migration to modify every page in all projects. Added logic to
create and duplicate system data source along with pages.
2024-03-13 12:26:07 +07:00
Bogdan Chadkin a76c29fc05 feat: inline variables outside current component/slot (#2778)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Important constrain on the way to custom components to not use data
sources defined in other components when copy paste.

## Steps for reproduction

1. Test covers it
2024-01-18 23:37:50 +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
Oleg Isonen b2bf220ed6 chore: Rename all *Store to $store (#2747)
## Description

Pure renaming, nothing else.

## 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-01-09 13:32:51 +01:00
Bogdan Chadkin 11b799d4f7 feat: load resources in builder (#2714)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here improved resource management to load defined resources and store in
variable values to allow preview data. Builder requests data from proxy
route every time resources or their variables are changed.

<img width="1449" alt="Screenshot 2023-12-25 at 01 09 58"
src="https://github.com/webstudio-is/webstudio/assets/5635476/6614a356-0170-4606-9b60-d39b1bc09837">

Data to test is here
https://gist.githubusercontent.com/TrySound/56507c301ec85669db5f1541406a9259/raw/a49548730ab592c86b9e7781f5b29beec4765494/collection.json
2023-12-27 23:54:09 +07:00
Bogdan Chadkin 61d664fc87 refactor: support parameter data source for collection item (#2671)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added dataSource.type = 'parameter' without initial value because
value is always provided by context. It let us fix a few issues with
variables without complicating logic.

- prevent deleting parameter variable (collection item) in variables
panel
- allow changing only name of parameter variable
- show only name in the list of variables
- fix removing expression from collection data
- hide item parameter from collection variable list
- prevent editing parameter value from props
- make collection unstylable
2023-12-08 11:42:18 +07:00
Bogdan Chadkin 8e1683ed86 refactor: switch to instances slice for copy paste (#2666)
Use same well tested utility to slice and insert its copy for copy
paste. Moved most utilities inside of instance plugin and added more
tests for it.

## Steps for reproduction

1. play with copy paste
2023-12-06 23:49:48 +07:00
Bogdan Chadkin d361c9ecee feat: add collection component to builder (#2657)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added a "core" collection component to support iterating over json
arrays.

There is a lot of room for unification of all this logic though would
require building reactive tree abstraction.

Canvas automatically renders stub component for collection to make it
droppable. We can do the same for slot component.

Slot and Fragment eventually will go to "core" components too.

Added json/parameter prop types to embed template to support collection.

Fixed loosing focus while typing in json prop.

## Steps for reproduction

1. Drop collection component
2. play with it
2023-11-29 17:07:28 +03:00
Bogdan Chadkin 6dd5b0687a refactor: drop legeacy data source prop support (#2600)
Ref https://github.com/webstudio-is/webstudio/issues/2532

We successfullly migrated prod to expression prop. Now we can safely
remove legacy data source prop
handling across codebase.
2023-11-11 18:07:17 +03:00
Bogdan Chadkin 052fe4e3ce refactor: add expression prop (#2582)
Ref https://github.com/webstudio-is/webstudio/issues/2532

On the last discussion about bindings we agreed expression are always
bound to single prop and cannot be reused.

Here added new prop.type = 'expression' as a replacement to
dataSource.type = 'expression'.

This will let us unify expression/variable reference and avoid deep
dependencies. Expressions and actions become similar.

For now both expression prop and legacy expression data source are
supported until we migrate completely in db.
2023-11-08 20:46:57 +03:00
Bogdan Chadkin fa06b7d495 feat: reuse variables on copy/paste within same tree (#2580)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here improved copy/paste behavior.

Before variables outside of copied tree were inlined. For example
ErrorMessage were loosing its expression when duplicated within same
form.

Now expressions and variables are preserved
and variables are inlined into expressions when paste target do not have
such variable. For example ErrorMessage get `"initial" == "error"`. With
upcoming UI it will be more obvious. The main idea here to not loose all
expressions but only references to unavailable variables.
2023-11-07 18:58:50 +03:00
Ivan Starkov 6f3adf1cc4 feat: Add SiteSettings Dialog (#2527)
## Description

Dialogs and saving of Site Settings and Page Settings.

Bugs & Fixes
- [x] - Use page name on swap to set path i.e. `/home`


Next PRs.

- CLI support (generating head title links and metas)
- <img width="582" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/ab348eb8-0be0-49fc-b15e-352f089812db">
- <img width="266" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/6c272cf2-09d2-4f43-af9f-7460d84fa100">
- Not sure why we need upload button at all, anyway in next PRs <img
width="451" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/a62d2a9d-8793-4d9b-a2c2-4992358f5b10">



---


<img width="173" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/554f2310-579d-4326-8ca7-dd84a13a114a">

<img width="386" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/f0cfb8be-49ab-4b7f-baa3-d68938a2125a">


<img width="375" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/10dfd728-de87-4c91-bca0-0216ad7e5f96">


- [x] - Make homePage is not working


## 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-30 12:18:35 +02:00
Bogdan Chadkin 5794e8d1e7 Move app schema to sdk (#2237)
We are planning to decouple cli from prisma and all unrelated packages.
Here moved whole app schema into sdk package.
2023-09-03 22:27:30 +04:00
Bogdan Chadkin 685ca24552 Support actions copy paste (#1976)
Here added action copy paste support.

When all action dependencies are scoped to copied instance new variable
nams are ussed.

When some any dependency is not scoped execution is removed from copied
prop.
2023-07-28 01:53:58 +03:00
Bogdan Chadkin be74680674 Support duplicating instances (#1995)
Fixes https://github.com/webstudio-is/webstudio-builder/issues/1994

Here changed behavior when copy and paste without changing instance
selection. Now it works as duplicating and copy is inserted after
selection.

Added cmd+d and ctrl+d shortcut to do this with single press without
polluting clipboard.
2023-07-27 15:52:10 +03:00
Bogdan Chadkin b226343599 Support copy pasting of data sources (#1963)
Here fixed the case when copy pasted form looses state and give errors
on submit.

Immerhin now converted to esm to work in tests.
Added tests for instances copy paste plugin.
The new logic is copy data sources as is if they are bound to copied
instances.

The new computeExpressionsDependencies used to detect if expression
depends on data sources outside of copied instances scope.
2023-07-23 11:56:13 +03:00