4361 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
0.122.0
2023-12-14 17:29:02 +02:00
Prashik Meshram 72e4db14e2 Fix broken link (#2693)
## Description

Fixed #2692

## Steps for reproduction

The Contributing Guide link should point to correct URL now

## Code Review

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

## Before requesting a review

- [x] made a self-review
2023-12-14 17:28:37 +02:00
Ivan Starkov 6dfdd0d607 fix: "Add status to commit" fails on forked repos (#2689)
## Description

closes #2688

## 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 16:02:12 +02:00
Ivan Starkov 1376a0cd8f fix: Fix that status error prevented PR merge (#2687)
## Description

github protection rules are based on job names

## 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 15:06:58 +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
Bogdan Chadkin 60c17c6751 fix: create temporary files within assets directory (#2669)
Fixes
https://discord.com/channels/955905230107738152/1133337749856989316/1181798549982302329

This fixes linux issue when tmp and cwd are on different mounts or
drives.
2023-12-08 00:12:05 +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 bf3fb26058 build: trigger rebuild 2023-12-06 22:05:56 +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
Bogdan Chadkin a31e686248 build: fix running migrations on empty database (#2658)
Fixes https://github.com/webstudio-is/webstudio/issues/2632
2023-11-29 20:21: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
Jaya Krishna Namburu 301e7d95ca fix: Display error messages when a template is not passed for building a project (#2660)
## Description

fixes #2538 and #2615

Don't use `vercel` as default template while exporting from cli

## Code Review

- [ ] hi @istarkov , 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)
- [x] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
2023-11-28 18:07:21 +01: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
Jaya Krishna Namburu 6c2a26a464 feat: use netlify image loader for netlify templates (#2655) 2023-11-26 16:10:43 +05:30
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
0.121.0
2023-11-23 10:34:03 +02:00
Ivan Starkov a939121318 fix: Incorrectly quoted URLs in CSS (#2642)
## Description

Even we have this

https://github.com/webstudio-is/webstudio-builder/blob/9af97656af2e06a789f416bd93e1e1d0e756f063/packages/asset-uploader/src/utils/sanitize-s3-key.ts#L26

Additionally seems like best practice is to add backslashes for `"` and
`\` symbols, even this symbols are impossible having sanitize we are
using. (In case of sanitizer change everything can break)




## Steps for reproduction

1. click button
2. expect xyz

## Code Review

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

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/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-22 18:53:36 +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
0.120.0
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
0.119.0
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 6d50a46409 feat: Add client references table (#2617)
## Description

Table "ClientRefernces" allows to hold 3rd party client references per
user and service.
Like client_reference_id in stripe

Following constraints

```
  @@unique([userId, service])
  @@unique([reference, service])
```

As  `@@unique([userId, reference, service)` is not enough




Would need to change existing postgres node in n8n schema
https://webstudio.app.n8n.cloud/workflow/mdNfsFIIwnoMsz6N

onto

<img width="398" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/bf456ede-d211-4fd1-8f88-45038dd824c1">

```
INSERT INTO "ClientReferences"("userId", "service") 
VALUES ($1, 'stripe') 
ON CONFLICT ("userId", "service") DO UPDATE SET "userId"=$1 
RETURNING *;
```

## 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-11-16 00:54:16 +02:00
107c8e48bc feat: new token style source color (#2609)
New colors:

background.style-source.local
background.style-source.gradient.local

And some old colors adjusted.

---------

Co-authored-by: Bot (build-figma-tokens.yml) <bot@localhost>
Co-authored-by: Oleg Isonen <oleg008@gmail.com>
2023-11-15 20:36:46 +01:00
Bogdan Chadkin 130d21a307 fix: generate empty function for cleared actions (#2616)
Fixes
https://discord.com/channels/955905230107738152/1174291886878490656

Actions are cleared on copy paste though here we get runtime error
because output expects function to be defined.

Here always generate at least empty function.
2023-11-15 21:19:43 +03: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 3c3a0c87c9 build: fix missing imports 2023-11-14 16:48:49 +03: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
0.118.0
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