@builder.io/sdk-svelte 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,14 @@
1
1
  <script>import DynamicRenderer from "../../components/dynamic-renderer/dynamic-renderer.svelte";
2
2
  import { getClassPropName } from "../../functions/get-class-prop-name.js";
3
3
  import { filterAttrs } from "../helpers.js";
4
- export let link = undefined;
5
- export let builderLinkComponent = undefined;
6
4
  export let attributes = undefined;
5
+ export let link = undefined;
7
6
  export let openLinkInNewTab = undefined;
7
+ export let builderLinkComponent = undefined;
8
8
  export let text = undefined;
9
9
  </script>
10
10
 
11
11
  <DynamicRenderer
12
- TagName={link ? builderLinkComponent || "a" : "button"}
13
12
  attributes={{
14
13
  ...filterAttrs(attributes, "on:", false),
15
14
  [getClassPropName()]: `${link ? "" : "builder-button"} ${
@@ -25,6 +24,7 @@ export let text = undefined;
25
24
  role: "button",
26
25
  }),
27
26
  }}
27
+ TagName={link ? builderLinkComponent || "a" : "button"}
28
28
  actionAttributes={filterAttrs(attributes, "on:", true)}
29
29
  >
30
30
  {text}
@@ -2,10 +2,10 @@ import { SvelteComponent } from "svelte";
2
2
  import type { ButtonProps } from "./button.types.js";
3
3
  declare const __propDef: {
4
4
  props: {
5
- link?: ButtonProps["link"];
6
- builderLinkComponent?: ButtonProps["builderLinkComponent"];
7
5
  attributes?: ButtonProps["attributes"];
6
+ link?: ButtonProps["link"];
8
7
  openLinkInNewTab?: ButtonProps["openLinkInNewTab"];
8
+ builderLinkComponent?: ButtonProps["builderLinkComponent"];
9
9
  text?: ButtonProps["text"];
10
10
  };
11
11
  events: {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.0";
1
+ export declare const SDK_VERSION = "1.0.2";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.0";
1
+ export const SDK_VERSION = "1.0.2";
@@ -2,7 +2,6 @@ import { fastClone } from '../../fast-clone.js';
2
2
  import { set } from '../../set.js';
3
3
  import { getFunctionArguments } from '../helpers.js';
4
4
  import { safeDynamicRequire } from './safeDynamicRequire.js';
5
- const ivm = safeDynamicRequire('isolated-vm');
6
5
  const getSyncValName = (key) => `bldr_${key}_sync`;
7
6
  const BUILDER_SET_STATE_NAME = 'BUILDER_SET_STATE';
8
7
  const INJECTED_IVM_GLOBAL = 'BUILDER_IVM';
@@ -59,12 +58,14 @@ const getIsolateContext = () => {
59
58
  // return Builder.serverContext;
60
59
  // }
61
60
  // Builder.setServerContext(isolate.createContextSync());
61
+ const ivm = safeDynamicRequire('isolated-vm');
62
62
  const isolate = new ivm.Isolate({
63
63
  memoryLimit: 128
64
64
  });
65
65
  return isolate.createContextSync();
66
66
  };
67
67
  export const runInNode = ({ code, builder, context, event, localState, rootSetState, rootState }) => {
68
+ const ivm = safeDynamicRequire('isolated-vm');
68
69
  const state = fastClone({
69
70
  ...rootState,
70
71
  ...localState
@@ -1,15 +1,14 @@
1
1
  <script>import DynamicRenderer from "../../components/dynamic-renderer/dynamic-renderer.svelte";
2
2
  import { getClassPropName } from "../../functions/get-class-prop-name.js";
3
3
  import { filterAttrs } from "../helpers.js";
4
- export let link = undefined;
5
- export let builderLinkComponent = undefined;
6
4
  export let attributes = undefined;
5
+ export let link = undefined;
7
6
  export let openLinkInNewTab = undefined;
7
+ export let builderLinkComponent = undefined;
8
8
  export let text = undefined;
9
9
  </script>
10
10
 
11
11
  <DynamicRenderer
12
- TagName={link ? builderLinkComponent || "a" : "button"}
13
12
  attributes={{
14
13
  ...filterAttrs(attributes, "on:", false),
15
14
  [getClassPropName()]: `${link ? "" : "builder-button"} ${
@@ -25,6 +24,7 @@ export let text = undefined;
25
24
  role: "button",
26
25
  }),
27
26
  }}
