Commit Graph
5224 Commits
Author SHA1 Message Date
Bogdan Chadkin 5d1ca5b4f8 Update fixtures with HtmlEmbed preset 2024-06-26 22:46:09 +03:00
Ivan Starkov 5e94a30931 fix: Deduplicate styles on data paste from Webflow (#3622)
## Description

ref #2647

We already had logic to handle style sources on paste: if the
destination has the same styleSource.id as the source, we do nothing.

Now, we add deterministic ID generation for Webflow classes. This,
combined with the existing logic, achieves the desired behavior.


## Steps for reproduction

Paste anything from single webflow project multiple times. See no
duplicated.

## 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 22:19:41 +03:00
Bogdan Chadkin 06a3e84487 build: upgrade to remix 2.10.0 (#3621)
Ref https://github.com/remix-run/remix/blob/main/CHANGELOG.md#v2100

Not important changes.
Netlify adds more opentelemetry, grpc and protobuf packages.
Reinstalled vanilla-extract drops old version of vite
2024-06-26 21:14:29 +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
Oleg Isonen 75063eaaf2 experimental: Paste from webflow 10 (#3619)
## Description

1. allow styles on html embed, still display contents by default
2. allow clicking away toasts immediately

## Steps for reproduction

1. click button
3. 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-26 12:45:01 +02: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
Ivan Starkov 38d49f9f69 feat: Add native select control (#3616)
## Description

rename of #3609

## New

- Native Select

## Changes

- Improved detection algorithm to include invisible elements (like
`option` or `display:none`).
- Added interceptor to handle pointer down events, preventing select
from opening.
- Enhanced element selection on canvas to support `display:none` and
option selection.
- Fixed prop types generation (previously, the value property was
broken).
- Memory props has effect on canvas only
- Recreate component on Canvas in case of defaultValue has changed


## Steps for reproduction

Add `Select` see it works

## 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 07:07:37 +03:00
Ivan Starkov 65c35f021e fix: Unsupported property type error (#3617)
## 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-25 22:16:00 +03:00
Ivan Starkov 7a8b849591 chore: Add nanoid hash function (#3618)
## Description

ref #2647

To use in id conversion.

## 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-25 22:14:58 +03: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
Ivan Starkov 374bde0c3b fix: Static assets redirect to dashboard (#3612)
## Description

1. 404 error instead of redirect on assets.
2. Vercel sets Cache-Control: public, max-age=31536000, immutable for
all /assets/* paths,
even when a 404 error occurs during deployment.
This causes 404 errors on assets to be cached permanently, preventing
updates.
To prevent this, we set "Cache-Control": "public, max-age=0,
must-revalidate" when an asset is not found.


## 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
0.169.0
2024-06-24 20:56:32 +03:00
Bogdan Chadkin e747398fdb experimental: expand container shorthands (#3600)
Ref https://github.com/webstudio-is/webstudio/issues/2647

- container
- contain-intrinsic-size
2024-06-24 14:37:52 +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
Bogdan Chadkin f11dbf34ed experimental: correctly match unordered shorthands values (#3611)
Fixes https://github.com/webstudio-is/webstudio/issues/3608
2024-06-24 10:27:36 +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 9a39c24502 refactor: switch ai to nesting rules (#3605)
Moved ai css generation to nesting rules
and removed a bunch of utilities.

Tested locally
2024-06-23 01:13:24 +03:00
Oleg Isonen 25d72a11ff experimental: Paste from webflow 9 (#3602)
## Description

- updated mdn build
- fixed font-width
- render unset instead of var()
- skip properties with empty values
- temp rendering input instead of select
- remove the flag
- unprefix -webkit-appearance

## 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-22 23:23:29 +02:00
Bogdan Chadkin 14791a476b refactor: switch preset styles to nesting rules (#3604)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Moved preset styles to new nesting rules in css engine. Will simplify
future prefixer solution.
2024-06-22 22:30:19 +03:00
Bogdan Chadkin b3efb88915 fix: expand font shorthand properly (#3603)
Replaced font-width with font-stretch in expanded font shorthand.
2024-06-22 16:18:45 +03:00
Ivan Starkov 6a2a512e8d feat: Add ‘optimize’ property to Image component (#3599)
## Description

<img width="360" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/f225882f-7954-4382-a6ac-51d42f24d1c4">


## 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-21 23:57:00 +03:00
Ivan Starkov a4d3f33bad fix: Dialog within collection issues (#3597)
## Description


https://discord.com/channels/955905230107738152/1251593079161491637/1251593079161491637

## Steps for reproduction


https://dialog-col.staging.webstudio.is/builder/be551fca-b3bc-4750-961a-c0bdc0557506?authToken=3d9f5902-0ecc-4645-ba12-9f7af2f81e09&mode=edit

https://dialog-saas-a7f4v.wstd.work/

## 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-21 20:54:04 +03:00
Oleg Isonen f8635a6691 experimental: Paste from webflow 8 (#3572)
## Description

- adds breakpoints when they are missing
- adds some form components
- rewrites tests to jsx

https://share.descript.com/view/yOz2JeAdrXW

## 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-21 18:10:28 +02:00
Bogdan Chadkin 8ca12a7742 experimental: support grid and grid-template shorthands (#3598)
Ref https://github.com/webstudio-is/webstudio/issues/2647
2024-06-21 18:41:38 +03:00
Bogdan Chadkin f9d94f8d45 experimental: expand scroll and offset shorthands (#3596)
Ref https://github.com/webstudio-is/webstudio/issues/2647

- offset
- scroll-timeline
- scroll-padding
- scroll-padding-inline
- scroll-padding-block
- scroll-margin
- scroll-margin-inline
- scroll-margin-block
2024-06-20 14:08:12 +03:00
Ivan Starkov 58119c75ba fix: Domain name and the link is not updated after renaming in publish dialog (#3594)
## Description

Closes #3591

## 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-20 13:30:34 +03:00
Ivan Starkov 0981581b86 fix: After cloning a shared template, buttons are still disabled (#3595)
## Description

Closes #3562

## 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-20 13:30:03 +03: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
Ivan Starkov 5e27dec1f4 fix: Reload scripts in HTML Embed on dynamic pages (#3587)
## Description

Reload scripts in HTML Embed on dynamic pages
Closes #3581


## Steps for reproduction

Open
https://scripts-reload-saas-2-pgmkm.wstd.work/test/1

dynamic link clicks should cause `console.log` from IFrame

Anchor link should not.


## 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-20 10:49:59 +03:00
Ivan Starkov 5edbeda077 fix: Skip inaccessible iframes added by extensions to prevent cross-origin errors (#3586)
## Description

Already released as hotfix


https://cdn.discordapp.com/attachments/1252596836729094184/1252596837056118834/image.png?ex=6672cb36&is=667179b6&hm=fc5718dfac9bd0e5a430b22a09cf0889831a767f5c60e2ca1731e6f3fd43a779&

## Steps for reproduction
Install Zotero extension

Then open 

https://main.development.webstudio.is/builder/a1371dce-752c-4ccf-8ea4-88bab577fe50
See error
`Failed to read a named property '__webstudio__$__canvasApi' from
'Window': Blocked a frame with origin
"https://main.development.webstudio.is" from accessing a cross-origin
frame.`

Now open

https://fix-zotero.development.webstudio.is/builder/a1371dce-752c-4ccf-8ea4-88bab577fe50
See no Error

## 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-18 19:38:36 +03:00
Ivan Starkov 2dc2a21f4c feat: Support image transform for 3rd party images (#3585)
## Description

Now 3rd party images should be transformed by us

Corresponding SaaS PR
https://github.com/webstudio-is/webstudio-saas/pull/301

## Steps for reproduction

Instead of uploading asset set src to any 3rd party image url 
like `https://picsum.photos/id/237/200/300`

See it works.
Publish see it works.

Or open 


https://src-remote.staging.webstudio.is/builder/a1371dce-752c-4ccf-8ea4-88bab577fe50
See it works

https://new-images-saas-8njoh.wstd.work/



## 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-18 19:38:23 +03:00
Ivan Starkov b7a663c975 experimental: Add Webflow image paste support (#3583)
## Description

Add Webflow image paste support

## Steps for reproduction

Copy node with images from webflow
Paste

## 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-18 18:32:20 +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 d060fd552a refactor: insert fragments with multiple roots (#3582)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Here fixed the issue with detecting root as first instance in the
fragment. The idea of this utility is to not rely on any root but
instead insert with new ids all instances outside of portals/components.
Roots semantics is left for outer utilities.
2024-06-18 02:19:02 +03:00
Bogdan Chadkin 4a452c9ec5 experimental: expand grid-area shorthands (#3579)
Ref https://github.com/webstudio-is/webstudio/issues/2647

- grid-area
- grid-row
- grid-column
2024-06-17 14:39:36 +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
Jaya Krishna Namburu cc0ccf6c51 fix: validate using long-hand property for transition while saving (#3566)
## Description

fixes #3069 
The properties `transition-delay` and `transition-duration` are being
saved directly considering they are being valued using the
`CSSValueItemProperty`. But not all values in long hand are valid in
`short-hand` property. So, we need to validate the property value before
saving them

## Steps for reproduction

- Add a transition layer.
- Now change the values in the transition-delay and transition-duration
and try to save 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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
2024-06-17 11:07:12 +02:00
Bogdan Chadkin 3ded54d59b experimental: support mask and mask-border shorthands (#3577)
Ref https://github.com/webstudio-is/webstudio/issues/2647
2024-06-16 21:44:43 +03:00
Ivan Starkov 8665ba202c feat: Upload images on copy-paste (#3569)
## Description

Markdown paste with images

Take MD from 

https://github.com/webstudio-is/webstudio/pull/3569#issuecomment-2171213517

Paste, see images are uploaded

## 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-16 20:40:09 +03:00
Bogdan Chadkin c9e130cc3e experimental: support transition shorthand (#3575)
Ref https://github.com/webstudio-is/webstudio/issues/3567
2024-06-16 15:38:01 +03:00
Oleg Isonen 9d725605c2 fix: Unsubscribe loading states after its ready (#3563)
## Description

Some of the states we are using for progress UI can be changed like
selected instance, and we need to stop listening to those events.

## Steps for reproduction

1. unselect an instance by pressing esc or clicking outside of canvas
2. see that loading indicator didn't appear again

## 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-16 13:18:55 +02:00
Bogdan Chadkin d251e998c8 refactor: use jsx in component generator tests (#3571)
Here enahnced our jsx with props support and rewrote component generator
tests with it as an example.

Props are solved in straightforward way, type of value described prop
type. Though in case of expression, parameter, asset, page, action used
classes as opaque types.
2024-06-16 12:58:10 +03:00
Bogdan Chadkin cf5c6b9f29 refactor: use jsx to represent instances in tests (#3568)
Added "@webstudio-is/sdk/testing" entry point with jsx utilities to
simplify instances representation.

React is used as runtime, then renderJsx traverse resulting tree and
converts into our data.
2024-06-15 00:06:20 +03:00
Bogdan Chadkin 3cc8e536e9 experimental: support animation shorthand (#3565)
Ref https://github.com/webstudio-is/webstudio/issues/2647
2024-06-14 21:21:29 +03:00
Oleg Isonen 3827146b4f experimental: Paste from webflow 7 (#3549)
Ref https://github.com/webstudio-is/webstudio/issues/2647

## Description

- show a toast when skipping unsupported elements
- handle shorthands
- RichText test and link inside rich text fixes

## 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-14 13:52:59 +02:00
Ivan Starkov 7b545e080d chore: Add buider API (#3564)
## Description

Add ability to make direct calls to builder API, like toast.

## Steps for reproduction

usage.

```
import { builderApi } from 'blaba';
builderApi.toast('ANYTHING')
```

## 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-14 14:27:52 +03:00
Bogdan Chadkin 132e94d290 experimental: support columns and list-style shorthands (#3557)
Ref https://github.com/webstudio-is/webstudio/issues/2647

Added support for the following shorthands
- columns
- column-rule
- list-style
2024-06-14 12:03:07 +03:00
Ivan Starkov 863bb2a1bc feat: Adds the ability to place images on the canvas immediately during upload (#3546)
## Description

- Adds the ability to place images on the canvas immediately during
upload, using the file blob or a provided URL.
- Enables images to use width and height from asset metadata.
- Detects duplicate assets and displays a warning message.

<img width="323" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/fe810dd8-3e3d-4cab-8669-b0d739044f49">


These changes allow images to appear on the canvas upon pasting, even if
the asset is not fully uploaded yet.


## Steps for reproduction

Start uploading few files on a slow connection, select them before
upload, see image on canvas is changed

## 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-14 11:01:07 +03:00
Bogdan Chadkin 93aeceac59 build: bump storybook (#3559)
Upgrade storybook and vite, esbuild and tsx with it.
2024-06-14 01:18:30 +03:00
Bogdan Chadkin be592846d1 fix: treat collection box as container (#3558)
Fixes https://github.com/webstudio-is/webstudio/issues/3473

Somehow lost this fix from other PR
2024-06-13 22:06:01 +03:00