443 Commits
Author SHA1 Message Date
Bogdan Chadkin 8a746f6594 feat: drop data-ws-* attributes (#3806)
Ref https://github.com/webstudio-is/webstudio/issues/3763

We no longer rely on data-ws-id and data-ws-component in generated apps.
Now we get a few benefits

- smaller workers to deploy
- cleaner html to inspect
- generated ssg can be modified directly by user

See generated fixtures

<img width="726" alt="image"
src="https://github.com/user-attachments/assets/59012201-0dce-47f3-aa80-387c77b8f7d6">
2024-07-28 21:30:26 +02:00
Bogdan Chadkin d7531b73b7 refactor: manage forms with resources (#3803)
Ref https://github.com/webstudio-is/webstudio/issues/3789

Here changed a few things

- replace WebhookForm action prop with resource, which is sent with
hidden field instead of instance id
- prevented generating method and action in client side code
- generate "action" resource instead of form properties for server

action prop is replaced only inside cli to not require support in
builder yet, in the future this can be part of client migrations
2024-07-27 20:20:29 +02:00
Bogdan Chadkin 31bdec9f3b feat: use classes for regular styles (#3796)
Closes https://github.com/webstudio-is/webstudio/issues/3788

Here switched from attribute selector to classes when atomic styles are
disabled. This will let us get rid from data-ws-* attributes in
generated html.
2024-07-26 14:00:20 +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
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 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 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
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
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
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
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 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
Bogdan Chadkin 5cd2899e81 fix: generate conditional collection (#3506)
Fixes
https://github.com/webstudio-is/webstudio-community/discussions/151

Here fixed the issue with generating conditional collection code for
published sites. Added fragment around collection when rendered inside
of condition.
2024-06-06 14:57:56 +03:00
Oleg Isonen 59ff9c23db refactor: Move text placeholders to meta templates (#3410)
## Description

Part of https://github.com/webstudio-is/webstudio/issues/3149 this
allows us to understand if an instance has text child.
With this knowledge we can place instances into components that don't
have text children and after them if they do.

## Steps for reproduction

1. insert text or paragraph
2. see there is expected placeholder text which is editable
3. select it, tell AI to change color or something
4. see it works and see in payload it didn't send placeholder text
5. try text editing on empty body - shouldn't allow it

## 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/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-05-24 13:53:19 +02:00
Ivan Starkov 0b48e9d314 feat: Add Time Component (#3369)
## Description

Mimics https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time 
The main difference as we use it to convert datetime field into Human
readable format

Play here:

https://time.development.webstudio.is/builder/dd5668ed-76c3-4c82-aacd-4fa21411d5ae

TODO:
- [ ] - We need to think about init text see image below

## Steps for reproduction

We need to think about init text

<img width="1320" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/b5236314-1184-4561-8ca9-22d7a7824fee">


<img width="271" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/4e5a338d-35ae-412a-817c-07643e918f6f">



## 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-05-16 20:10:37 +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
Ivan Starkov cc72849a62 feat: Canvas drawing of xml element (#3245)
## Description

This is only for Canvas rendering.

<img width="829" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/b63efe11-effd-4ed7-b9ff-a19d4a19a125">

<img width="244" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/3f59819b-486a-4d75-8890-c5c14950393c">

Editable
<img width="269" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/e25af3b0-0903-4390-aec8-1fc7383ec24b">

For generating it will change a little.

## Steps for reproduction

[Play Ref
https://xml-element.development.webstudio.is/builder/cab934af-8615-411a-99c1-5822a98eac74](https://xml-element.development.webstudio.is/builder/cab934af-8615-411a-99c1-5822a98eac74)

## 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-29 14:08:27 +03:00
Oleg Isonen c478e65029 fix: Prevent editing Code Text component as text (#3246)
Code Text component is designed to render code and in the future also to
add syntax highlighting. With this PR it won't be possible to treat it
like a Box any more and code will be entered using code property.

Benefit is: better UX for editing code and no unintended side effects
later with highlighting.

## Steps for reproduction

1. click button
2. expect xyz

## 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/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-27 21:33:57 +02: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 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 b2355e828f refactor: cleanup system variable (#3213)
Use sdk type for system variable and make it required in pages since it
was added to all pages with migration.
2024-04-20 17:44:01 +07:00
Bogdan Chadkin 201ffd5fb8 refactor: generalize css api and add test (#3081)
Here just small refactoring. generateCss will accept only maps instead
of arrays of tuples. Also added one test to not break on changes.
2024-04-03 19:26:06 +07:00
Bogdan Chadkin e34aa862bb refactor: move remix root into template (#3071)
React sdk not necessary to depend on remix. It will even complicate
remix upgrade.
2024-03-30 19:13:51 +07:00
Oleg Isonen d9eb1e2941 fix: keep the execution order of scripts when executing HTML Embed on the client (#3046)
https://share.descript.com/view/q8jpNCbmOxP

## Description

Originally all remote scripts in html embed were executed async, no
matter if they have async attribute or not.
Now they respect the order and only execute async if there is async
attribute.

## Steps for reproduction

This should fail on first load because first script is loaded async and
second script depends on it
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.3/gsap.min.js" async=""></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.3/ScrollTrigger.min.js"></script>
<script>
console.log('gsap', gsap)  
</script>
```

This should not fail
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.3/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.3/ScrollTrigger.min.js"></script>
<script>
console.log('gsap', gsap)  
</script>
```

## 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/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-25 13:47:21 +01:00
Oleg Isonen cd0174807d chore: use console.info instead of console.log (#3049)
## Description

We allow console.info (btw we should also allow warn/error/info), we
only disallow console.log in the linter because that's what we use for
debugging.

## Steps for reproduction

1. click button
2. expect xyz

## 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/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-24 12:52:46 +01:00
Bogdan Chadkin 20df0cef32 refactor: move forms properties into server module (#3034)
Here moved forms properties, page meta and remix params into server
module as used only in loader and never executed on client. Especially
forms properties may contain user credentials and remix does not
guarantee it to not appear in client side bundle.

Also moved those into sdk as universal generators.
2024-03-20 16:42:51 +07:00
Bogdan Chadkin dad898e6a4 refactor: move expressions into base sdk (#3032)
We need to move stuff not related to react out of react-sdk into
universal sdk package.
2024-03-19 02:02:07 +07:00
Bogdan Chadkin 99d0e53035 refactor: drop jsep parser (#3029)
We fully switched to acorn for parsing expressions and no longer need
for jsep and its plugins. User will stop getting esm false positives
when build with remix.
2024-03-18 20:47:20 +07:00
Bogdan Chadkin df579f7c72 refactor: switch to acorn expressions everywhere (#3028)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Here switched the rest of usages to acorn based expressions. Added
getExpressionIdentifiers utility to extract used variables names to
avoid using transpiler replaceVariable callback for this.
2024-03-18 14:41:57 +07:00
Bogdan Chadkin 61f751adab refactor: switch to acorn for expression linting (#3026)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Here added new lintExpression utility to provide diagnostics when
parsing error happens or not supported language feature is used.

Additionally it no longer forbids template literals and ternary
operators. Btw still need to get rid from legacy implementation to make
them work.

<img width="465" alt="Screenshot 2024-03-17 at 20 41 49"
src="https://github.com/webstudio-is/webstudio/assets/5635476/e208c360-7f2a-471a-aa54-983ff0a14247">
2024-03-18 11:01:40 +07:00
Bogdan Chadkin 3c99452716 refactor: transpile expression without code generation (#3022)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Our code generation with jsep has a big problem of not preserving
parenthesis entered by user. And jsep is not able to provide the
information.

As a solution I suggest to switch parser to acorn. It is 10 times bigger
than jsep but provides more strict parsing with location info for every
node. Here I use it to transpile simply with string manipulation which
does not touch spaces or parenthesis entered by user.
2024-03-17 13:17:52 +07:00
Bogdan Chadkin e17f1e082a experimental: support system variable in compiler (#3009)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Here switched to system variable in resources, page meta and component
generator. Removed legacy path params variable from schema.
2024-03-14 00:09:44 +07:00
Bogdan Chadkin 7b629b6908 experimental: navigate to dynamic path without reload (#2982)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Here fixed the issue with navigating to dynamic paths. The page get full
reload because provided path does not match pages list and remix link is
not used.

Solved by using the following heuristic: use remix link when the path is
relative and not asset. It will cover manually specified link href or
computed with expression one.

Now we can remove pagePaths from generated code.
2024-03-09 11:25:15 +07:00
f66a6bee31 experimental: Marketplace settings (#2949)
## Description

- split project settings
- add marketplace settings

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

---------

Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>
Co-authored-by: istarkov <istarkov@gmail.com>
2024-03-04 13:06:49 +01:00
Bogdan Chadkin 1b9bdd83d8 experimental: allow customizing page language (#2928)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Here added language field to page settings and changed page generation
to render whole html instead of just outlet, which let us modify html
lang attribute.

Also fixed cms banner on pro account.
2024-02-29 21:14:51 +07:00
Bogdan Chadkin 8722b15ab2 refactor: check literals with parser (#2950)
Here improved detecting literal values in expressions without executing
with potentially global variables.

Also fixed expression errors
2024-02-28 00:46:25 +07:00
Oleg IsonenandBogdan Chadkin dd425afd6d experimental: marketplace for templates (#2916)
## Description

Foundation for the future marketplace where free and paid templates,
apps and other integrations can be offered. This first version is
limited to a few items that we will add there.

Generally, we call items we list on that marketplace "products" and they
can open an iframe either in the same left panel or in a dialog.

1. Product listing is effectively a webstudio website that can also be
functional standalone as well as inside the builder.
2. That website wraps individual section templates with a utility
component that handles click-to-insert

<img width="281" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/52824/0511f516-fb95-41b4-afa5-7a91f238c353">
<img width="290" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/52824/881fdee8-47ac-4d3a-ac01-7fdb9fdab236">


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


## Steps for reproduction

1. no need to test for now

## Code Review

- [ ] hi @TrySound , I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)

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

---------

Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>
2024-02-26 10:01:36 +01:00
Bogdan Chadkin 1fe3a842b0 fix: replace unknown variables on paste (#2945)
Here fixing the issue with saving expressions with variables not
available in the scope which leads to user confusion and compilation
errors.

<img width="481" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5635476/176a0e1e-a74c-433f-8e7f-fdba9d4b8c71">
2024-02-26 12:03:20 +07:00
Bogdan Chadkin 727978b2c9 fix: prevent generating unused variables in resoures (#2929)
Here improved the resources generator to not produce variables unused in
resource fields.

Also enforced unused variables to be always provided to avoid issues
with not generated variables.
2024-02-20 13:10:38 +07:00
Bogdan Chadkin be2b5ce31a refactor: rename page.pathVariableId to pathParamsDataSourceId (#2915)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Small renaming for clarity
2024-02-15 19:31:55 +07:00
Bogdan Chadkin 4c20e2d317 refactor: avoid generating unused variables in page components (#2906)
Here improved component generator logic to not generate unused
variables. This way later we will be able to avoid requesting unused
resources as well.
2024-02-14 11:50:10 +07:00
Bogdan Chadkin 646245f21a experimental: allow changing page status (#2905)
Ref https://github.com/webstudio-is/webstudio/issues/2903

Here added support for changing page status in page settings. This works
for both redirect and content rendering.

User can render error message based on received cms data and give 404
status code.
2024-02-13 18:37:24 +07:00
Bogdan Chadkin 231f91c69c experimental: add redirect field to page settings (#2900)
Here added new field to page settings ui and page meta schema to
redirect page when specified. Having bindings support redirect can be
specified conditionally based on cms cata.

Tested locally, works with both urls and paths.

<img width="702" alt="Screenshot 2024-02-12 at 15 58 11"
src="https://github.com/webstudio-is/webstudio/assets/5635476/a4c171b4-8091-4241-b36f-401fc543427c">
2024-02-13 00:01:52 +07:00
Bogdan Chadkin 4a6c91bf31 experimental: generate variables for page meta website (#2898)
Here added support for variables in page meta in generated websites.
Prevented creating unused variables. We can reuse the same way for other
generated parts later.
2024-02-11 20:53:19 +07:00
Oleg Isonen 4f868c5a5f fix: Normalize border style (#2867)
## Description

We don't support inset/outset in the style panel which is the initial
for inputs/buttons

New defaults are:

- input, textarea, button - solid
- radio, checkbox - none (already was none, no change,but we didn't
reflect that in sp)

## Steps for reproduction

1. add those components to canvas
2. see that input, textarea, button - have solid border style in style
panel
3. see that radio, checkbox - show none

## 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-05 18:34:04 +01:00
Bogdan Chadkin 84fc906721 refactor: convert page meta fields into expressions (#2853)
Here added huge migration to convert page meta into expressions and
adapted the code to compute those.
2024-02-01 14:20:18 +07:00
Bogdan Chadkin 443fa5a50c feat: support social image url (#2845)
To integrate cms we need to be able to specify arbitary url as social
image instead of just asset.

Here added input which overrides selected asset. Hidden behind the flag.

<img width="538" alt="Screenshot 2024-01-30 at 21 27 40"
src="https://github.com/webstudio-is/webstudio/assets/5635476/e472028c-1cea-4e7d-9320-75d0cb9d2eff">
2024-01-30 23:39:40 +07:00