@builder.io/sdk-svelte 0.5.2 → 0.5.4
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.
- package/README.md +4 -0
- package/package/--package.json +21 -7
- package/package/CHANGELOG.md +5 -0
- package/package/README.md +4 -0
- package/package/blocks/image/image.svelte.d.ts +1 -0
- package/package/blocks/text/text.svelte +2 -1
- package/package/components/content-variants/content-variants.svelte +12 -6
- package/package/constants/sdk-version.d.ts +1 -1
- package/package/constants/sdk-version.js +1 -1
- package/package/functions/evaluate/acorn-interpreter.js +3111 -0
- package/package/functions/evaluate/evaluate.js +1 -1
- package/package/functions/evaluate/non-node-runtime/index.d.ts +6 -0
- package/package/functions/evaluate/non-node-runtime/index.js +22 -0
- package/package/functions/evaluate/{non-node-runtime.d.ts → non-node-runtime/non-node-runtime.d.ts} +1 -1
- package/package/functions/evaluate/{non-node-runtime.js → non-node-runtime/non-node-runtime.js} +3 -3
- package/package/functions/evaluate/types.d.ts +1 -0
- package/package.json +18 -4
- package/src/blocks/text/text.svelte +2 -1
- package/src/components/content-variants/content-variants.svelte +12 -6
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/evaluate/acorn-interpreter.ts +2891 -0
- package/src/functions/evaluate/evaluate.ts +1 -1
- package/src/functions/evaluate/non-node-runtime/index.ts +23 -0
- package/src/functions/evaluate/{non-node-runtime.ts → non-node-runtime/non-node-runtime.ts} +4 -4
- package/src/functions/evaluate/types.ts +2 -1
- package/package/functions/evaluate/acorn.d.ts +0 -0
- package/package/functions/evaluate/acorn.js +0 -2433
- package/package/functions/evaluate/interpreter.js +0 -3853
- package/src/functions/evaluate/acorn.ts +0 -2501
- package/src/functions/evaluate/interpreter.ts +0 -3887
- /package/package/functions/evaluate/{interpreter.d.ts → acorn-interpreter.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -21,3 +21,7 @@ Take a look at [our example repo](/examples/svelte/sveltekit) for how to use thi
|
|
|
21
21
|
## Fetch
|
|
22
22
|
|
|
23
23
|
This Package uses fetch. See [these docs](https://github.com/BuilderIO/this-package-uses-fetch/blob/main/README.md) for more information.
|
|
24
|
+
|
|
25
|
+
## Non-Node.js Runtimes (Edge, Serverless)
|
|
26
|
+
|
|
27
|
+
If planning to deploy your app to a non-Node.js runtime (like Edge or Serverless functions), make sure to read the [Non-Node.js Runtimes](../../README.md#non-nodejs-runtimes-edge-serverless) section of the main README.
|
package/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": "0.5.
|
|
4
|
+
"version": "0.5.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"package",
|
|
@@ -98,11 +98,11 @@
|
|
|
98
98
|
"./context/types": "./context/types.js",
|
|
99
99
|
"./functions/apply-patch-with-mutation": "./functions/apply-patch-with-mutation.js",
|
|
100
100
|
"./functions/camel-to-kebab-case": "./functions/camel-to-kebab-case.js",
|
|
101
|
-
"./functions/evaluate/acorn": "./functions/evaluate/acorn.js",
|
|
101
|
+
"./functions/evaluate/acorn-interpreter": "./functions/evaluate/acorn-interpreter.js",
|
|
102
102
|
"./functions/evaluate/evaluate": "./functions/evaluate/evaluate.js",
|
|
103
103
|
"./functions/evaluate": "./functions/evaluate/index.js",
|
|
104
|
-
"./functions/evaluate/
|
|
105
|
-
"./functions/evaluate/non-node-runtime": "./functions/evaluate/non-node-runtime.js",
|
|
104
|
+
"./functions/evaluate/non-node-runtime": "./functions/evaluate/non-node-runtime/index.js",
|
|
105
|
+
"./functions/evaluate/non-node-runtime/non-node-runtime": "./functions/evaluate/non-node-runtime/non-node-runtime.js",
|
|
106
106
|
"./functions/evaluate/types": "./functions/evaluate/types.js",
|
|
107
107
|
"./functions/event-handler-name": "./functions/event-handler-name.js",
|
|
108
108
|
"./functions/extract-text-styles": "./functions/extract-text-styles.js",
|
|
@@ -175,11 +175,25 @@
|
|
|
175
175
|
"@sveltejs/adapter-auto": "1.0.0-next.71",
|
|
176
176
|
"@sveltejs/kit": "^1.16.2",
|
|
177
177
|
"@sveltejs/package": "1.0.0-next.1",
|
|
178
|
+
"nx": "^16.6.0",
|
|
179
|
+
"nx-cloud": "^16.2.0",
|
|
178
180
|
"svelte": "^3.59.1",
|
|
179
|
-
"svelte-check": "^3.
|
|
180
|
-
"svelte-preprocess": "^
|
|
181
|
+
"svelte-check": "^3.4.6",
|
|
182
|
+
"svelte-preprocess": "^5.0.4",
|
|
181
183
|
"tslib": "^2.3.1",
|
|
182
184
|
"typescript": "^5.1.6",
|
|
183
|
-
"vite": "^
|
|
185
|
+
"vite": "^4.4.8"
|
|
186
|
+
},
|
|
187
|
+
"nx": {
|
|
188
|
+
"implicitDependencies": [
|
|
189
|
+
"@builder.io/sdks"
|
|
190
|
+
],
|
|
191
|
+
"targets": {
|
|
192
|
+
"build": {
|
|
193
|
+
"outputs": [
|
|
194
|
+
"{projectRoot}/package"
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
}
|
|
184
198
|
}
|
|
185
199
|
}
|
package/package/CHANGELOG.md
CHANGED
package/package/README.md
CHANGED
|
@@ -21,3 +21,7 @@ Take a look at [our example repo](/examples/svelte/sveltekit) for how to use thi
|
|
|
21
21
|
## Fetch
|
|
22
22
|
|
|
23
23
|
This Package uses fetch. See [these docs](https://github.com/BuilderIO/this-package-uses-fetch/blob/main/README.md) for more information.
|
|
24
|
+
|
|
25
|
+
## Non-Node.js Runtimes (Edge, Serverless)
|
|
26
|
+
|
|
27
|
+
If planning to deploy your app to a non-Node.js runtime (like Edge or Serverless functions), make sure to read the [Non-Node.js Runtimes](../../README.md#non-nodejs-runtimes-edge-serverless) section of the main README.
|
|
@@ -31,6 +31,17 @@ $: hideVariantsStyleString = () => {
|
|
|
31
31
|
.map((value) => `.variant-${value.testVariationId} { display: none; } `)
|
|
32
32
|
.join("");
|
|
33
33
|
};
|
|
34
|
+
$: defaultContent = () => {
|
|
35
|
+
return shouldRenderVariants
|
|
36
|
+
? {
|
|
37
|
+
...content,
|
|
38
|
+
testVariationId: content?.id,
|
|
39
|
+
}
|
|
40
|
+
: handleABTestingSync({
|
|
41
|
+
item: content,
|
|
42
|
+
canTrack: getDefaultCanTrack(canTrack),
|
|
43
|
+
});
|
|
44
|
+
};
|
|
34
45
|
let shouldRenderVariants = checkShouldRunVariants({
|
|
35
46
|
canTrack: getDefaultCanTrack(canTrack),
|
|
36
47
|
content: content,
|
|
@@ -76,12 +87,7 @@ onMount(() => {
|
|
|
76
87
|
|
|
77
88
|
<ContentComponent
|
|
78
89
|
{...{}}
|
|
79
|
-
content={
|
|
80
|
-
? content
|
|
81
|
-
: handleABTestingSync({
|
|
82
|
-
item: content,
|
|
83
|
-
canTrack: getDefaultCanTrack(canTrack),
|
|
84
|
-
})}
|
|
90
|
+
content={defaultContent()}
|
|
85
91
|
classNameProp={`variant-${content?.id}`}
|
|
86
92
|
showContent={true}
|
|
87
93
|
{model}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "UNKNOWN_VERSION";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION =
|
|
1
|
+
export const SDK_VERSION = 'UNKNOWN_VERSION';
|