27
+ TagName={link ? builderLinkComponent || "a" : "button"}
28
28
  actionAttributes={filterAttrs(attributes, "on:", true)}
29
29
  >
30
30
  {text}
@@ -2,10 +2,10 @@ import { SvelteComponent } from "svelte";
2
2
  import type { ButtonProps } from "./button.types.js";
3
3
  declare const __propDef: {
4
4
  props: {
5
- link?: ButtonProps["link"];
6
- builderLinkComponent?: ButtonProps["builderLinkComponent"];
7
5
  attributes?: ButtonProps["attributes"];
6
+ link?: ButtonProps["link"];
8
7
  openLinkInNewTab?: ButtonProps["openLinkInNewTab"];
8
+ builderLinkComponent?: ButtonProps["builderLinkComponent"];
9
9
  text?: ButtonProps["text"];
10
10
  };
11
11
  events: {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.0";
1
+ export declare const SDK_VERSION = "1.0.2";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.0";
1
+ export const SDK_VERSION = "1.0.2";
@@ -2,7 +2,6 @@ import { fastClone } from '../../fast-clone.js';
2
2
  import { set } from '../../set.js';
3
3
  import { getFunctionArguments } from '../helpers.js';
4
4
  import { safeDynamicRequire } from './safeDynamicRequire.js';
5
- const ivm = safeDynamicRequire('isolated-vm');
6
5
  const getSyncValName = (key) => `bldr_${key}_sync`;
7
6
  const BUILDER_SET_STATE_NAME = 'BUILDER_SET_STATE';
8
7
  const INJECTED_IVM_GLOBAL = 'BUILDER_IVM';
@@ -59,12 +58,14 @@ const getIsolateContext = () => {
59
58
  // return Builder.serverContext;
60
59
  // }
61
60
  // Builder.setServerContext(isolate.createContextSync());
61
+ const ivm = safeDynamicRequire('isolated-vm');
62
62
  const isolate = new ivm.Isolate({
63
63
  memoryLimit: 128
64
64
  });
65
65
  return isolate.createContextSync();
66
66
  };
67
67
  export const runInNode = ({ code, builder, context, event, localState, rootSetState, rootState }) => {
68
+ const ivm = safeDynamicRequire('isolated-vm');
68
69
  const state = fastClone({
69
70
  ...rootState,
70
71
  ...localState
@@ -1,15 +1,14 @@
1
1
  <script>import DynamicRenderer from "../../components/dynamic-renderer/dynamic-renderer.svelte";
2
2
  import { getClassPropName } from "../../functions/get-class-prop-name.js";
3
3
  import { filterAttrs } from "../helpers.js";
4
- export let link = undefined;
5
- export let builderLinkComponent = undefined;
6
4
  export let attributes = undefined;
5
+ export let link = undefined;
7
6
  export let openLinkInNewTab = undefined;
7
+ export let builderLinkComponent = undefined;
8
8
  export let text = undefined;
9
9
  </script>
10
10
 
11
11
  <DynamicRenderer
12
- TagName={link ? builderLinkComponent || "a" : "button"}
13
12
  attributes={{
14
13
  ...filterAttrs(attributes, "on:", false),
15
14
  [getClassPropName()]: `${link ? "" : "builder-button"} ${
@@ -25,6 +24,7 @@ export let text = undefined;
25
24
  role: "button",
26
25
  }),
27
26
  }}
27
+ TagName={link ? builderLinkComponent || "a" : "button"}
28
28
  actionAttributes={filterAttrs(attributes, "on:", true)}
29
29
  >
30
30
  {text}
@@ -2,10 +2,10 @@ import { SvelteComponent } from "svelte";
2
2
  import type { ButtonProps } from "./button.types.js";
3
3
  declare const __propDef: {
4
4
  props: {
5
- link?: ButtonProps["link"];
6
- builderLinkComponent?: ButtonProps["builderLinkComponent"];
7
5
  attributes?: ButtonProps["attributes"];
6
+ link?: ButtonProps["link"];
8
7
  openLinkInNewTab?: ButtonProps["openLinkInNewTab"];
8
+ builderLinkComponent?: ButtonProps["builderLinkComponent"];
9
9
  text?: ButtonProps["text"];
10
10
  };
11
11
  events: {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.0";
1
+ export declare const SDK_VERSION = "1.0.2";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.0";
1
+ export const SDK_VERSION = "1.0.2";
@@ -2,7 +2,6 @@ import { fastClone } from '../../fast-clone.js';
2
2
  import { set } from '../../set.js';
3
3
  import { getFunctionArguments } from '../helpers.js';
4
4
  import { safeDynamicRequire } from './safeDynamicRequire.js';
5
- const ivm = safeDynamicRequire('isolated-vm');
6
5
  const getSyncValName = (key) => `bldr_${key}_sync`;
7
6
  const BUILDER_SET_STATE_NAME = 'BUILDER_SET_STATE';
8
7
  const INJECTED_IVM_GLOBAL = 'BUILDER_IVM';
@@ -59,12 +58,14 @@ const getIsolateContext = () => {
59
58
  // return Builder.serverContext;
60
59
  // }
61
60
  // Builder.setServerContext(isolate.createContextSync());
61
+ const ivm = safeDynamicRequire('isolated-vm');
62
62
  const isolate = new ivm.Isolate({
63
63
  memoryLimit: 128
64
64
  });
65
65
  return isolate.createContextSync();
66
66
  };
67
67
  export const runInNode = ({ code, builder, context, event, localState, rootSetState, rootState }) => {
68
+ const ivm = safeDynamicRequire('isolated-vm');
68
69
  const state = fastClone({
69
70
  ...rootState,
70
71
  ...localState
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "lib",
@@ -4,16 +4,15 @@
4
4
  import { filterAttrs } from "../helpers.js";
5
5
  import type { ButtonProps } from "./button.types.js";
6
6
 
7
+ export let attributes: ButtonProps["attributes"] = undefined;
7
8
  export let link: ButtonProps["link"] = undefined;
9
+ export let openLinkInNewTab: ButtonProps["openLinkInNewTab"] = undefined;
8
10
  export let builderLinkComponent: ButtonProps["builderLinkComponent"] =
9
11
  undefined;
10
- export let attributes: ButtonProps["attributes"] = undefined;
11
- export let openLinkInNewTab: ButtonProps["openLinkInNewTab"] = undefined;
12
12
  export let text: ButtonProps["text"] = undefined;
13
13
  </script>
14
14
 
15
15
  <DynamicRenderer
16
- TagName={link ? builderLinkComponent || "a" : "button"}
17
16
  attributes={{
18
17
  ...filterAttrs(attributes, "on:", false),
19
18
  [getClassPropName()]: `${link ? "" : "builder-button"} ${
@@ -29,6 +28,7 @@
29
28
  role: "button",
30
29
  }),
31
30
  }}
31
+ TagName={link ? builderLinkComponent || "a" : "button"}
32
32
  actionAttributes={filterAttrs(attributes, "on:", true)}
33
33
  >
34
34
  {text}
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.0"
1
+ export const SDK_VERSION = "1.0.2"
@@ -3,7 +3,6 @@ import { set } from '../../set.js';
3
3
  import type { BuilderGlobals, ExecutorArgs, FunctionArguments } from '../helpers.js';
4
4
  import { getFunctionArguments } from '../helpers.js';
5
5
  import { safeDynamicRequire } from './safeDynamicRequire.js';
6
- const ivm: typeof import('isolated-vm') = safeDynamicRequire('isolated-vm');
7
6
  const getSyncValName = (key: string) => `bldr_${key}_sync`;
8
7
  const BUILDER_SET_STATE_NAME = 'BUILDER_SET_STATE';
9
8
  const INJECTED_IVM_GLOBAL = 'BUILDER_IVM';
@@ -68,6 +67,7 @@ const getIsolateContext = () => {
68
67
  // return Builder.serverContext;
69
68
  // }
70
69
  // Builder.setServerContext(isolate.createContextSync());
70
+ const ivm: typeof import('isolated-vm') = safeDynamicRequire('isolated-vm');
71
71
  const isolate = new ivm.Isolate({
72
72
  memoryLimit: 128
73
73
  });
@@ -82,6 +82,7 @@ export const runInNode = ({
82
82
  rootSetState,
83
83
  rootState
84
84
  }: ExecutorArgs) => {
85
+ const ivm: typeof import('isolated-vm') = safeDynamicRequire('isolated-vm');
85
86
  const state = fastClone({
86
87
  ...rootState,
87
88
  ...localState