825 Commits
Author SHA1 Message Date
Oleg Isonen 6a3a75210f getCollectionEntries 2026-01-16 23:08:02 +00:00
Oleg Isonen 18cee31b4f fix publish 2026-01-16 22:56:36 +00:00
Oleg Isonen 33f720fb9f fix: Fix asset resource on published sites (#5565)
## 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
2026-01-15 18:26:32 +01:00
Bogdan Chadkin 3fa0715560 fix: improve SSG output (#5555)
Ref https://github.com/webstudio-is/webstudio/issues/5389

1. **Title and meta tags (specified in page settings) are no longer
removed when page is loaded.** For this I switched to the same
components we use in cloud template.

2. **Avoid duplicating custom code**. Both server and client rendered
the same custom code and react instead of hydrating just duplicates
them. To fix this I removed custom code from client side so all scripts
and styles are rendered only once.

3. **Removed origin from og:image url.** Turns out it is not necessary
to have full url for og:image to work, all services are capable to
resolve url. We can remove it at least for static websites.

4. **SSG rendered fake url (https://url) in ld-json** which can have
unexpected results in search engines. Removed it, google should be able
to provide necessary url by itself.
2026-01-04 13:40:57 +03:00
Bogdan Chadkin d9d70ac909 fix: generate proper dts when CLI is published (#5482) 2025-12-06 00:33:40 +03:00
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
Bogdan Chadkin de444a3501 fix: copy paste search params in resources (#5412)
Reproduced when tried to insert the new baserow template
2025-09-27 16:47:49 +03:00
Bogdan Chadkin 05a2dd290e feat: allow user to add asset description (#5369)
Ref https://github.com/webstudio-is/webstudio/issues/3263

Now users can control "alt" for all image uses with asset description.



https://github.com/user-attachments/assets/c0e5ae4b-d2b0-4ec1-bf93-c385816369d1
2025-08-12 15:57:38 +02:00
Bogdan Chadkin 49bb819ab1 fix: support videos in self-hosted websites (#5340)
Ref
https://discord.com/channels/955905230107738152/955905231227609158/1400561168648638576

User tried to self hosted a website with video component which got
converted to /cgi/video which does not exist in self hosted targets.

Here moved the logic into own custom loader and fall back to original
url.
2025-08-03 02:12:42 +02:00
Bogdan Chadkin 1eb11fdb34 feat: autocomplete SVG attributes (#5331)
Ref https://github.com/webstudio-is/webstudio/issues/5258

Now user will see all available attributes for any SVG element.

<img width="283" height="507" alt="image"
src="https://github.com/user-attachments/assets/750c3027-aada-4e55-b429-c5adb5449158"
/>
2025-07-18 15:47:35 +02:00
Bogdan Chadkin 4dfdf50380 feat: migrate forms components to html elements (#5230)
Ref https://github.com/webstudio-is/webstudio/issues/3632

This is big one. So I switched to html elements whole forms section in
components. Though here I introduced some deviation from specification

**Textarea**

Initial value is represented as text content
```html
<textarea>content</textarea>
````

Though it is trickier to manage text content as state and all frameworks
rely on value property of textarea dom interface.

**Select**

Similar story. There is no value attribute and state is represented by
selected boolean attribute on options

```html
<select>
  <option value="value1" selected></option>
  <option value="value2"></option>
</select>
```

We replace selected attribute on option with value attribute on selected
when paste.

So basically all form elements are using "value" and "checked"
attributes which can be easily mapped to html and all frameworks.
2025-05-24 15:11:49 +03:00
Bogdan Chadkin c14238ed5e experimental: override some tags with components (#5210)
Ref https://github.com/webstudio-is/webstudio/issues/3632

Remix client routing should still work even if we go full html. Here
added tag overrides to component generator so sdk could pass component
replacements for some tags like

- body -> Body
- a -> Link
- form -> RemixForm

See example here
https://github.com/webstudio-is/webstudio/pull/5210/files#diff-f2df0aea6543a33e57d770ff1791da886ab3dfd6dec37da4a41a611b9b13a19aR6
2025-05-19 13:20:15 +03:00
Bogdan Chadkin e35de86421 experimental: add icons to html elements (#5219)
Ref https://github.com/webstudio-is/webstudio/issues/3632

<img width="281" alt="Screenshot 2025-05-18 at 18 37 16"
src="https://github.com/user-attachments/assets/0b95b674-c9fa-4f5d-b79d-b1ce6023dba8"
/>
2025-05-18 20:46:45 +03:00
Bogdan Chadkin 646c5b38e7 fix: normalize html attributes only when not defined by component (#5215)
Proper fix for https://github.com/webstudio-is/webstudio/pull/5211

Now props meta are available in component generator and can be used to
figure if prop is defined by component or comes from html attributes.
Added same logic in canvas and component generator.

Also got rid from no longer necessary registeredComponentPropsMetas
store since all props are described by component meta.
2025-05-17 10:11:56 +03:00
Jaya Krishna Namburu 36fdabb6c7 fix: default twitter og preview to use summary_large_image for bigger previews (#5188)
## Description

fixes #3104 

For forcing twitter to use large-card size. We need to set
`summary_large_image` meta tag in the header.

## Steps for reproduction

- Create a new project with a page.
- Set an image for the social image in the page settings.
- Deploy the site, and check the open graph preview using some of the
tools online


https://tweethunter.io/tweetpik/twitter-card-validator?url=https%3A%2F%2Fcelebrated-pony-026734.netlify.app%2F
<img width="811" alt="Screenshot 2025-05-06 at 8 41 02 PM"
src="https://github.com/user-attachments/assets/c1b0ad29-c0c1-49be-8106-a3f7ec6a1387"
/>



https://robolly.com/twitter-card-preview?url=https://celebrated-pony-026734.netlify.app

<img width="1176" alt="Screenshot 2025-05-06 at 8 40 57 PM"
src="https://github.com/user-attachments/assets/dcf59282-9f91-44fc-b775-87d4a2749e57"
/>


## 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:
0000)
- [x] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
2025-05-08 15:34:20 +05:30
Jaya Krishna Namburu be6b5fa966 fix: og-image bug fix for local assets (#5184)
## Description

Currently when a project is exported using `cli` and the built using any
inbuilt templates. The `og:image` fails with local assets. As the cli is
not prefixing the `assetBaseUrl` to the image name. Which is failing to
load.

## Bug 
Deployed Url - https://og-image-bug.netlify.app/
Open GH -
https://orcascan.com/tools/open-graph-validator?url=https%3A%2F%2Fog-image-bug.netlify.app%2F
![Screenshot 2025-05-05 at 6 18
20 PM](https://github.com/user-attachments/assets/4e2f2739-0d9f-4254-98ec-cbb7310a2023)

### Fixed version
Deployed url - https://og-image-fix.netlify.app/
Open GH -
https://orcascan.com/tools/open-graph-validator?url=https%3A%2F%2Fog-image-fix.netlify.app%2F
![Screenshot 2025-05-05 at 6 19
06 PM](https://github.com/user-attachments/assets/932db416-91df-44e4-9576-3256a8d0d76a)

I am passing the `assetBaseUrl` to `ProjectSettingsMeta` inside the
`react-sdk`. And using it as prefix if defined.


## Steps for reproduction

- Create a project and add a page to it.
- Upload and use an image for the `SocialImage` section under Page
Settings.
- Deploy the site, and share it anywhere for the `og:image` to kick in
when shared.
2025-05-05 19:21:39 +04:00
Bogdan Chadkin 0cbfc2db19 refactor: move animate property to sdk runtime (#5171)
Vite 6 is having troubles bundling app which depends on whole sdk. Plus
it may increase app bundle size.
2025-04-30 11:05:50 +04:00
Bogdan Chadkin 6fa88d9711 refactor: render html attributes for all components (#5163)
Ref https://github.com/webstudio-is/webstudio/issues/3632

Here enabled converting class -> className for all components with tags.
Now it does not affect anything though later will unlock using html
attributes instead of component props.

Also got rid from huge map with react properties and replaced it with a
set of proper aliases.
2025-04-29 15:40:43 +04:00
Bogdan Chadkin 452c50a41a refactor: upgrade vite for vitest and storybook (#5165)
Tough cookie. There is a problem with resolving react-remove-scroll,
figured it by reducing allowed amount of server conditions.
2025-04-29 14:17:42 +04:00
Bogdan Chadkin 87312f8809 experimental: generate meta for html and aria attributes (#5149)
Here added lists of attributes from html and aria specifications for
future Element component.

Html provides an easy to navigate table with all types with relations to
specific tags and descriptions.

Aria list with types is extracted from aria-query library. Though
descriptions are parsed from specification. In the future we will use
more aria-query data to navigate specific roles.

All attributes types are tested with react types

You can see generated data in
- packages/html-data/src/__generated__/attributes.ts
- packages/html-data/src/__generated__/aria.ts

Succeeds https://github.com/webstudio-is/webstudio/pull/2341
2025-04-21 13:13:50 +07:00
Bogdan Chadkin 395a6b9e72 refactor: move embed template into ai (#5148)
To not bloat cli and remove embed template together with legacy ai
eventually.
2025-04-21 12:47:51 +07:00
Bogdan Chadkin 21d09cc1f0 refactor: migrate radix to component content model (#5143)
Replaced legacy constraints with component content model in radix
components. Checked all locally.

Removed meta.type for good.
2025-04-19 15:54:48 +07:00
Ivan Starkov a5009f5159 fix: Context onError type fix (#5137)
## 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-04-18 13:16:22 +03:00
Ivan Starkov a068bc9ab4 experimental: Error support on components level (#5136)
## Description

Error toasts in components instead of failing

## 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-04-18 11:04:59 +04:00
Bogdan Chadkin 88e5119b02 feat: add project and date to published websites (#5114)
Added following attributes to html element

- data-ws-project
- data-ws-last-published

This should help debugging issues and webstudio discoverability

<img width="851" alt="image"
src="https://github.com/user-attachments/assets/a4572070-a6da-40ec-88cd-308ab7f7d22f"
/>
2025-04-10 17:23:13 +07:00
Bogdan Chadkin c5ce5f6313 refactor: move index property to sdk (#5097)
Slowly moving stuff out of react-sdk
2025-04-05 22:50:06 +07:00
Bogdan ChadkinandOleg Isonen 9032a109ca experimental: support ws:element component in CLI (#5071)
Ref https://github.com/webstudio-is/webstudio/issues/3632

Added `ws:element` component to represent any html and svg elements
within webstudio.

It is rendered as `<div>` by default which can be customized with "tag"
system property (instance.tag in data).

Here added only CLI generator support with converting html attribute
names to react compatible. Will add builder support separately.

---------

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2025-04-03 14:06:50 +07:00
Bogdan Chadkin 1dc7af7621 refactor: add tag property control (#5080)
https://github.com/webstudio-is/webstudio/issues/3632

Here added dedicated tag property control which will automatically
migrate Box, Text and Heading components to instance.tag internally and
will be used for ws:element component.

Later will extend tag control with tag descriptions and auto inferring
matching tags.

<img width="428" alt="Screenshot 2025-04-02 at 15 56 46"
src="https://github.com/user-attachments/assets/fa8d24ba-b9e8-4221-b47a-a9e923475bb6"
/>
2025-04-03 11:07:43 +07:00
Bogdan Chadkin a7eff393bb refactor: manually namespace meta (#5073)
Here got rid from auto namespacing meta.constraints and
meta.indexWithinAncestor to unlock using components from other sdk
packages.

Now package prefixes should be explicitly specified in meta though with
the help of proxy.

Though exports are still need to prefix automatically when install
package.
2025-03-31 18:06:38 +07:00
Bogdan Chadkin 5bfd37f413 refactor: drop embed template usages (#5040)
Dropped meta.template and copy paste plugin with embed template. The
only left usage is AI generation.
2025-03-25 10:58:20 +07:00
Bogdan Chadkin 5b3144d656 refactor: bump zod (#5035)
All three have minor feature updates

- zod
- zod-validation-error
- zod-to-json-schema
2025-03-25 00:17:05 +07:00
Ivan Starkov 10a4c70902 experimental: Show animation is running is Nav Tree (#5023)
## Description

Show eye icon (in primary color) if Node is Animating because of
Selection or if it's Pinned.

<img width="757" alt="image"
src="https://github.com/user-attachments/assets/41597955-6974-49c4-96a9-708480e4d644"
/>

## 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-21 21:24:51 +05:00
Ivan Starkov 35d0d7c8ac experimental: Breakpoint support for the Animation component (#5012)
## Description

https://animations.wstd.work/
Breakpoints Example

See on narrow screen animation is disabled.

<img width="699" alt="image"
src="https://github.com/user-attachments/assets/f464fdf3-f57a-4cf7-91a1-beb355f8a5bd"
/>



## 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-18 23:30:17 +05:00
Bogdan Chadkin dd08852d43 build: upgrade typescript (#4991)
Upgraded to 5.8 and bumped all type definitions.
Enabled erasable syntax only flag and got rid from one case in
expression editor.
2025-03-13 11:21:00 +07:00
Bogdan Chadkin 935983b543 build: upgrade checks (#4982)
- vitest
- testing-library (got much lighter)
- eslint and plugins (@types/eslint__js no longer necessary)
- storybook
- esbuild
2025-03-11 15:22:57 +07:00
Bogdan Chadkin 7a41a1e733 fix: render empty page when xml is empty (#4966) 2025-03-08 01:21:12 +07:00
Bogdan Chadkin a344b34cf7 refactor: generate only asset name for published sites (#4947)
We don't really need anything from asset object on published sites
except the name to resolve the file.

Here got rid from Asset objects for favicon, fonts and backgrounds. This
should reduce client bundle where a lot of assets are used.
2025-03-05 20:54:34 +07:00
Bogdan Chadkin bdf4463098 fix: set proper default value in radix with content block (#4937)
User reported in discord.

Radix components like accordion does not open first item by default when
use with content block. The reason was in our default detection.

We used indexes within ancestor and when put item inside of content
block template it gets 0 but not rendered.

Here improved the logic to reset index when render inside of block
template.

<img width="837" alt="Screenshot 2025-03-01 at 21 14 09"
src="https://github.com/user-attachments/assets/788df39a-b7c5-466b-a80e-09cc40de9e3f"
/>
2025-03-04 18:26:29 +07:00
Ivan Starkov 62a6d939d8 experimental: Animate UI (#4851)
## 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-02-24 14:27:50 +05:00
Bogdan Chadkin 21271086f2 fix: prevent inserting into instance with placeholder (#4901)
Closes https://github.com/webstudio-is/webstudio/issues/4897

Added "placeholder" field to component meta to signal the instance
accepts should not be insertion target. This reverts us to previous
behavior even with empty instances.

Also slightly refactored placeholder rendering to use attr() instead of
extra css variable.
2025-02-22 23:56:30 +07:00
Bogdan Chadkin 250b525ef9 refactor: move css generation to sdk (#4889)
No changes. Just moved generateCss from react-sdk to sdk.
2025-02-18 21:14:05 +07:00
Bogdan Chadkin b7e1c86f68 experimental: generate global system variable with CLI (#4885)
Here added support for generating global system variable with CLI. It's
not available yet in builder though.

Global system not presented in data but instead can be referenced with
`$ws$system` in expression instead of encoded id like
`$ws$dataSource$id`. Legacy page system variable will continue to work.
2025-02-17 16:50:55 +07:00
Bogdan Chadkin 8ed3fbb085 feat: support global data variables (#4870)
Ref https://github.com/webstudio-is/webstudio/issues/4166
https://github.com/webstudio-is/webstudio/issues/3686

Added "Settings" section to global root. Now users can create data
variables which are available for all pages and inside slots.



https://github.com/user-attachments/assets/be2cf862-08ec-427e-aea3-076fa03a4437
2025-02-15 01:23:16 +08:00
Ivan StarkovandOleg Isonen 3c42f8ca4b experimental: View Animations support (#4817)
## Description

ref  #2645

- [x] - Add view-timeline-name and scroll-timeline-name support, and
prefixer (use custom property for unsupported browsers)
- [x] - Add initial story

## Steps for reproduction


https://6382151c8b47d4399fb9fc69-uljkhwtbmc.chromatic.com/iframe.html?args=&globals=&id=sdk-components-animation-view-animations--in-out&viewMode=story

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

---------

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2025-02-04 06:02:55 +03:00
Bogdan Chadkin c5f15d2a1c fix: render nothing on website when collection is invalid (#4821)
User got 500 on published site. Turned out collection got invalid data
(not array). We need to keep site working in such cases, missing piece
will be more intuitive than 500 on whole website.
2025-02-03 09:47:00 +07:00
Bogdan Chadkin eb2a2750b8 refactor: support resources in jsx templates (#4800)
Added full resource configuration in templates.
Will be useful for testing.
2025-01-29 00:26:20 +07:00
Bogdan Chadkin 6b04c9762d feat: allow saving expressions with unset variables (#4792)
Ref https://github.com/webstudio-is/webstudio/issues/4768
https://github.com/webstudio-is/webstudio/issues/4753

User can paste expression with not defined variable and should get it
saved in case of accidental closing popover.

Now such expressions can be executed in builder and will be compiled
with undefined instead of variables in published sites.

In the future we need to add global diagnostics to let users find such
places faster.

Also fixed a couple of ui issues
- react error about using button inside of button in data variables list
- react error about using unknown middlewareData prop from floating-ui

<img width="307" alt="Screenshot 2025-01-27 at 16 30 58"
src="https://github.com/user-attachments/assets/2ddc9ead-33a2-4438-b641-6943d7472f7e"
/>
2025-01-28 01:49:02 +07:00
Bogdan Chadkin 6d2c297f9b refactor: add renderData utility to template package (#4780)
renderData is similar to renderTemplate but returns maps of data which
is used by most of builder utilities and component generator.

Here migrated to it css and component generator and used it to generate
data sources where possible.
2025-01-23 20:18:41 +07:00
Ivan Starkov 373fb5f11d feat: Add default canonical link (#4776)
## 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-01-22 21:22:40 +03:00
Bogdan Chadkin a556b6b2aa refactor: drop imageBaseUrl from constants.mjs (#4766)
It is no longer configurable and always dictated by image loader.
2025-01-21 13:38:12 +07:00