544 Commits
Author SHA1 Message Date
Ivan Starkov 22da5ea728 Update NPM 0.83.0 (#2008)
## 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-builder/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-07-31 12:52:19 +03:00
Bogdan Chadkin 923a3868a1 Fix drag&drop on canvas (#2007)
Here fixed droping new components on canvas.
Template was used to check constraints but failed
when no template found. Fixed by using fallback.
2023-07-31 13:23:55 +04:00
Oleg Isonen b995ff85a4 Publishing wording (#2006)
## Description

Removing mentioning Entri, there is no value in it, nobody knows them

## 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-builder/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-07-31 10:19:04 +02:00
Bogdan Chadkin 8b7dea5060 Add radix collapsible component (#2003)
Ref https://www.radix-ui.com/docs/primitives/components/collapsible

Added new sdk-components-react-radix package with collapsible component.
It does not have any styles so no need to move tailwind stuff yet.
2023-07-31 02:05:54 +04:00
Bogdan Chadkin 381a962437 Namespace component libraries (#2005)
Here added support for namespacing external libraries. Need this for
radix components to not prefix manually and have isolation in names in
case a few client libs are added an have collission in names or we add
native components with same names.
2023-07-30 21:14:57 +04:00
Ivan Starkov 80a72917cb Dialog (#2001)
## Description

Initial dialog implementation
Additionally:
`backdropFilter` property added to support dialog backdrop css

<img width="250" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/4f0e5b88-2b3b-42e6-bfd9-34dd36dc08f3">

Not detachables are Overlay, Trigger and Content
Header, Close can be removed 


Next PRS: 
- [ ] - Move to radix components repo
- [ ] - Add Right Icons


## Steps for reproduction

Create new project, add Radix/Dialog component


## 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-builder/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-07-30 20:07:43 +03:00
Bogdan Chadkin 6500e01397 Move getBrowserStyle utility into builder (#2004)
getBrowserStyle is used only inside of builder and should not be part of
sdk importable by all component libraries. It also depends on global
types which need to be included in every package dependent on react-sdk.
2023-07-30 20:56:29 +04:00
Bogdan Chadkin 004232da63 Bump checks packages (#2002)
- jest
- simple-git-hooks
- eslint
- size-limit
2023-07-28 23:37:33 +03:00
Bogdan Chadkin 685ca24552 Support actions copy paste (#1976)
Here added action copy paste support.

When all action dependencies are scoped to copied instance new variable
nams are ussed.

When some any dependency is not scoped execution is removed from copied
prop.
2023-07-28 01:53:58 +03:00
Ivan Starkov 74092f66bf Add radix popover (#1997)
## Description

 - [x] - clicks not working

## 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-builder/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-07-27 23:35:00 +03:00
Bogdan Chadkin 9328961b87 Allow to disable components detaching (#1986)
Here added meta.detachable flag which allows when set to true disable
copying, dragging and deleting instances of this component without ts
parent instance.

This is necessary to constrain components based on external code and
prevent deleting hidden components user cannot add again.
2023-07-27 20:43:46 +03:00
Ivan Starkov a190deb48b Fix selection on visually hidden elements (#1996)
## Description
Avoid any selection on Visually Hidden elements

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


## 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-builder/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-07-27 17:29:42 +03:00
Ivan Starkov dde795317a Fix layout (#1985)
## Description

closes #1960

## 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-builder/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-07-27 16:10:00 +03:00
Bogdan Chadkin be74680674 Support duplicating instances (#1995)
Fixes https://github.com/webstudio-is/webstudio-builder/issues/1994

Here changed behavior when copy and paste without changing instance
selection. Now it works as duplicating and copy is inserted after
selection.

Added cmd+d and ctrl+d shortcut to do this with single press without
polluting clipboard.
2023-07-27 15:52:10 +03:00
Oleg Isonen 4970f191e8 Update style source sizes, make it more compact (#1979)
closes https://github.com/webstudio-is/webstudio-builder/issues/1964

<img width="246" alt="Screenshot 2023-07-25 at 23 56 06"
src="https://github.com/webstudio-is/webstudio-builder/assets/52824/298dc656-441c-4733-a0b4-586d267496ca">
<img width="234" alt="Screenshot 2023-07-25 at 23 56 50"
src="https://github.com/webstudio-is/webstudio-builder/assets/52824/4b7389e5-9415-4426-bcbc-31c6f341581a">


## Description

1. Just updates spacings


## Code Review

- [ ] hi @taylornowotny , I need you to do
  - 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-builder/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-07-26 19:37:25 +02:00
Bogdan Chadkin 97b5316eb5 Bump ui libs (#1977)
Minor ui libraries releases

- floating-ui
- lexical
- react-aria
- radix-ui/colors
- pretty-bytes
- prismjs
- react-hotkeys-hook
- react-hot-toast
- @types/react & @types/react-dom
2023-07-26 13:48:16 +03:00
Oleg Isonen 5a1b878f29 Make name and value for domain records equal size (#1982)
Closes https://github.com/webstudio-is/webstudio-builder/issues/1906

## Description

Changed the field size to fit more info for domains

## Steps for reproduction

1. open publish dialog
2. add domain, open settings

<img width="313" alt="Screenshot 2023-07-26 at 01 30 58"
src="https://github.com/webstudio-is/webstudio-builder/assets/52824/f2f96805-0a9c-44ff-99d4-8938a9ead9bb">


## Code Review

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


## 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-builder/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-07-26 09:56:40 +02:00
Oleg Isonen 823a4ccaeb Rename "Add" panel to "Components" (#1981)
Closes https://github.com/webstudio-is/webstudio-builder/issues/1921
2023-07-26 01:14:48 +02:00
Oleg Isonen 9a52328d16 Change license from MIT to AGPL V3 (#1980)
The main reason for this change is the realization that a product needs
some more protection than a typical library. With this change it is
still an Open Source Core, but now corporations can't build on top of it
without contributing back to the OSS community or without buying a
license.
2023-07-26 01:06:21 +02:00
Oleg Isonen 57417c7a58 Add font smoothing by default to the body (#1972)
## Description

Adding font smoothing by default to the Body component


https://discord.com/channels/955905230107738152/955907787299360788/1132882679189229649

```
  -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
```

## Steps for reproduction

1. open any project, see in dev tools these 2 added (or check visually)

## 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-builder/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-07-25 12:38:58 +02:00
Bogdan Chadkin 09d2b77151 Support effectful expression arguments (#1967)
Here added support for expression arguments to utilize callback based
state management. So for example Form component can expose onStateChange
action with "newState" value and update any variable with it. So all
state management inside form becomes prop and callback.

You can test it by pasting

<details>
<summary>You can test by pasting this template and clicking on
+</summary>

```ison
{
  "@webstudio/template": [
    {
      "type": "instance",
      "component": "Box",
      "props": [
        {
          "type": "number",
          "name": "data-count",
          "value": 0,
          "dataSourceRef": {
            "type": "variable",
            "name": "count"
          }
        }
      ],
      "styles": [
        {
          "property": "display",
          "value": { "type": "keyword", "value": "flex" }
        }
      ],
      "children": [
        {
          "type": "instance",
          "component": "Button",
          "props": [
            {
              "type": "action",
              "name": "onClick",
              "value": [
                {
                  "type": "execute",
                  "code": "count = count - 1"
                }
              ]
            }
          ],
          "children": [{ "type": "text", "value": "-" }]
        },
        {
          "type": "instance",
          "component": "Box",
          "props": [
            {
              "type": "string",
              "name": "data-count",
              "value": "",
              "dataSourceRef": {
                "type": "expression",
                "name": "countString",
                "code": "\"0\" + count"
              }
            }
          ],
          "styles": [
            {
              "state": "::before",
              "property": "content",
              "value": { "type": "unparsed", "value": "attr(data-count)" }
            }
          ],
          "children": []
        },
        {
          "type": "instance",
          "component": "Button",
          "props": [
            {
              "type": "action",
              "name": "onClick",
              "value": [
                {
                  "type": "execute",
                  "args": ["event"],
                  "code": "count = count + 1 + event"
                }
              ]
            }
          ],
          "children": [{ "type": "text", "value": "+" }]
        }
      ]
    }
  ]
}
```

</details>
2023-07-24 20:14:01 +03:00
Bogdan Chadkin 886f839951 Upgrade to prettier v3 (#1973)
Ref https://prettier.io/blog/2023/07/05/3.0.0.html

Smaller package size, trailing comma for types always enabled, though I
disabled it for code.
2023-07-24 18:36:10 +03:00
Ivan Starkov f5cbd28962 Add tooltip (#1957)
## Description

Left
- [ ] - storybook (next PR)
- [ ] - default styles (next PR)
- [x] - Add property to edit tooltip
- [ ] - Contraints - do not allow delete Trigger and Content (next PRs)
- [ ] - Icons  (next PRs)

### Whats done to make tooltip to work.

1. Portals support through passing
[selectorIdAttribute](https://github.com/webstudio-is/webstudio-builder/blob/20c3b9fdea4a6f8e7a2cc00211b6e4ca95db13a5/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx#L290)
2. [Hidden ScreenReader elements
detection](https://github.com/webstudio-is/webstudio-builder/blob/20c3b9fdea4a6f8e7a2cc00211b6e4ca95db13a5/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx#L129)
3. [New elements on Canvas
detection]https://github.com/webstudio-is/webstudio-builder/blob/20c3b9fdea4a6f8e7a2cc00211b6e4ca95db13a5/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx#L179



- [x] Collapsed
- [x] Do composeEventHandlers 
- [x] Radix add spans of tooltip content 
To support screen readers

https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
Radix here

https://github.com/radix-ui/primitives/blob/main/packages/react/tooltip/src/Tooltip.tsx#L552-L556
Cloning our content

https://github.com/radix-ui/primitives/blob/main/packages/react/visually-hidden/src/VisuallyHidden.tsx

## Steps for reproduction

1. click button
3. expect xyz

## Code Review

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

## Before requesting a review

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

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/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-07-24 14:50:15 +03:00
Bogdan Chadkin 7b9b9216f2 Bump storybook (#1968)
Here bumped, storybook and esbuild and deduped all dependencies (mostly
babel packages)

- https://github.com/storybookjs/storybook/releases/tag/v7.1.0
- https://github.com/evanw/esbuild/releases/tag/v0.18.0

```diff
Packages:
- 2203
+ 1902
```
2023-07-24 13:55:31 +03:00
Bogdan Chadkin e98fe09eda Optimize typechecking (#1971)
Before we run two configurations of typescript on CI. Though this leads
to very long checks. Here I enabled "typecheck" script to generate dummy
.d.ts files to enable additional checks.

```diff
pnpm run -r typecheck (serial)
- 239.13s
+ 262.94s
pnpm turbo run size-test build checks dts --force (parallel locally)
- 2m30.609s
+ 1m47.622s
- pnpm turbo run size-test build checks dts --force (Ci)
- 6m 5s
+ pnpm turbo run size-test build checks --force (Ci)
+ 3m 22s
```
2023-07-24 11:38:19 +03:00
Bogdan Chadkin b226343599 Support copy pasting of data sources (#1963)
Here fixed the case when copy pasted form looses state and give errors
on submit.

Immerhin now converted to esm to work in tests.
Added tests for instances copy paste plugin.
The new logic is copy data sources as is if they are bound to copied
instances.

The new computeExpressionsDependencies used to detect if expression
depends on data sources outside of copied instances scope.
2023-07-23 11:56:13 +03:00
Ivan Starkov b14664ffd7 Update version 0.82.0 (#1962)
## 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-builder/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-07-20 09:38:40 +03:00
Bogdan Chadkin 6037a039b7 Compute insert constraints for tree (#1954)
Fixes https://github.com/webstudio-is/webstudio-builder/issues/1950

Here added new utility to compute constraints for tree when insert embed
template, paste something or reparent. I previous implementation all
constraints were merged which gave us false positives like when paste
List>ListItem we got "requiredAncestors: [List]". Here tree layout is
considered to exclude such false positives.

For testing try to copy paste List>ListItem
2023-07-19 22:23:34 +03:00
Oleg Isonen 3885b86f89 Attempt to fix useFetch for all our trpc calls (#1948)
## Description

I moved the fix to trpc layer to affect other calls as well. Turned out
the hook is called many times - as many as there are items in dashboard,
so I think relying on state dependency even though it works for
completely unknown reasons is better from perf standpoint (I think ...
who knows ...)

## 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-builder/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-07-19 18:23:14 +02:00
Bogdan Chadkin 14baeb5c85 Fix props bugs (#1955)
Fixes
https://discord.com/channels/955905230107738152/955907841070346300/1130819857403887616
and
https://discord.com/channels/955905230107738152/955907841070346300/1131197538112905348

- specified default in image wrapper to let our props generator find it
- fix added with ui props
- prevent setting defaults when no default value is available
2023-07-19 17:17:46 +03:00
Jaya Krishna Namburu ea14cb2bd0 (fix): Re-focus the tree-node after completion of editing the name (#1945)
## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. Use keyboard to navigate between the tree elements.
2. Click `Ctrl + E` to enter into edit mode.
3. Edit the name of the tree-node and then press `Enter`.
4. Use the up/down arrows to navigate to other nodes in the tree.

## Code Review

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

## Before requesting a review

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

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/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-07-17 18:13:51 +02:00
Ivan Starkov 85ac541bde Update 0.81.0 (#1944)
## 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-builder/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-07-17 11:56:56 +03:00
Bogdan Chadkin 713e873b1b Replace useMeasure with resize observer (#1942)
We are going to get rid of react-use.
Here replaced its useMeasure with resize observer. Sometimes using
native api without wrappers gives cleaner logic. Here we avoid using
effect as watcher and update store directly from callback.
2023-07-17 11:47:44 +03:00
Bogdan Chadkin a46156f96f Fix initial props (#1943)
Fixes
https://discord.com/channels/955905230107738152/955907841070346300/1130407072522059896

- replaced blocking error with console.error
- removed id from html embed initial props
2023-07-17 11:38:16 +03:00
Ivan Starkov 98164cde2a Update version (#1935)
## 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-builder/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-07-16 13:51:30 +03:00
Bogdan Chadkin eb0bc5ff77 Support pasting embed templates (#1936)
Here refactored copy paste plugin system to try each plugin until it
succeeds. This way we can have multiple solutions to copy paste from
plain text. For example embed template is hand written text and should
succeed before markdown starts parsing it.

```json
{
  "@webstudio/template": [
    {
      "type": "instance",
      "component": "Box",
      "children": [
        { "type": "text", "value": "Hello, I'm Box!" }
      ]
    }
  ]
}
```
2023-07-16 13:38:07 +03:00
Ivan Starkov d741ea3889 Race comment (#1934)
## 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-builder/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-07-16 13:36:37 +03:00
Ivan Starkov 97f0cc00d7 use useMount instead of sync once (#1937)
## Description

useSyncInitializeOnce is incompatibel with modern React especially in
dev mode.
useUnmount can't be used with it and any hooks with cleanup would give
the same issue.

Should affect only devmode
2023-07-15 14:02:43 +03:00
Bogdan Chadkin b424f9fbde Fix invalid ancestors for deeply nested instances (#1932)
Fixed the issue with pasting checkbox into button
which is wrapped into label

Prevented inserting label, checkbox, radio button and input into
buttons.
2023-07-14 19:28:29 +03:00
Ivan Starkov ae74469f10 Fix project creation race condition (#1933)
## Description

Fix create project useEffect not working.
Fix double redirect.
Fix card hover

## 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-builder/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-07-14 18:23:17 +03:00
Jaya Krishna Namburu 37b7672a43 (feat): Add ability to edit name of a tree node (#1909)
## Description

1. What is this PR about (link the issue and add a short description)

Users should be able to set the name of any node inside the tree-view. 

## Steps for reproduction

1. Select any node from the tree
2. Double click the node
3. Node enters into the edit mode.
4. Enter should save the name for the node.
5. The name should reflect everywhere in the application.

Things to take care of

- [x] The node should get into edit mode when you `double` click the
tree node.
- [x] The node should enter edit mode when you click `ctrl+r`
- [x] The keyboard shortcuts like, `up`, `down` expand and other tree
operations should work as expected.
- [x] `Esc` or loose of focus should set the name back.

closes #222 

## Before requesting a review

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

## Before merging

- [x] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/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-07-14 16:49:33 +02:00
Bogdan Chadkin 7364b51210 Run jest with sources (#1930)
Here added custom condition to jest config to make it load source code
instead of build artifacts.

This means we no longer need to rebuild after changing code in other
package
and we may even no need to generate cjs anymore.
2023-07-14 17:30:31 +03:00
Ivan Starkov 01faa89826 Add Value Tooltips (#1928)
## Description

ref #1798

- [x] - Text button groups tooltips should be resetable see
https://discord.com/channels/955905230107738152/1128272360630399016/1128800552743084263
as no other way to reset it (except alt button)

Value Tooltips for toggle groups

- [x] - Also fixed tooltip hovering issues on toggle groups see grace
area
<img width="273" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/d6b584d5-18ed-4b8b-9185-421dc373a567">


If group has no label we show reset on button

<img width="287" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/dfe00cf8-d1d1-49b5-951b-eb0b25084c29">


---


<img width="282" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/77dae4fa-80cc-47ce-b021-59d40a111ed5">


I also added tooltips on `...` Buttons, it shows all current values of
dialog underline

<img width="305" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/801980a7-195a-4fcf-818e-cc300dab9adc">




## Steps for reproduction

Toggle groups tooltips changed:
<img width="299" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/bd895eec-920f-4c60-be91-1ca6c8cde4a3">

<img width="291" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/7d4c5ab9-3244-485a-8e5d-a7d7b87a3853">
<img width="337" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/0489dcdb-d0fd-4ed9-aadf-06f57813e2a0">
<img width="514" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/feada2d4-bb39-495e-9bac-86183aca5ab7">
<img width="354" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/9eac96c5-cf45-42d2-9262-dede29a3de2c">




## 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-builder/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-07-14 14:50:09 +03:00
Oleg Isonen fde3c2c312 Fix ending contenteditable mode layout recalc (#1931)
## Description

Bug discovered in this PR
https://github.com/webstudio-is/webstudio-builder/pull/1909

When ending contenteditable, parent doesn't recalc the size of contents,
so I have to detouch and reinsert the edited element to force it.

## Steps for reproduction

1. start editing style source name and put a LOT of characters
2. exit editing mode
3. before: it would have empty container
4. now: renders and shows ellipsis

## 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-builder/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-07-14 11:49:33 +02:00
Bogdan Chadkin 50af5962d4 Bump nano libraries (#1925)
### Nanoid

https://github.com/ai/nanoid/blob/main/CHANGELOG.md

Here nanoid removes dual mode and becomes esm only

### Nanostores

https://github.com/nanostores/nanostores/blob/main/CHANGELOG.md

- deepMap store
- subscribers no longer called when value is not changed
- use-sync-external-store polyfill no longer installed

### Small updates

- nanoevents
(https://github.com/ai/nanoevents/blob/main/CHANGELOG.md#80)
- camelcase
(https://github.com/sindresorhus/camelcase/releases/tag/v7.0.0)
- html-tags
(https://github.com/sindresorhus/html-tags/releases/tag/v3.3.0)
- pretty-bytes
(https://github.com/sindresorhus/pretty-bytes/releases/tag/v6.1.0)
2023-07-13 16:11:34 +03:00
Ivan Starkov 5e072c7242 Position section (#1879)
## Description

ref #1858

Position section without "relative to element" (will do in next PR):

<img width="258" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/5184b5df-dc95-4b4b-b93b-00b4a63ac20b">

Changed label fonts on fonts from design. IMO non monospaced fonts for
numeric dynamic labels is disaster.
Here on 3-4 symbols difference in font length could be serious amouunt
pf pixels like '5'

Made label margins like in design 2px instead of 1. 

Simlified label logic to use css only solution.

Having that a lot of code is shared with spacing secion some bugs can be
in both

Next PR:
<img width="270" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/a7c0c842-eaf9-477e-9267-b9b29e087f41">


## Steps for reproduction

Goto spacing and position section, play with params.

## 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-builder/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-07-12 00:29:14 +03:00
Oleg IsonenandIvan Starkov 84c06569b9 Condense settings and properties tabs into one (#1902)
Closes #1880
Mostly also #1905

## Description

Merging Settings and properties


## 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-builder/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: Ivan Starkov <istarkov@gmail.com>
2023-07-11 22:50:26 +02:00
Bogdan Chadkin 05df3910f5 Support effectful expressions in component actions (#1914)
Here added support for callbacks or event handlers on components which
basically can do only assignment to variables for now with extended
(with assignment operator) syntax of expressions.
2023-07-11 20:27:06 +03:00
Bogdan Chadkin a8ecaf3a99 Migrate storybook to new format in sdk (#1924)
Here bumped storybook and migrated stories to Meta and StoryObj types
from deprecated ComponentMeta and ComponentStory.
2023-07-11 20:15:38 +03:00
Bogdan Chadkin b5a1b794e2 Fix text toolbar overflow (#1919)
This fixes an issue with text toolbar below top navigation because of
wrong middlewares order. Here used the right order and bumped/deduped
floating-ui.
2023-07-10 20:59:41 +03:00