Commit Graph
282 Commits
Author SHA1 Message Date
Bogdan Chadkin dca04597fb build: publish 0.173.0 (#3816) 2024-07-29 17:48:40 +02:00
Jaya Krishna NamburuandOleg Isonen 5b46f791af feat: add transform section under style-panel with ui controls (#3718)
## Description

Adds the primary `translate`, `scale`, `rotate`, skew` properties under
transform section. Related to #3411

## Steps for reproduction
- Add multiple properties under the transform section.
- Update values of each property from the UI.
- Hide/Delete each individual property

## Todo
- [x] Need to discuss if the `isExperiemental` flag need to be removed
before merging the branch.

## Code Review

- [x] 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] tested locally and on preview environment (preview dev login:
5de6)
- [x] added tests
- [ ] if any new env variables are added, added them to `.env` file

---------

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2024-07-27 09:20:53 +02:00
Bogdan Chadkin f73680027f feat: use classes for preset styles (#3794)
Closes https://github.com/webstudio-is/webstudio/issues/3787

Replaced [data-ws-component=...] selector with classes in generated
styles. This will unlock cleaner html output in the future.
2024-07-26 10:45:29 +02:00
Bogdan Chadkin 10b9533e31 fix: support backdrop-filter in safari (#3748)
Safari was the first to build this feature but still supports only
prefixed version. Might land unprefixed in safari 18.
2024-07-17 13:48:08 +02:00
Bogdan Chadkin 18a0f028c9 refactor: split css literal parser (#3721)
Here refactored value parser with literal parser
which can be reused in all functions, tuples and layers.

Color parser now relies on specific ast types.

Tuples are generated for all values with multiple nodes.

This all will let us build more universal parsers with less effort.
2024-07-14 20:30:12 +02:00
Bogdan Chadkin 1fcd542469 refactor: allow any style value to be hidden (#3703)
This simplifies maintaining style values.
No more checked for hidden possibility. Just check the flag for true.
2024-07-09 22:17:17 +02:00
Bogdan Chadkin a58f2eff04 build: run all tests and typechecks in CI (#3661)
Here improved our checks. No longet rely on "checks" script but run
"test" and "typescript" scripts from each package in monorepo.

Would also make each package less boilerplaty.
2024-07-02 18:21:05 +03:00
Bogdan Chadkin ad5d050308 experimental: parse css wide keywords correctly (#3651)
Here added universal support for css wide keywords. initial, inherit and
unset will be parsed the same way for layered properties and singular
properties.

It will never be part of layers and always be represented as root
keyword.
2024-06-30 22:45:30 +03:00
Bogdan Chadkin 2af8d57b8e experimental: support transition-behavior property (#3650)
This is the new property and not supported by csstree out of the box. So
we try to parse it manually. Fixes a few invalid in webflow preset.
2024-06-30 15:15:11 +03:00
Bogdan Chadkin 009c5d8e2d experimental: parse non-standard properties (#3648)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Fixed parsing non-standard properties with prefixes

- font-smoothing
- -webkit-font-smoothing
- -moz-osx-font-smoothing
- tap-highlight-color
- -webkit-tap-highlight-color
- -webkit-overflow-scrolling
2024-06-30 02:25:18 +03:00
Bogdan Chadkin 87210fa069 feat: expand backgound-position shorthand (#3646)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Here replaced shorthand background-position with
background-position-x and background-position-y

Added shorthand expander, migration and merger
for css engine to improve browser support for offsets.
2024-06-29 13:43:37 +03:00
Bogdan Chadkin a7676c5042 feat: support -webkit-line-clamp (#3640)
Ref https://github.com/webstudio-is/webstudio/issues/2647 Closes
https://github.com/webstudio-is/webstudio/issues/3427

Here added -webkit-line-clamp and -webkit-box-orient properties support
which is the only way to add multiline truncation at the moment.

All properties with prefixes are stored without camel casing. With font
smoothing as the only exception because added very early.

<img width="911" alt="Screenshot 2024-06-28 at 17 48 08"
src="https://github.com/webstudio-is/webstudio/assets/5635476/ca773cf0-81f0-47d7-97c8-5f78751332d4">
2024-06-28 20:13:19 +03:00
Ivan Starkov 4d0574d573 build: Update typescript (#3637)
## 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:
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` file
2024-06-28 11:46:13 +03:00
Bogdan Chadkin a7cc5c8417 fix: prevent merging var with unset, initial and inherit (#3630)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Css wide keywords should be used only in longhand values not as part of
shorthands.
2024-06-27 18:59:36 +03:00
Bogdan Chadkin 6ec8aaeeb7 feat: support text-wrap (#3620)
Here revamped white-space and added support for text-wrap. Basically
both expands into

- white-space-collapse
- text-wrap-mode
- text-wrap-style

And then for better browser support all of them are merged in final css.

<img width="256" alt="Screenshot 2024-06-26 at 13 00 14"
src="https://github.com/webstudio-is/webstudio/assets/5635476/288de3c3-b045-4745-a9f0-34d97e97c0e9">
<img width="358" alt="Screenshot 2024-06-26 at 12 51 13"
src="https://github.com/webstudio-is/webstudio/assets/5635476/e2826389-0e00-443a-b402-e7890df4a02a">
2024-06-26 17:55:00 +03:00
Jaya Krishna Namburu 931e571081 refactor: drop parseTransition shorthand and add migration for transition shorthand (#3607)
fixes #3593 
## Description

This PR
- drops the `parseTransition` for parsing shorthand transition property.
- allows migration of existing transition property to long-hands.
- drops parsing `transition` when added from advanced tab. Because if we
parse and add it as proper layers. It will get remigrated again every
time the app is loaded.
- Adds tests for parsing individual transition properties and even
parses timing functions as timing functions now.


- [x] there is a bug associated with expanding transitions from
shorthands #3608 . Once fixed we need to test the new `FunctionValue`
parsing behaviour.

## Steps for reproduction

- Any previous values of `transitions` should we migrated into new
approach and should be available in the style-panel for using them.

## 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` file
2024-06-26 06:53:05 +02:00
Bogdan Chadkin 0e468fe748 feat: merge longhand css into shorthands (#3615)
Here added optimization to css engine to produce much less classes when
some lonhands can be combined into shorthand.

Supported following properties

- border
- outline
- margin
- padding

Later the same utility will be used to make white-space and text-wrap
longhands better supported.

<img width="263" alt="Screenshot 2024-06-25 at 14 01 01"
src="https://github.com/webstudio-is/webstudio/assets/5635476/3b877e8b-969a-4e09-b3f4-557b2135d4cc">

<img width="270" alt="Screenshot 2024-06-23 at 17 39 33"
src="https://github.com/webstudio-is/webstudio/assets/5635476/e8de1c63-d7a5-465a-9f21-66fb67c1b02a">
2024-06-25 19:32:26 +03:00
Bogdan Chadkin 7f399154de fix: prefix more css properties (#3613)
These fields should have -webkit- prefix additionally to unprefixed
version to support more browsers.

- background-clip
- user-select
- text-size-adjust
2024-06-25 13:41:02 +03:00
Bogdan Chadkin bc5a355b37 refactor: drop legacy style rule (#3606)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Switched to nesting rule and style map generator
everywhere in builder.

Now will be much easier to implement properties prefixing and merging
utilities.
2024-06-24 14:29:50 +03:00
Jaya Krishna Namburu ce2dad417d refactor: use longhand properties to save transition values in style-panel (#3584)
## Description

fixes #3567 

Use long-hand properties to save `transition` values in the style-panel.

## Steps for reproduction
- Add some layers in transition panel in UI.
- Delete some layers
- Swap some layers

## TODO

- [ ] Allow `show/hide` for each layer.
- [ ] Add tests for all the layer handlers for transition.

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

@TrySound i made some refactor to use individual properties as
long-hands instead of short-hand property. I am still yet to add tests
for the new handlers, since they need to be handled in a different way
now for transitions. But you can still play around with the current
setup.

## 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
2024-06-23 13:23:56 +02:00
Bogdan Chadkin 9e23dc9580 feat: switch to overflow longhands (#3588)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Here refactored overflow UI to update "overflow-x" and "overflow-y"
longhands instead of "overflow" shorthand.

Removed "overflow" from advanced panel suggestions.

Added support for expanding overflow shorthand for webflow copy paste.

And implemented very basic migrations utility
which always run after data is loaded from server
and sends patch for expanding overflow longhands.
Patch is not sent when no properties are modified. Though eventually we
will need to support versioning to avoid executing old migrations.

<img width="279" alt="Screenshot 2024-06-18 at 19 33 21"
src="https://github.com/webstudio-is/webstudio/assets/5635476/ce44385e-3316-4e34-bc9c-5f790cbdcd4f">
2024-06-20 11:51:00 +03:00
Bogdan Chadkin 126fe3d66a experimental: expand font variant and synthesis shorthands (#3580)
Ref https://github.com/webstudio-is/webstudio/issues/2647
2024-06-18 17:51:26 +03:00
Bogdan Chadkin dfc216723a refactor: upgrade mdn-data (#3578)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Here upgraded to the latest mdn data and improved properties detection.
Excluded experimental and undocumented css properties.

- font-synthesis got longhands in mdn data
- background-position-x/y got excluded as experimental (though support
is good) but we anyway write as shorthand
- excluded white-space-collapse, text-wrap and text-wrap-* until decide
how to maintain them in the future
- field-sizing and zoom are new additions
2024-06-17 14:35:38 +03:00
Bogdan Chadkin 936dcd3ca8 build: publish 0.168.0 (#3556) 2024-06-13 14:57:21 +03:00
Jaya Krishna Namburu 7b860d16de refactor: allow show/hide options for filters and backdrop-filters (#3502)
## Description

fixes #3451 
Allow `show/hide` for individual layers in `filters` and
`backdrop-filters`.

## Steps for reproduction

1. Add some layers for filters and backdrop-filters
2. Play with `show/hide` icon on each layer.


## 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] tested locally and on preview environment (preview dev login:
5de6)
2024-06-06 13:15:51 +02:00
Bogdan Chadkin c5a9a38838 build: publish 0.167.0 (#3498) 2024-06-05 11:34:59 +03:00
Bogdan Chadkin ea30e840a1 refactor: merge all storybooks into one (#3441)
Monorepo setup for storybook is very complicated, it has two major
problems

- it is very annoying to look for any link in commit status
- hard to upgrade comparing with single project setup

Here merged all storybooks into one in the root.
2024-05-29 17:05:17 +03:00
Bogdan Chadkin a74f895487 refactor: host hyphenate-style-name (#3421)
hyphenate-style-name utility is basically oneliner but requires to
install two packages. Considering we will switch to hyphenate property
naming by default, no reason to rely on this package.

Also switched to unprefixed property in css preview and property name
tooltips.
Just shows background-clip instead of -webkit-background-clip.
2024-05-26 19:14:16 +03:00
Bogdan Chadkin 0a2e870fa4 build: publish 0.163.0 (#3396) 2024-05-22 14:03:45 +03:00
Bogdan Chadkin bd9cde8d52 build: upgrade storybook 8 (#3085) 2024-05-22 10:45:43 +03: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 305436f820 experimental: add descendent component (#3313)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Here added support for new `<ws:descendent />` component. It allows to
style any children or descendents of components. Primary usage is for
embed content which renders html and need to style tags.

Descendent component accepts "selector" prop which can be suffix like `
img`, ` .image` or `::first-child` pseudo-element.

Potentially it could be used as tag styling for any element.

Can be tested in any element by dropping "Descendent" component from
"internal" category.
2024-05-06 23:36:34 +04:00
Bogdan Chadkin 16296c7785 refactor: drop require export condition (#3299)
This hack was used to support classic remix compiler and no longer
necessary.
2024-05-06 22:50:07 +04:00
Bogdan Chadkin 7128bc9204 build: publish 0.151.0 (#3297) 2024-05-04 16:56:39 +04: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
Bogdan Chadkin 09491d7c0b refactor: simplify stylesheet caching (#3275)
Here got rid of top level stylesheet caching in favor of managing
caching by each rule. So nesting rule, font face and style rule based on
their inputs and methods manage own cached css string.

In stylesheet all the work left is building media queries and
concatenating all rules. This prevents hard to debug cached css after
updates.
2024-05-01 23:28:09 +04:00
Bogdan Chadkin 147a495393 refactor: reimplement atomic styles with nesting rules (#3248)
Here used new nesting rules to generate atomic styles. Replaced separate
atomic style sheet class with just a method to generate styles
atomically. Inheritance doesn't work well with private fields caz
require a lot of internals to be public.
2024-04-27 23:00:09 +04:00
Bogdan Chadkin c09f7ea4d7 refactor: drop background-clip workarounds (#3234)
Seems like unprefixed background-clip: text is supported in all browsers
including chrome (since december 2023) and no longer need to have
workarounds with var().

Though still left prefix in css engine to have better support for
published sites.
2024-04-24 18:40:13 +07:00
Bogdan Chadkin 20a2a1ec55 refactor: add mixin rule to css engine (#3233)
Here added new mixin rule to represent reusable
parts like our tokens and maintain their cache.
In the future can be rendered as native css.
2024-04-24 02:05:29 +07:00
Bogdan Chadkin 0cdcfc562c refactor: add nesting rule to css engine (#3227)
Nesting rule is universal representation for
instance style with support for nested state selectors and nested media
queries. Css is generated css of course without css nesting and optimize
media queries but in the future may be generated with nesting for
simplicity.

This is essential to support mixins in css engine. Will support it in
atomic css in other PRs.
2024-04-24 01:37:01 +07:00
Bogdan Chadkin c336b6ebc7 build: publish 0.145.0 (#3192) 2024-04-18 10:43:07 +07:00
Ivan Starkov 6d5e55b892 build: Update react + typescript hotfix (#3194)
## Description

Use canary react 

## 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 22:23:37 +03:00
Bogdan Chadkin e09f8a184e build: switch to pnpm linker (#3168)
With new remix setup we may finally not need hoisted linker which makes
pnpm very buggy.

Here added all missing dependencies to package.json and removed node
linker from .npmrc.
2024-04-14 23:07:53 +07:00
Bogdan Chadkin e75c174f75 build: release 0.144.0 (#3090) 2024-04-04 22:34:52 +07:00
Ivan Starkov 8bad95fc16 build: release 0.143.0 (#3070)
## 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:
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-03-30 12:04:04 +03:00
Bogdan Chadkin beb3438224 experimental: support custom properties (#3047)
Ref https://github.com/webstudio-is/webstudio/issues/1536

Here added support for css custom properties in style object model.
Added guaranteed-invalid value to schema to represent initial value of
custom properties.
2024-03-25 19:44:32 +07:00
Ivan Starkov b7911ce7f0 build: Release 0.142.0 (#3014)
## 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:
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-03-14 00:43:48 +03:00
Oleg Isonen 5a7787b96c build: 0.141.0 (#3012)
## 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:
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-03-13 19:21:26 +01:00
Oleg Isonen a5ea558c21 build: 0.140.0 (#3002)
## 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:
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-03-12 18:31:00 +01:00
Jaya Krishna Namburu 66204427e9 feat: Add filter section in style panel (#2955) 2024-03-12 21:53:34 +05:30