514 Commits
Author SHA1 Message Date
Bogdan Chadkin 440fc6b6de Release 0.91.0 (#2209) 2023-08-29 10:02:57 +04:00
Bogdan Chadkin c2885fdea3 Release 0.90.0 (#2207) 2023-08-28 23:12:58 +04:00
Ivan Starkov d41b52abda Release 0.89.0 (#2200)
## 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-08-27 21:42:04 +03:00
Ivan Starkov 7fd01f7d07 NPM Release 0.88.0 (#2194)
## 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-08-27 11:01:48 +03:00
Bogdan Chadkin c48f6613a8 Fix focus navigation in preview (#2179)
Ref https://github.com/webstudio-is/webstudio-builder/issues/2151
https://github.com/webstudio-is/webstudio-builder/pull/2112

Here splitted webstudio component wrapper for preview and canvas. This
allows us to have more granular control over preview behavior. For
example canvas requres all elements to be focusable for instance
selection to work. Prevew should be close to published sites and reflect
user experience.
2023-08-25 17:47:40 +04:00
Ivan Starkov ab436a6fc4 Fix new href property duplicated on unmount (#2170)
## Description

On onmount outdated onSave were used. What cause creation of additional
href property on instance.

- [x] - Fix duplication on unmount (1st commit)
- [x] - Fix save, to validate if multiple properties with same name
exists. (2nd commit)
- [x] - Use latest prop in resolveUrlProp (3rd commit)

Use hide whitespaces.

<img width="303" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/156fc5a4-c697-4b05-8caf-7a3b7fa29264">


## 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-08-25 10:36:14 +03:00
Ivan Starkov 61acb2395c Nav menu internals (#2153)
## Description

ref #2151

<img width="592" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/2cfb1294-1b2b-4dd1-b4b7-0fa7ed355c90">

<img width="585" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/f71b000f-272a-44cf-a783-378d64570102">


## 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-08-21 23:52:22 +03:00
Bogdan Chadkin 5e900ff2e8 Add component tokens support (#2147)
Ref https://github.com/webstudio-is/webstudio-builder/issues/2137

Here added static tokens support to meta. Id of resulting style source
become persistent like this "componentName:tokenName". Such token styles
are inserted only if style source with same id not exist. This way we
prevent breaking styles already changed by user.

Style source input now autocomplete global tokens and suggest to create
predefined component tokens.

Also disabled spell check in style source input.

<img width="244" alt="Screenshot 2023-08-20 at 17 18 37"
src="https://github.com/webstudio-is/webstudio-builder/assets/5635476/9572f5b1-6243-49fa-83be-a0315f104987">
2023-08-20 18:48:16 +04:00
Bogdan Chadkin 8bfdf3174f Release 0.87.1 (#2114) 2023-08-13 23:15:41 +04:00
Ivan Starkov f9ce6a1ac9 Release 0.87.0 (#2110) 2023-08-13 22:34:12 +04:00
Bogdan Chadkin b1ce0c1bc9 Export generateUtilsExport 2023-08-13 20:18:00 +04:00
Bogdan Chadkin f240c46027 Infer label from component name (#2106)
Here made meta.label optional to simplify adding new stuff. Most of the
time label is just a "humanized" version of component name. With radix
there is an additional action to strip namespace. But still would be
less repetition if the name is just inferred.
2023-08-13 13:12:51 +04:00
Bogdan Chadkin b8a7a40dd5 Add utilities generator to sdk (#2098)
Here moved code generation of utilities from saas into sdk.

Now InstanceRoot accepts utils object with these 3 fields

- indexesWithinAncestors,
- executeComputingExpressions,
- executeEffectfulExpression,

Generation utility can be shared between cli and saas to simplify
maintenance.
2023-08-12 17:04:37 +04:00
Ivan Starkov 7a8fd3db49 Radix Button (#2097)
## Description

Add radix button.


<img width="555" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/afd07b25-2592-4ed6-9788-dd880be2f22e">


## 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-08-12 15:30:00 +03:00
Bogdan Chadkin a737e03c8f Automatically open tab content on select in navigator (#2073)
Here added tabs hooks to auto select tab when its content is selected.
Added new utils to hook context getPropValue and indexesWithinAncestors.

Renamed instanceSelection to instancePath.

Had to pass all props in edit mode in webstudio component



https://github.com/webstudio-is/webstudio-builder/assets/5635476/1f1211bc-0ea4-4d21-9205-1439668e08b4
2023-08-10 22:02:25 +04:00
Bogdan Chadkin 9157f98eb7 Bump ui libs (#2086)
Mostly patches and unrelated feature releases

- fontsource
- react-aria
- floating-ui
- radix colors
- react types
- type-fest
2023-08-10 21:55:08 +04:00
Ivan Starkov f8c97c2e2d release 0.86.0 (#2090)
## Description

release 0.86.0

## 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-08-10 18:49:02 +03:00
Ivan Starkov 7af70bdf50 0.85.0 (#2084)
## 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-08-09 23:43:21 +03:00
Ivan Starkov 034709c44d release-0.84.0 (#2082)
## Description

npm packages update


## 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-08-09 22:48:34 +03:00
Bogdan Chadkin fdf22ab9e6 Add component hooks (#2069)
We want to control some builder behavior specific to some components.
For example set open state on dialog, collapsible etc when select in
navigator.

Here I added hooks to be called from builder and executed in canvas. For
now added 2 hooks onNavigatorSelect and onNavigatorDeselect.
2023-08-08 16:38:53 +04:00
Bogdan Chadkin 8c6b5cff82 Bump to remix 1.19.2 (#2062)
Ref https://github.com/remix-run/remix/releases/tag/remix%401.19.2

Here fixed a few vulnerabilities by upgrading proxy-agent dependency.
2023-08-06 19:46:19 +04:00
Ivan Starkov 9a0536e852 Fix presets in radix (namespaces issue) (#2025)
## Description

Fix presets in case of namespaeces added `"` to selector
<img width="605" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/9b367c73-466e-4592-b45f-0b84660e423f">


Added presets to radix components


## 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-08-03 13:37:44 +03:00
Bogdan Chadkin 40e71b6c5b Simplify indexes within ancestors (#2021)
Here added dedicated field to meta to simplify computing and using
indexes.

```
{
  type: 'container',
  label: 'Tab Trigger',
  // this one
  indexWithinAncestor: 'Tabs'
}
```

Since it's single value, we no longer need to provide ancestor name in
runtime and no longer have bug with namespaces. Index now provided with
props.

```
getIndexWithinAncestorFromComponentProps(props): string | undefined
```
2023-08-01 22:40:16 +04:00
Bogdan Chadkin f751045e22 Add namespace prefix to constraints (#2020)
Ref
https://discord.com/channels/955905230107738152/1135965820602831036/1135965820602831036

This fixes the issue with adding any radix component. It got broken
because of unprefixed constraints.
2023-08-01 20:35:53 +04:00
Bogdan Chadkin 33a4b8dace Decouple data sources from props in templates (#2013)
Here changed the way we define data sources in embed templates. Now they
have separate section on instance. This way we will be able to use data
sources on styles or instances without binding them to props.

Also it's not more clear where data source is created vs where it is
only referenced.

```js
{
  type: 'instance',
  component: 'Form',
  dataSources: {
    state: { type: 'variable', initialValue: 'initial' },
    stateInitial: { type: 'expression', code: `state === 'initial'` }
  },
  props: [
    {
      type: 'dataSource',
      name: 'data-state',
      dataSourceName: 'state'
    }
  ],
  children: []
}
```
2023-08-01 16:59:07 +04:00
Bogdan Chadkin 4cfb0a9d62 Compute indexes within required ancestors (#2000)
Ref https://github.com/webstudio-is/webstudio-builder/pull/1516

Here added utility to compute indexes within ancestors. This should let
us easily co-locate tabs triggers and contents by their indexes.
2023-08-01 14:32:06 +04:00
Bogdan Chadkin ec84e84a10 Bump to remix 1.19 (#2016)
Ref https://github.com/remix-run/remix/releases/tag/remix%401.19.0

The main change is new option to disable polyfills
2023-08-01 00:53:06 +04:00
Bogdan Chadkin ac735df3ce Render component templates in stories (#2009)
Here added utility to render component templates in stories as it will
work in published site without running builder.

It will help to be more confident in templates we write for components.
Especially with complex logic with variables and expressions.

Can be tested here
https://638affb61acca1e593c6e558-gxuvohlrer.chromatic.com/?path=/story/sdk-components-react-radix_components-collapsible--collapsible
2023-07-31 15:46:56 +04:00
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
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
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 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
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 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
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 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
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
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
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
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
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 518cced7db Upgrade to remix 18 (#1876)
Enabled v2_headers and increased size limit

- https://github.com/remix-run/remix/releases/tag/remix%401.18.0
- https://github.com/remix-run/remix/releases/tag/remix%401.17.0
- https://github.com/remix-run/remix/releases/tag/remix%401.16.0
2023-07-10 15:26:13 +03:00
Bogdan Chadkin 3cdb2dbbc4 Support effectful expressions (#1908)
Here added two new utilities for generation and executing individual
expressions. Such expressions can use assignment operator to change any
variable.

This give us less opinionated solution for "set" action. We can just
execute any code our parser supports.
2023-07-08 12:15:40 +03:00