72 Commits
Author SHA1 Message Date
Jaya Krishna Namburu f1aa8db946 fix: allow users to use hex and rgba values in css-filters (#3356)
## Description

fixes #3355 

Allows filter parser to parse `rgba` and `hex` values when copy pasted.
I added some tests for filters too, we added initiall before as the css
filters parser returns false positives. But now, i added all the valid
tests, so at least we can catch things like this in future.


## Steps for reproduction
- Use the following filter values to test them.
```
drop-shadow(10px 10px 25px blue)
drop-shadow(10px 10px 25px rgba(0, 0, 255, 1))
drop-shadow(10px 10px 25px  #0000FF)
```

## 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:
5de6)
- [x] added tests
2024-05-14 18:06:19 +02:00
Jaya Krishna Namburu c1961506d4 feat: parse complex values with available parsers for sections (#3319) 2024-05-08 07:27:49 +02:00
Jaya Krishna Namburu 703b699444 chore: Update snapshots for transitions to inline (#3312)
## Description

There are still certain places in tests where we are using external
snapshots in property-parsers. Moved those to inline now and updated the
snapshots.

## Code Review

- [ ] hi @kof, I need you to do
  
## Before requesting a review

- [x] made a self-review

## Before merging

- [x] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [x] added tests
2024-05-06 16:12:19 +02:00
Jaya Krishna Namburu 966f3ea727 feat: Refactor existing parseBoxShadow to parse both box and text shadows (#3307)
## Description

`box-shadow` and `text-shadow` both share the same syntax signature.
https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow#syntax
https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow#syntax

The only difference is `text-shadow` don't have `inset` and `spread`
values. And added a extractor which can be used in future for
text-shadow UI.

## 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
- [x] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [x] added tests
2024-05-06 16:12:06 +02:00
Bogdan Chadkin 9f897f5d41 refactor: reimplement canvas style renderer (#3253)
Here refactored canvas styles with nesting rules which allow to update
each declaration incrementally and closer to our data format.

Things to test
- initial rendering
- updating values
- ephemeral values
- selecting state, rendered as separate stylesheet

Added shim.ts to contain simplified polyfills for future methods like
Set.prototype.difference which I use here to find added and deleted
styles.

Removed warning from parseCssValue which pollutes log with outdated
messages.

Additionally fixed old bugs
- support ephemeral styles with selector state, for example hover was
not updated on on canvas while updating ephemeral styles
- remove ephemeral custom property from body (bug appeared when added
support ephemeral styles in tokens)
2024-05-02 17:51:09 +04:00
Jaya Krishna Namburu e0941ac349 fix: Move css filter properties to be used as tuples instead of layers in the data-layer (#3247)
fixes #3243 

## Description
 
We should use tuples for handling filters. Don't know when i switched to
layers, but the initial implementation of the filters started as tuples
itself.

- [ ] We might probably need a migration for the existing projects to
change it to tuple if needed. Let me know, I can help with that as well.

## Steps for reproduction
1. Add a css filter in the sections panel.
2. Add another css filter and edit it using the code view.
3.  Swap filters using the drag and drop action.
4. Deploy the project and the multiple filters applied in the same
element should work as expected.

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

- [x] tested locally and on preview environment (preview dev login:
5de6)
- [x] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
2024-04-29 14:35:55 +02:00
Oleg Isonen 8ac51b5d39 fix: Suppoort min() and other functions in advanced section (#3215)
Closes https://github.com/webstudio-is/webstudio/issues/3203

If DOM parser is available, let it do the parsing and don't rely on
csstree if possible for validation

## 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-20 14:07:34 +02:00
Oleg Isonen 2c24e1f478 chore: Improved descriptions prompt and descriptions (#3186)
## Description

Bringing the changes from
https://github.com/webstudio-is/webstudio/pull/3166 as a separate PR

## 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-17 11:13:43 +02:00
Jaya Krishna Namburu 66204427e9 feat: Add filter section in style panel (#2955) 2024-03-12 21:53:34 +05:30
Oleg Isonen 6887463746 feat: Scrub improvements (#2904)
## Description

1. Allow scrub on any css value that can be numeric, no matter what
current keyword value might be selected
2. Adjust scrub speed depending on the unit

## Steps for reproduction

1. try scrubing any css value 
3. backdrop fill in the effects section won't allow to scrub , which is
correct
4. try changing dfferent units and see how it feels, if the speed is
appropriate

## Code Review

- [ ] hi @istarkov , 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-02-13 20:12:09 +01:00
Jaya Krishna Namburu 662f64988a feat: Add box-shadow ui panel for editing values individually for layers (#2706)
## Design

https://www.figma.com/file/xCBegXEWxROLqA1Y31z2Xo/%F0%9F%93%96-Webstudio-Design-Docs?node-id=8075%3A38024&mode=dev

## Description
Box-shadow floating panel to edit each layer values individually. 
fixes #2523 



![box-shadow](https://github.com/webstudio-is/webstudio/assets/11075561/67e16627-792e-430a-ae24-3bb59792b58f)
2023-12-21 07:26:53 +01:00
Jaya Krishna Namburu fbafebfdc9 feat: Box shadow property extractor (#2587)
## Description

This is the first one from the `box-shadow` UI series. Starting with the
extracting individual resources from the `TupleValue`

Related to #2523
2023-11-09 17:41:34 +01:00
Jaya Krishna Namburu f1adb0e426 feat: Add UI element to control transition property. (#2538)
Adds `transition-property` UI
2023-11-05 12:47:44 +01:00
Jaya Krishna Namburu 60a6a7fbf2 feat: Add css transitions (#2511)
## Description

Adds support for `css-transitions` when users are in `local` state. In
any other state than local, the CRUD operations on transitions are
disabled.
2023-11-01 18:36:08 +01:00
Bogdan Chadkin f08fe859bb refactor: bump change-case (#2428)
Ref https://github.com/blakeembrey/change-case/releases

Change case in last major merged many packages into one to simplify
maintaining and usage. A few packages like title-case are still separate
as more rare case.

- replaced no-case with change-case (merged into change-case)
- replaced param-case with change-case (merged into change-case and
renamed to kebab (finally))
- replaced camelcase with change-case (has own camelcase utility)
- bumped title-case
2023-10-08 01:03:59 +04:00
Ivan Starkov 2e6d5c8938 fix: supports no-underline in Tailwind conversion (#2412)
## Description

fix no-underline

## 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 19:41:20 +04:00
Ivan Starkov d2528d707f fix: Resolve longhand-to-shorthand expansion in Tailwind conversion (#2411)
## Description

closes #2405

## 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 15:32:26 +00:00
Giuseppe 2ca3907988 feat: JSX utils (#2396)
Adds utils to work with JSX and transform it to Webstudio Embed Template
as well as converting Tailwind styles to Webstudio Embed Template style
declarations and a fake `<HeroIcon>` component to `HtmlEmbed` with
inline SVG taken from heroicons (we will need this for ai).
2023-10-01 12:17:43 +02:00
Ivan Starkov c3be5eac2a feat: Add Webstudio borders and shadows support to Tailwind conversion (#2390)
## Description

1. I was wrong about borders conversion when wrote shorthand, fixed.
2. Add border-style: solid whenever needed if borderWidth is defined
(tailwind has border-style: solid predefined)
3. Add box-shadows transform

## Steps for reproduction

tests

## 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-29 13:23:58 +00:00
Ivan Starkov 3c75b4e870 feat: Extend tailwind-to-webstudio conversion to support background properties (#2387)
## Description

1. Add support of simple tuple types to the parseCssValue
2. Add background properties conversion

## Steps for reproduction

see tests

## 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-28 19:54:56 +04:00
Ivan Starkov e56995d7af feat: transform tailwind classes to webstudio format (#2386)
## Description

transform tailwind classes to webstudio format

Next PRs.
Postprocessing backgrounds and shadows support. As of now backgrounds
will be drawn but will not be visible at style panel


## Steps for reproduction

see tests

## 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-28 13:11:50 +00:00
Ivan Starkov a7f907c59f feat: Parse tailwind to ordinary css compatible with webstudio (#2385)
## Description

- apply tailwind transform, expand and substitute to get compatible css
with webstudio
- media and pseudo classes temporarily removed from variable
substitution (need specificity calculations for both, we don't support
media in templates)

## Steps for reproduction

see tests

## 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-28 09:51:32 +00:00
Ivan Starkov 333f167c48 feat: Add helper functions for Tailwind support: shorthand expansion and variable substitution (#2371)
## Description

Gonna merge this before next step.

Helper functions to parse tailwind.

1. `expandTailwindShorthand` - Expands shorthand CSS properties into
their long-form equivalents. _'mx' is expanded to 'mr' (margin-right)
and 'ml' (margin-left)._
2. `substituteVariables` - Resolves CSS variables by replacing their
references with actual values. _Transforms `.class { --property: 1px;
margin: var(--property); }` into `.class { margin: 1px; }`._

## Steps for reproduction

See tests.

## 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-28 09:36:54 +00:00
Bogdan Chadkin 87e69b2e85 Move style schema into css-engine (#2251)
Css-data now responsible for generated data and parsers which requires
heavy dependencies like csstree and openai.

Here moved style schema into css-engine which makes is responsible for
own input representation. So now schema and serialization are co-located
in single package.

Cli install size

```diff
du -ck node_modules
- 42680
+ 35516
```
2023-09-06 15:55:41 +04:00
Bogdan Chadkin 7f53be7b2d Add list item section to style panel (#2077)
Fix https://github.com/webstudio-is/webstudio-builder/pull/2063
https://github.com/webstudio-is/webstudio-builder/issues/2079
https://github.com/webstudio-is/webstudio-builder/issues/2060

Here added new "List Item" section specifically for List and ListItem
components. Now user can cutomize list item markers for whole list or
per each item.

Changed behavior of Select Control to put current value into the list of
options if not present. This way display shows "List Item" instead of
nothing.
2023-08-09 22:58:50 +04:00
Bogdan Chadkin 71daca2fd8 Add browser styles for form controls (#2053)
Ref https://discord.com/channels/955905230107738152/1136979487993638973

Added form control styles from browser presets
Also a bit refactored other styles with simpler utilities.
2023-08-06 14:18:20 +04:00
Oleg Isonen 57417c7a58 Add font smoothing by default to the body (#1972)
## Description

Adding font smoothing by default to the Body component


https://discord.com/channels/955905230107738152/955907787299360788/1132882679189229649

```
  -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
```

## Steps for reproduction

1. open any project, see in dev tools these 2 added (or check visually)

## Code Review

- [ ] hi @istarkov , 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-builder/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-07-25 12:38:58 +02:00
Bogdan Chadkin a8ecaf3a99 Migrate storybook to new format in sdk (#1924)
Here bumped storybook and migrated stories to Meta and StoryObj types
from deprecated ComponentMeta and ComponentStory.
2023-07-11 20:15:38 +03:00
Ivan Starkov 88c94b1d52 Add modern tooltips to space control (#1877)
## Description

Based on discussion, now space section tooltips are shown only on label
hovers


Supports alt/shift clicks
- [x] - During hover alt/shift works
- [x] - In case of multiple properties sources now group them
<img width="292" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/029b60a5-9a4e-4d85-ba2e-3db4fbbb344d">



## 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-builder/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-07-03 22:45:24 +03:00
61f164d40e (feat): Ability to add box-shadow to nodes. (#1634)
## Description

This is a WIP PR, and will be adding more details about the feature and
the changes that are going in...

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi, 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-builder/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

---------

Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>
Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-07-02 16:31:26 +02:00
Bogdan Chadkin 43868bfbc0 Fix text-align control default value (#1822)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1794

Here fixed initial value in css data. Mdn provides unclear value because
of legacy browsers. Here we need to override it with actual "start".
2023-06-19 17:50:36 +03:00
Bogdan Chadkin 1be61e59bb Compute currentColor (#1815)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1536

Here replaced browser getComputedStyle for currentColor with computing
from data.

`color: inherit` is now considered same as `color: currentColor` and
displayed properly in UI.

Changed initial value for color from inherit to black (in mdn-data it's
canvastext).
2023-06-19 16:27:27 +03:00
GiuseppeandGiuseppe Gurgone 6ffeb6407b Tweak prompt and regenerate properties descriptions (#1807)
Fixes #1793

## Description

I tweaked the prompt and generated new descriptions. 

@kof @taylornowotny The results are still not ideal but please take a
look and decide whether we should merge these changes or not (probably
still better than the previous generation).

PS: I tweaked the script a bit so now it creates: `propertiesOverrides`
and `propertiesGenerated` (same for property:value descriptions). This
way we can add overrides to `propertiesOverrides`

---------

Co-authored-by: Giuseppe Gurgone <ggurgone@users.noreply.github.com>
2023-06-18 08:59:17 +03:00
Bogdan Chadkin c482db745c Add combined control descriptions (#1803)
Ref https://github.com/webstudio-is/webstudio-builder/pull/1785

Here fixed generated height description and added custom descriptions
for following controls

- background
- borderWidth
- borderStyle
- borderColor
- borderRadius
- sizing
2023-06-16 00:19:28 +03:00
Oleg Isonen 4874e4093d Tooltips improvements (#1770)
## Description

- Fixes a bunch of wrong logic for showing style source origin info in
the tooltip
- Renders GPT descriptions

## Steps for reproduction

1. check tooltips in style panel


## Code Review

- [ ] hi @istarkov , 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-builder/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-06-13 07:44:26 +03:00
d207286df3 CSS data descriptions generation script (#1759)
## Description

Using ChatGPT, this scripts generates descriptions for CSS properties
and declarations (property-value).
It uses `keywordValues` from
[`src/__generated__/keyword-values.ts`](https://github.com/webstudio-is/webstudio-builder/blob/css-data-descriptions/packages/css-data/src/__generated__/keyword-values.ts)
to get a list of all the properties and values.

The result is a TS module located at
`./src/__generated__/property-value-descriptions.ts` which exports:
- properties
- declarations

By default it generates descriptions only for new properties/values,
however you can use the `--forceRegenerate` flag to regenerate
everything.

When it comes to generating descriptions for declarations whose value is
a color eg. `background-color: orange` we generate a description for a
generic `property: {color}` declaration (e.g. `background-color:
{color}`) and GPT will generate a description template with a
placeholder `{color}`.

The script then repeats the template for every color value, replacing
`{color}`. This is to avoid generating a ton of similar description and
wasting GPT tokens.

The script needs two env variables:
- process.env.OPENAI_KEY - Your OpenAI API key
https://platform.openai.com/account/api-keys
- process.env.OPENAI_ORG - Your OpenAI Org ID
https://platform.openai.com/account/org-settings

## Steps for reproduction

Run it 

```
OPENAI_KEY=your-key OPENAI_ORG=your-org pnpm build:descriptions
```

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - review sample descriptions

## Before merging

- [x] Get approval on sample descriptions
- [x] Generate all the descriptions
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory

---------

Co-authored-by: Giuseppe Gurgone <ggurgone@users.noreply.github.com>
Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-06-12 22:05:06 +02:00
Bogdan Chadkin fd8ac62296 Drop deprecated system colors (#1758)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1301

## 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-builder/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-06-12 17:11:11 +02:00
Ivan Starkov 3441e1b160 Fix unhandled background parsing error (#1753)
## Description

closes #1751

useEffect unsubscribe called parsing and unhandled error caused
everything to break


## 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-builder/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-06-12 16:10:52 +04: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
Bogdan Chadkin 9d0285f56b Support bold and normal font-weight (#1641)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1535

Here instead of hacky preconverting to numeric font-weight value support
"normal" and "bold" as input for font weight control.

Defaults can be checked on h1 and body.
2023-05-20 10:32:49 +07:00
Oleg IsonenandJayaKrishnaNamburu b4b86a6c89 Outline style property (#1630)
## Description

https://github.com/webstudio-is/webstudio-builder/pull/1596

---------

Co-authored-by: JayaKrishnaNamburu <namburu1995@gmail.com>
2023-05-14 18:40:12 +02:00
Bogdan Chadkin 2afa5e1cd4 Drop link preset states (#1604)
:active and :visited states on links have special behaviour. They are
vendor defined until color on stateless link is defined. Similar to how
vars work there is var with default. And when var is somewhere defined
default is overriden.

Though using vars for this specific case is too complex here easier
solution. We can just remove active and visited states on default
styles. User may never see this inconsistency as usually would modify
color on stateless link first and then go to active or visited states.
2023-05-09 15:01:21 +07:00
Bogdan Chadkin 6fb341b1ce Fix link default and preset styles (#1591)
Here made added browser defaults for link and set color as preset.
2023-05-07 18:58:27 +07:00
Bogdan Chadkin 403edf6523 Parse tuple in css-data (#1548)
We support tuple type in styles and can now parse initial values
properly which is important since we no longer use computed browser
style.
2023-05-03 01:00:37 +08:00
Bogdan Chadkin c60ee0af07 Show initial and html style in style panel (#1533)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1067

We need to move away from getComputedStyle for not local styles in style
panel.

Here added default html style from browser sources. Now we can render it
and properties initial styles instead of computed styles.

Also fixed in properties data generation currentcolor -> currentColor
and removed same from border presets.
2023-04-27 17:06:38 +07:00
Bogdan Chadkin a148507e48 Render style states (#1420)
Ref https://github.com/webstudio-is/webstudio-builder/issues/807

Refactored styles rendering in canvas to consider states and added style
states support to css text renderer.
2023-04-17 15:50:14 +07:00
Bogdan Chadkin 06b3f279ad Drop assets resolving from project-build (#1406)
This big chunk of legacy is no longer necessary.
We resolve style assets on client so css engine can accept db types now.
2023-04-10 23:14:10 +07:00
Bogdan Chadkin 33fd087ece Transform image value to resolve url (#1405)
Ref https://github.com/webstudio-is/webstudio-builder/issues/1179

Succeeded https://github.com/webstudio-is/webstudio-builder/pull/1403

Here added support for transformValue in css-engine StyleRule. So we can
apply any transformation when render css.

In sdk added image transformation which accepts assets and provides
image value with new url value.

Now we can get rid of resolving on server side and apply image loaders
for images rendered in styles.
2023-04-09 22:24:02 +07:00
Ivan Starkov 8bf079d821 Add common keywords (#1385)
## Description

closes #1378

## Steps for reproduction

Take any css property, see it contains 
initial, inherit, unset

## 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-builder/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-04-06 22:21:52 +04:00
Ivan Starkov 8c27c5c86b Show currentcolor value in picker (#1339)
## Description

closes #1304 

To not expose computed style or do hard currentColor recalculation. I
added currentColor: StyleValue to the styleInfo color property.

## Steps for reproduction

Set currentColor on border or background or color, see in color picker
it works

## 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-builder/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-04-03 12:32:15 +04:00