2465 Commits
Author SHA1 Message Date
Ivan Starkov 039b5ce3cf build: Release 0.122.0 (#2683)
## 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
2023-12-14 17:29:02 +02:00
Oleg Isonen b457cf3923 fix: Make sure browser support message clarifies cross-browser support for produced sites (#2686)
## Description

Make sure browser support message clarifies cross-browser support for
produced sites

Closing
https://github.com/webstudio-is/webstudio-community/discussions/89

## Steps for reproduction

1. open in any non-chromium browser to see the message

## 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
2023-12-14 13:50:38 +01:00
Ivan Starkov ff17a23483 feat: Add pro badge (#2680)
## Description

- Change "Pro" badge according to design
https://www.figma.com/file/xCBegXEWxROLqA1Y31z2Xo/%F0%9F%93%96-Webstudio-Design-Docs?node-id=8821%3A11999&mode=dev
- Add `Upgrade to Pro` menu item

See lostpixel changes too


ref #2661

## 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-12-14 13:55:19 +02:00
Ivan Starkov 915500024f fix: Click on an svg icon inside a link on canvas is not prevented (#2679)
## Description

closes #2676

## 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-12-13 10:57:31 +02:00
Bogdan Chadkin 92ddfbd64c feat: support page url pattern in builder (#2674)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here extended page "path" field to accept [url
pattern](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API)
compatible syntax to parametarize url with id, date, slug or anything
else. Such data can be passed to backend/cms requests and use the same
webstudio page for dynamic content.

Preview fields automatically added when template fields appear in path.

- fixed json local value
- create "Page params" parameter data source when template is used in
path
- added preview fields to compile path template and preview in ui

<img width="1292" alt="Screenshot 2023-12-08 at 11 35 30"
src="https://github.com/webstudio-is/webstudio/assets/5635476/5dac81f6-5334-4d01-bf28-a74dd709834b">
2023-12-11 20:19:18 +07:00
Bogdan Chadkin 61d664fc87 refactor: support parameter data source for collection item (#2671)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added dataSource.type = 'parameter' without initial value because
value is always provided by context. It let us fix a few issues with
variables without complicating logic.

- prevent deleting parameter variable (collection item) in variables
panel
- allow changing only name of parameter variable
- show only name in the list of variables
- fix removing expression from collection data
- hide item parameter from collection variable list
- prevent editing parameter value from props
- make collection unstylable
2023-12-08 11:42:18 +07:00
Ivan Starkov e65ec39eef feat: Support refund events (#2673)
## Description

ref #2661

We use GENERATED columns in our database to simplify field extraction
from events. This avoids using JSON operators in our views. We store the
entire event data. In our SaaS, there's a script that runs once to
populate the eventData. We've also updated the n8n schemas in our SaaS
to automatically fill eventData. This setup makes it quicker to add new
events or update logic in n8n schemas.

## Steps for reproduction


## 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-12-07 15:46:49 +02:00
Bogdan Chadkin 8e1683ed86 refactor: switch to instances slice for copy paste (#2666)
Use same well tested utility to slice and insert its copy for copy
paste. Moved most utilities inside of instance plugin and added more
tests for it.

## Steps for reproduction

1. play with copy paste
2023-12-06 23:49:48 +07:00
Bogdan Chadkin 7863527790 feat: disable props bound to complex expressions (#2667)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added logic to disable props controlled by complex expressions like
`formState === 'success'` where we cannot change variable value.

Added icon with tooltip near label to clarify why it is disabled.

<img width="312" alt="Screenshot 2023-12-03 at 13 46 47"
src="https://github.com/webstudio-is/webstudio/assets/5635476/ce5680d4-8e9c-4467-ac6a-5971d3ce99ab">
<img width="308" alt="Screenshot 2023-12-03 at 13 36 56"
src="https://github.com/webstudio-is/webstudio/assets/5635476/ecc20bd5-cfab-43a9-bc20-a762cd6d37b2">


## Steps for reproduction

1. create form
2. select success message
3. check "show" prop
4. create collection
5. go to html embed and change "code" expression to `collectionItem + "
pie"`
6. check code prop
2023-12-06 12:45:39 +07:00
Bogdan Chadkin f0b3d8fd6e feat: support duplicating pages (#2664)
Fix https://github.com/webstudio-is/webstudio/issues/2516

Here added "duplicate" button to page settings and implemented logic
based on recent instances slice utilities.

## Steps for reproduction

1. open pages
2. click on page
3. click "copy" button
2023-11-30 00:37:29 +03:00
Jaya Krishna Namburu 4304414623 fix: Handling custom value select from select box in transitions (#2659)
## Description

fixes #2624 

@taylornowotny i couldn't reproduce the issue with shortcuts in local or
either deployed version. But still added acheck to stop events while
typing. So, let me know if it's working on your side.


https://github.com/webstudio-is/webstudio/assets/11075561/67d09016-d9be-4bb2-9ff3-552fbc49c461



https://github.com/webstudio-is/webstudio/assets/11075561/9ab3669a-50d3-4c41-92fd-c544d91b55a8



## Code Review

- [ ] hi @kof, I need you to do
  - detailed review (read every line)

## Before requesting a review

- [x] made a self-review

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
2023-11-29 16:30:27 +01:00
Bogdan Chadkin d361c9ecee feat: add collection component to builder (#2657)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here added a "core" collection component to support iterating over json
arrays.

There is a lot of room for unification of all this logic though would
require building reactive tree abstraction.

Canvas automatically renders stub component for collection to make it
droppable. We can do the same for slot component.

Slot and Fragment eventually will go to "core" components too.

Added json/parameter prop types to embed template to support collection.

Fixed loosing focus while typing in json prop.

## Steps for reproduction

1. Drop collection component
2. play with it
2023-11-29 17:07:28 +03:00
Bogdan Chadkin 33509db139 refactor: reimplement duplicating instances (#2663)
Part of https://github.com/webstudio-is/webstudio/issues/2516

Here added new copy implementation. There are 2 differences

- it does not change existing instances and not change their children,
we will need this to copy pages
- it handles cross-project copy of portals (slots) properly, now each
portal content is inserted separately if the root does not exist and
skips otherwise
- much better covered with tests

## Steps for reproduction

1. try duplicating form and change form state prop
2. try duplicating form error message and change form state prop
2023-11-29 13:45:09 +03:00
Ivan Starkov 7142efc4ba feat: Pass cookies and requestUrl to n8n (#2662)
## Description

Ref #2661

This allows us to extract posthog (and probably other trackers) cookies
distinct_id for the user on the server side
And then using aliasing to use in n8n schemas
https://posthog.com/docs/product-analytics/identify#alias-assigning-multiple-distinct-ids-to-the-same-user

See corresponding n8n schemas in saas repo



## 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-11-29 12:33:50 +02:00
Bogdan Chadkin 847a042ceb fix: show active style states as remote (#2654)
Succeeds https://github.com/webstudio-is/webstudio/pull/2136 in more
simple way. Active states are preresolved for everything except local
styles. And local styles shown as overwritten when defined state is
active.

Fixes
https://discord.com/channels/955905230107738152/1177028091227418654

## Steps for reproduction

1. create form component
2. choose error state
3. set background red
4. go to error state in style source menu
5. should be "remote" label
6. set background green
7. go to stateless style source
8. reset background color
9. should be "overwritten" label
2023-11-26 14:59:21 +03:00
Ivan Starkov 04b7c2ff23 build: Update NPM 0.121.0 (#2652)
## 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
2023-11-23 10:34:03 +02:00
Ivan Starkov 0395839d50 feat: Support mutiple events in transaction log table (#2641)
## Description

SaaS has new n8n schema "Stripe Customer Subscription Deleted" 
Other schemas updated accordingly

Now unsubscribe is handled by our system

## 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-11-21 21:33:09 +02:00
Ivan Starkov d6c36c7a6f fix: Apply project owner's plan features to the via link shared projects (#2639)
## Description

Apply project owner's plan features to the projects shared via link

## Steps for reproduction

Need to be merged to test (see migrations)
After merge:
Create project shared link.
Open in incognito.


## 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-11-21 13:34:10 +02:00
Bogdan Chadkin 79d3214da5 fix: use main color for local style source (#2629)
Fixes https://github.com/webstudio-is/webstudio/issues/2610
2023-11-21 10:35:56 +03:00
Jaya Krishna NamburuandOleg Isonen ad55b6d93f fix: Handle empty input values from the share project popover (#1978)
fixes #1966 

The steps to reproduce are in the linked issue. The popover shouldn't
close when the name in the input field is empty.

@taylornowotny i would like you to check this one for the error state
please, the Input field didn't have a red outline for error as defined
in the figma file. I added it now, So, in order to check the effects of
this in other place. It would be great if you can check it once.

![Screenshot 2023-07-25 at 17 35
51](https://github.com/webstudio-is/webstudio-builder/assets/11075561/db8087b5-13f0-401d-8874-a7c9e248b350)

---------

Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-11-20 17:49:50 +01:00
Bogdan Chadkin 177cfeb3a1 refactor: use selectors in all tree callbacks (#2635)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Selectors in tree are necessary to easily access data of ancestors while
manipulaating navigator tree.

Required to support collections.
2023-11-20 16:33:29 +03:00
Ivan Starkov b8662bdc2d build: release 0.120.0 (#2634)
## 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
2023-11-19 23:33:22 +02:00
Ivan Starkov a87789f261 feat: Add fields to transaction log, add userPlanSettings (#2633)
## Description

Add additional fields to transaction log, so we can create billing
portal for users to unsubscribe/change etc of subscriptions

Plus:
- [x] Allow unlimited domains to all "pro" users
- [x] Add subscriptions link to users with subscriptions (created by n8n
schema on click)
<img width="213" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/08d40835-3273-4ca9-a0e3-8a4f7614da93">

- [x] Allow admin link sharing

## 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-11-19 22:43:31 +02:00
Bogdan Chadkin 3cfa10ae22 refactor: compute props contextually (#2628)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here refactored props values computing to reuse in both canvas and
settings panel and support future collections which need to provide
different values for same variables.

Grouped whole logic and covered with tests.

## Testing

- check image src is working
- check link switch page in preview
2023-11-18 20:54:51 +03:00
Ivan Starkov 50fa7b5f24 build: npm release 0.119.0 (#2621)
## 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
2023-11-17 14:38:34 +02:00
Jaya Krishna Namburu f1780479c4 chore: remove feature flag check for transitions (#2622)
## Description

All the PR's related to transitions are merged now. 
#2581 
#2572
#2538
#2511

## Before requesting a review

- [x] made a self-review
- [x] added inline comments where things may be not obvious (the "why",
not "what")
2023-11-17 14:05:12 +02:00
Ivan Starkov a326ae5b1d fix: Transaction log, add preview/production/local to hooks (#2623)
## Description

- Prisma way of creating migrations comparing local db with schema model
is super error prone
- Adding 'preview' | 'production' or 'local' to n8n webhooks otherway no
way to host hooks together

## 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-11-17 12:29:18 +02:00
Jaya Krishna Namburu c723b81885 feat: Add UI handling for transition timing and delay attributes (#2581)
- Adds `transition-duration` and `transition-delay` input boxes.
- Adds tooltips for all the UI actions for transitions.
2023-11-17 07:49:25 +01:00
Ivan Starkov 32e5f032b3 feat: Product and Transaction Log tables (#2618)
## Description

With high probability tables will be changed.
rest endpoint created for debugging purposes.

Product intent - synchonized from 3rd parties product (stripe) 
TransactionLog - product, user, status, date + debug and idempotency
params

Response example:

```json
{
  "id": "0d970e5f-3344-4658-bf5d-b58c33629e4e",
  "username": "admin",
  "checkout": [
    {
      "eventId": "evt_1OD7CmBvryG8KJjl9t37DsdG",
      "sessionId": "cs_test_b19O6wCvKi0MIADIs9QFZ5OB9lsC2G8HqzxyqMJO2NvnH2Bn43lyMN30V9",
      "createdAt": "2023-11-16T15:47:06.706Z",
      "product": {
        "id": "prod_P0NaZnTWpJJ2Ay",
        "name": "Webstudio Agency LTD Test",
        "description": null,
        "features": ["Admin permission sharing", "1000000 vews per month"],
        "meta": { "hello": "world", "kototto": "kototo" },
        "images": [
          "https://files.stripe.com/links/MDB8YWNjdF8xS2ZtQVNCdnJ5RzhLSmpsfGZsX3Rlc3RfMGlneEV4MVVGM3hsZlY4NWxRT21ZZVY300zmmq4R99"
        ]
      }
    },
    {
      "eventId": "evt_1OD7pXBvryG8KJjlhlmaIWpm",
      "sessionId": "cs_test_b1V2QOY7Lt21hDoCc1p9iuJ1ePaPnT2lE454dlPKHRdK62zh59K4C1tt0E",
      "createdAt": "2023-11-16T15:50:13.155Z",
      "product": {
        "id": "prod_P0NaZnTWpJJ2Ay",
        "name": "Webstudio Agency LTD Test",
        "description": null,
        "features": ["Admin permission sharing", "1000000 vews per month"],
        "meta": { "hello": "world", "kototto": "kototo" },
        "images": [
          "https://files.stripe.com/links/MDB8YWNjdF8xS2ZtQVNCdnJ5RzhLSmpsfGZsX3Rlc3RfMGlneEV4MVVGM3hsZlY4NWxRT21ZZVY300zmmq4R99"
        ]
      }
    }
  ]
}

```

## 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-11-16 21:43:42 +02:00
Oleg Isonen d142c65559 fix: Blurry canvas on windows (#2607)
## Description

We have experimented quite a bit before and now apparently on windows
the canvas is still blurry and removing all the hacks apparently solves
it. All of this is according to @itsNintu because he is the only one
with windows on the team, I don't see a good way to test it, because the
blur is very subtle and you won't clearly see it remote browsers.

## Steps for reproduction

1. open builder, resize canvas within workspace (100% scale)
2. resize canvas bigger than workspace, so that scale is lower than 100%
3. see that at no point in time canvas is blurry

## 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
2023-11-16 00:59:42 +01:00
Ivan Starkov b27a01355e feat: N8N support (#2614)
## Description

Link to `apps.webstudio.is/n8n/anything` solves 2 things.

1. Login user if it's not logged in
2. Executes schema in n8n passing userId and all query parameters
inside.

Example:

```
https://n8n.prs.webstudio.is/n8n/buy/stripe/com?link=test_dR67uJ0bu3fS2Zi4gh
```

Will execute [dev
schema](https://webstudio.app.n8n.cloud/workflow/mdNfsFIIwnoMsz6N) hook


`${N8N_WEBHOOK_URL}/buy/stripe/com?link=test_dR67uJ0bu3fS2Zi4gh`

```env
N8N_WEBHOOK_URL="https://webstudio.app.n8n.cloud/webhook-test/"
```

Schema after work will respond or with error or with redirect.



## Steps for reproduction

Open [n8n dev
schema](https://webstudio.app.n8n.cloud/workflow/mdNfsFIIwnoMsz6N)
Execute in Dev Mode (at bottom)
Open URL
[https://n8n.prs.webstudio.is/n8n/buy/stripe/com?link=test_dR67uJ0bu3fS2Zi4gh](https://n8n.prs.webstudio.is/n8n/buy/stripe/com?link=test_dR67uJ0bu3fS2Zi4gh)
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.example`
and the `builder/env-check.js` if mandatory
2023-11-15 18:33:16 +02:00
Bogdan Chadkin f3a75d150a refactor: simplify text child rendering (#2611)
Remove responsibility for text rendering from webstudio component to
instances tree renderer. Will simplify future collection management.
2023-11-14 16:41:35 +03:00
Bogdan Chadkin 98f0c348e8 refactor: add remix body component (#2612)
Here replaced scripts injection with special body override which already
includes those scripts.
This would simplify the logic with collections support.
2023-11-14 16:06:20 +03:00
Bogdan Chadkin 12ff45a34b feat: support generating collection (#2605)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here first part for collection support. Collections are generated as

```tsx
list.map((item, index) => <Fragment key={index}></Fragment>)
```

Added new "parameter" prop type to represent "item" which always refers
to variable. "parameter" reflects same semantics as js functions where
in function call it is argument `fn(1, 2, 3)` and in function definition
it is parameter `function fn(a, b, c) {}`.

Collection children are always wrapped with fragment to let having more
than one child and always pass key to avoid react warnings.
2023-11-13 20:48:22 +03:00
Bogdan Chadkin c776356b53 feat: add json prop control (#2608)
Ref https://github.com/webstudio-is/webstudio/issues/2532

We need json control in settings panel to support editing current value
of variables for example for collection data.

Here tweaked props logic and fixed a few bugs related to switching prop
type based on variable type.

Testing:

- type something in body id
- add this expression to body id `{ id: 1 }`
- remove expression
- add variable with `{ id: 1 }`
- select variable
- remove expression
2023-11-13 20:43:01 +03:00
Ivan Starkov aaef19dce7 build: Release-0.118.0 (#2606)
## 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
2023-11-13 10:42:19 +02:00
Ivan Starkov 1a5a58fd4b fix: Fix image loader paths (#2604)
## Description

Also add default asset path to remove env variables from setup

## 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-11-12 15:48:37 +02:00
Ivan Starkov 5b1cf6a11a fix: Make image path consistent with worker (#2593)
## Description

Make image path consistent with worker
Changed vercel env  for this branch `ASSET_BASE_URL = "/cgi/asset"`


## 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-11-12 15:22:08 +02:00
Bogdan Chadkin 4e9986d6e3 refactor: inline expressions into props (#2603)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Collections will introduce nested scope within same component and some
expressions at component scope will not be able to access collection
item. For example

```ts
const PageComponent = () => {
  let [value, set$value] = useState('')
  let show = value === 'error'
  let arialabel = item + ' label'
  return <Form>
    <ErrorMessage data-ws-show={show}></ErrorMessage>
    {list.map(item =>
      <Button aria-label={arialabel}></Button>
    )}
  </Form>
}
```

So the easiest way to workaround it without complicated scope selecting
is just inline all expressions into props.

```ts
const PageComponent = () => {
  let [value, set$value] = useState('')
  return <Form>
    <ErrorMessage data-ws-show={value === 'error'}></ErrorMessage>
    {list.map(item =>
      <Button aria-label={item + ' label'}></Button>
    )}
  </Form>
}
```

## Steps for reproduction

1. Create `Form`
2. Try to change `state` prop
2023-11-12 13:07:14 +03:00
Bogdan Chadkin 6dd5b0687a refactor: drop legeacy data source prop support (#2600)
Ref https://github.com/webstudio-is/webstudio/issues/2532

We successfullly migrated prod to expression prop. Now we can safely
remove legacy data source prop
handling across codebase.
2023-11-11 18:07:17 +03:00
Ivan Starkov 45706d77f0 build: NPM Release 0.117.0 (#2598)
## 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
2023-11-11 00:14:40 +02:00
Ivan Starkov 033c7044fa build: NPM release 0.116.0 (#2596)
## 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
2023-11-10 16:03:55 +02:00
Ivan Starkov 40f6a47922 build: NPM release 0.115.0 (#2594)
## 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
2023-11-10 14:50:41 +02:00
Ivan Starkov 9c90a357cd feat: Report deployment url at *.prs.webstudio.is (#2590)
## Description

To have ability to test some cloudflare worker issues we are now have
*.prs.webstudio.is domains.
Builder app now can be accessed through such urls.

Here we add prs.webstudio app url at the end of status list

<img width="973" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/5e716b07-bee5-41bd-9db6-deae01df89cd">

Known issues:
will not work if branch names exceed 24 chars,

Gonna not fix for now.


## 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-11-09 20:02:03 +02: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
Ivan Starkov 09fe7f2222 feat: Remove useless variables and logic (#2589)
## Description

Removed `process.env.BUILD_ORIGIN`,
`process.env.BUILD_REQUIRE_SUBDOMAIN`
And highly simplified corresponding logic

Next PR:
Removal of `DEPLOYMENT_URL`

## 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-11-09 18:20:00 +02:00
Bogdan Chadkin cdf6681bf3 fix: prop expression removing (#2588)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here fixed removing prop expression by using own prop setter in
variables instead of onChange callback which was proxied to support
updating variable values and prevented actually setting non-expression
value.

## Steps for reproduction

1. try to clear prop expression
2. try to add new expression
2023-11-09 15:40:47 +03:00
Bogdan Chadkin 052fe4e3ce refactor: add expression prop (#2582)
Ref https://github.com/webstudio-is/webstudio/issues/2532

On the last discussion about bindings we agreed expression are always
bound to single prop and cannot be reused.

Here added new prop.type = 'expression' as a replacement to
dataSource.type = 'expression'.

This will let us unify expression/variable reference and avoid deep
dependencies. Expressions and actions become similar.

For now both expression prop and legacy expression data source are
supported until we migrate completely in db.
2023-11-08 20:46:57 +03:00
Bogdan Chadkin 4f5883834e feat: add variables to settings panel (#2573)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here integrated variables into props. Now it can be tested considering
instances tree.

<img width="488" alt="Screenshot 2023-11-06 at 13 10 33"
src="https://github.com/webstudio-is/webstudio/assets/5635476/5615478a-c762-4324-9e24-745cbd452ad0">
2023-11-08 10:56:12 +03:00
Bogdan Chadkin fa06b7d495 feat: reuse variables on copy/paste within same tree (#2580)
Ref https://github.com/webstudio-is/webstudio/issues/2532

Here improved copy/paste behavior.

Before variables outside of copied tree were inlined. For example
ErrorMessage were loosing its expression when duplicated within same
form.

Now expressions and variables are preserved
and variables are inlined into expressions when paste target do not have
such variable. For example ErrorMessage get `"initial" == "error"`. With
upcoming UI it will be more obvious. The main idea here to not loose all
expressions but only references to unavailable variables.
2023-11-07 18:58:50 +03:00