Commit Graph
9 Commits
Author SHA1 Message Date
Bogdan Chadkin 62f969cccb fix: show href on link in content mode (#5396)
Got broken when we switched links to element component.

<img width="844" height="466" alt="Screenshot 2025-09-09 at 13 50 45"
src="https://github.com/user-attachments/assets/a4f0c969-9003-4ea7-aef0-22014f307884"
/>
2025-09-09 19:09:14 +03:00
Bogdan Chadkin 0960101fa3 fix: accept any string in <iframe> name attribute (#5349)
Fixes
https://discord.com/channels/955905230107738152/1400906922235920445/1400906922235920445

The spec does not clearly indicate possible values and in case of iframe
and object name attribute accepts any string.
2025-08-03 19:56:05 +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 60ab7c7b68 feat: support svg elements (#5330)
Ref https://github.com/webstudio-is/webstudio/issues/5258

Now users can create svg elements and paste svg code or html with svg.



https://github.com/user-attachments/assets/77738ede-e4ee-4fd8-b128-5679170b30b4
2025-07-18 02:38:33 +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 c630054c74 feat: use html elements for typography (#5226)
Html elements can completely replace legacy typography components. Here
replace component templates with element templates as part of sdk.

- moved content block to general section
- moved separator into typography section
- moved code text into typography section and used regular `<code>`
element for it
- made "Text Content" setting expandable
- fixed dragging templates onto canvas.

<img width="475" alt="Screenshot 2025-05-21 at 11 27 27"
src="https://github.com/user-attachments/assets/ab53c5ec-e51f-498d-b01b-cc7f2eb20c2d"
/>
<img width="515" alt="Screenshot 2025-05-21 at 11 27 20"
src="https://github.com/user-attachments/assets/0f560c26-7e51-4025-a487-6f7e4e3f43e3"
/>
2025-05-21 15:26:05 +03:00
Bogdan Chadkin d372aa386b experimental: customize initial attributes per tag (#5209)
Ref https://github.com/webstudio-is/webstudio/issues/3632

Now different tags can have own initial attributes. Here added initial
attributes to `<a>` and `<form>` which will be replaced with remix
components on publish. Also overriden href, download and target types
for links.

<img width="246" alt="Screenshot 2025-05-15 at 16 21 00"
src="https://github.com/user-attachments/assets/112c3c94-0c87-4fa5-936b-4def5cc4ee12"
/>
2025-05-16 14:59:10 +03: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 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