Commit Graph
29 Commits
Author SHA1 Message Date
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 fdee339de0 chore: Migrate to tsgo (#5578) 2026-01-20 17:25:12 +01: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 03c7366b04 feat: create projects with 404 page on all plans (#5309)
Ref https://github.com/webstudio-is/webstudio/issues/2782

Here I did a few things

- allow `/*` path on free plan
- allow changing status code on free plan
- create "Not Found" page for all new projects



https://github.com/user-attachments/assets/1f36882f-3c09-4814-a1ee-d6bdfd468467
2025-07-01 18:56:15 +03:00
Oleg Isonen 0219de6d63 feat: Built with webstudio badge (#5243)
## 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-06-06 11:39:07 +02:00
Bogdan Chadkin de61cffde6 experimental: paste tailwind (#5217)
Ref https://github.com/webstudio-is/webstudio/issues/2651

Added "Paste Html With Tailwind Classes" command.

For now only tailwind 3 is supported.
Also fixed a few issues with css parser.


<img width="547" alt="Screenshot 2025-05-18 at 00 38 01"
src="https://github.com/user-attachments/assets/470b63e0-9b17-4769-8a65-679b90d73a89"
/>
2025-05-23 13:19:04 +03:00
Bogdan Chadkin 0c9b138bba feat: support GitHub flavored markdown paste (#5225)
Markdown paste now generate html elements. This unlocks us supporting
more features:

**strikethrough**

`~~text~~` -> <del>text</del>

**tables**

```
| Header 1   | Header 2   |
|------------|------------|
| Cell 1.1   | Cell 1.2   |
| Cell 2.1   | Cell 2.2   |
```

*autolinks*

```
The link is https://github.com
```

is converted to

```html
<p>This link is <a href="https://github.com">https://github.com</a></p>
```
<img width="559" alt="Screenshot 2025-05-20 at 16 44 53"
src="https://github.com/user-attachments/assets/48508140-9791-47f6-b1c1-3b2946dd5583"
/>

<img width="514" alt="image"
src="https://github.com/user-attachments/assets/dc19e67a-0067-458f-bf3c-64d9b73d02e3"
/>
2025-05-21 01:50:00 +03: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 925ea10391 feat: avoid generating unused preset styles (#5121)
Now we have first-class support for html tags and able to figure out
which tags are rendered so unused preset styles can be removed from
websites.

For example

```
<Box ws:tag="div">
  <Box ws:tag="span">
  </Box>
</Box>
```

will render only div.w-box and span.w-box though there are more presets
for for other tags like main, section etc.

Before all tags were generated
2025-04-15 22:26:58 +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
Oleg Isonen 64dde50c70 experimental: Animations section, new component names, new icons (#5062)
## Description

<img width="280" alt="image"
src="https://github.com/user-attachments/assets/b3c29952-8c10-4e8f-88f0-8cea45df87ba"
/>


## 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-27 18:54:55 +01: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 78a0fa98c1 refactor: output hyphenated properties from css parser (#4900)
We are going to switch to hyphenated properties in styles. Here
refactored css parser to output hyphenated property instead of camel
case and added camelCaseProperty utility which does the opposite of
hyphenateProperty.
2025-02-22 18:11:57 +07:00
Bogdan Chadkin c3ac4d6ec1 fix: preserve global variables when duplicate page (#4875)
Missed the case. Global variables were recreated and got invalid state.
Now global variables are reused or added without changes.
2025-02-15 02:53:09 +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 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 c562e1c6a7 refactor: refresh copy paste tests (#4782)
Here replaced renderJsx with renderData everywhere and refreshed copy
paste tests so they not break CI occasionally. Will help with writing
tests for global variables.
2025-01-24 18:39:24 +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
Bogdan Chadkin 5acb458a68 build: upgrade dev dependencies (#4764)
Nothing critical, all not related to production

storybook 8.5
eslint 9.18
vitest 3
typescript 5.7.3
@types/node 22.10.7
type-fest 4.32
2025-01-21 00:14:56 +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 178ad00bc3 refactor: rewrite webhook form template with jsx (#4721)
Big one

- added `new Variable(name, initialValue)` to defined unique variable
- added `expression\`${variable}\`` to access variables by reference
- added `new Action(args, expression\`\`)` support
- added `ws:show` prop which is converted to data-ws-show under the hood

All these features are necessary to represent all webhook form features.
They also may be handy in tests.
2025-01-08 18:37:27 +07:00
Bogdan Chadkin 53f03cfaa3 fix: restore missing components in command panel (#4692)
Fixes https://github.com/webstudio-is/webstudio/issues/4689

While refactoring with new component templates
forgot to register them in command panel.

Looks like the prod is affected a little too
2025-01-01 19:45:41 +07:00
Bogdan Chadkin 8a89f8e6b2 refactor: rewrite radix label template with jsx (#4665)
- added radix templates to components panel
- support interpolations in css tagged template
- added theme with static values
2024-12-28 16:58:56 +07:00
Bogdan Chadkin e9117c0a18 refactor: support local styles in templates (#4656)
Here added support for local styles with ws:style prop. It accepts the
result of css`` tagged template which enables formatter support.

Migrated vimeo to new template. Need to check all styles are rewritten
accurately.

```js
<$.Box
  ws:style={css`
    font-size: 10px;
  `}
></$.Box>
```
2024-12-26 00:23:21 +07:00
Bogdan Chadkin a32d6329ed refactor: add templates meta support (#4653)
Here added one more description file for components `*.template.tsx`.

It is decoupled from component meta to fix the issue with some templates
like Sheet being treated as components though we don't have actual
components with this name.

Another reason is have it separately to not include builder specific
code and dependencies into CLI and published websites. Template package
is defined as optional in peer dependencies meta.

In this PR migrated only Button and List as examples. There is still not
support for data sources and styles.

Added support for text placeholders in children
2024-12-25 21:37:15 +07:00
Bogdan Chadkin b1b607e9c4 refactor: simplify template format (#4607)
Here added new renderTemplate function which outputs simplified format
with arrays instead of maps and "children" array to describe roots.

This format is partial of webstudio fragment but does not implement it
fully.

Added support for top level fragment to allow having multiple roots.
2024-12-19 23:45:54 +07:00
Bogdan Chadkin 7f7a8fd9de refactor: split jsx testing utils into template package (#4604)
We can start using testing utilities for components meta. It will
drastically simplify maintenance of components, already works pretty
well for tests.

Here just replaced @webstudio-is/sdk/testing with
@webstudio-is/template.
2024-12-17 16:54:13 +07:00