@webstudio-is/react-sdk 0.142.0 → 0.143.0
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/lib/index.js +26 -502
- package/lib/types/components/component-meta.d.ts +80 -0
- package/lib/types/context.d.ts +5 -0
- package/lib/types/css/normalize.d.ts +392 -0
- package/lib/types/embed-template.d.ts +205 -1
- package/lib/types/index.d.ts +0 -4
- package/package.json +6 -9
- package/lib/types/expression.d.ts +0 -94
- package/lib/types/expression.test.d.ts +0 -1
- package/lib/types/generator.d.ts +0 -9
- package/lib/types/generator.test.d.ts +0 -1
- package/lib/types/page-meta-generator.d.ts +0 -52
- package/lib/types/page-meta-generator.test.d.ts +0 -1
- package/lib/types/resources-generator.d.ts +0 -49
- package/lib/types/resources-generator.test.d.ts +0 -1
package/lib/types/index.d.ts
CHANGED
|
@@ -9,10 +9,6 @@ export { type WsComponentPropsMeta, type ComponentState, type PresetStyle, WsCom
|
|
|
9
9
|
export * from "./embed-template";
|
|
10
10
|
export * from "./props";
|
|
11
11
|
export * from "./context";
|
|
12
|
-
export * from "./expression";
|
|
13
12
|
export { getIndexesWithinAncestors } from "./instance-utils";
|
|
14
13
|
export * from "./hook";
|
|
15
|
-
export { generateUtilsExport } from "./generator";
|
|
16
14
|
export { generateWebstudioComponent, generateJsxElement, generateJsxChildren, } from "./component-generator";
|
|
17
|
-
export { generateResourcesLoader } from "./resources-generator";
|
|
18
|
-
export * from "./page-meta-generator";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.143.0",
|
|
4
4
|
"description": "Webstudio JavaScript / TypeScript API",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -26,18 +26,15 @@
|
|
|
26
26
|
"zod": "^3.19.1"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@jsep-plugin/assignment": "^1.2.1",
|
|
30
|
-
"@jsep-plugin/object": "^1.2.1",
|
|
31
29
|
"change-case": "^5.0.2",
|
|
32
30
|
"html-tags": "^3.3.1",
|
|
33
|
-
"jsep": "^1.3.8",
|
|
34
31
|
"nanoid": "^5.0.1",
|
|
35
32
|
"title-case": "^4.1.0",
|
|
36
|
-
"@webstudio-is/
|
|
37
|
-
"@webstudio-is/
|
|
38
|
-
"@webstudio-is/fonts": "0.
|
|
39
|
-
"@webstudio-is/image": "0.
|
|
40
|
-
"@webstudio-is/sdk": "0.
|
|
33
|
+
"@webstudio-is/icons": "^0.143.0",
|
|
34
|
+
"@webstudio-is/css-engine": "0.143.0",
|
|
35
|
+
"@webstudio-is/fonts": "0.143.0",
|
|
36
|
+
"@webstudio-is/image": "0.143.0",
|
|
37
|
+
"@webstudio-is/sdk": "0.143.0"
|
|
41
38
|
},
|
|
42
39
|
"exports": {
|
|
43
40
|
".": {
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { DataSources, Scope } from "@webstudio-is/sdk";
|
|
2
|
-
type TransformIdentifier = (id: string, assignee: boolean) => string;
|
|
3
|
-
export declare const validateExpression: (code: string, options?: {
|
|
4
|
-
/**
|
|
5
|
-
* Enable assignment operator for actions
|
|
6
|
-
*/
|
|
7
|
-
effectful?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Add optional chaining to access nested properties safely
|
|
10
|
-
* and without checks even when not exist
|
|
11
|
-
*/
|
|
12
|
-
optional?: boolean;
|
|
13
|
-
transformIdentifier?: TransformIdentifier;
|
|
14
|
-
}) => string;
|
|
15
|
-
/**
|
|
16
|
-
* check whether provided expression is a literal value
|
|
17
|
-
* like "", 0 or { param: "value" }
|
|
18
|
-
* which does not depends on any variable
|
|
19
|
-
*/
|
|
20
|
-
export declare const isLiteralExpression: (expression: string) => boolean;
|
|
21
|
-
export declare const encodeDataSourceVariable: (id: string) => string;
|
|
22
|
-
export declare const decodeDataSourceVariable: (name: string) => string | undefined;
|
|
23
|
-
export declare const generateExpression: ({ expression, dataSources, usedDataSources, scope, }: {
|
|
24
|
-
expression: string;
|
|
25
|
-
dataSources: Map<string, {
|
|
26
|
-
value: {
|
|
27
|
-
value: number;
|
|
28
|
-
type: "number";
|
|
29
|
-
} | {
|
|
30
|
-
value: string;
|
|
31
|
-
type: "string";
|
|
32
|
-
} | {
|
|
33
|
-
value: boolean;
|
|
34
|
-
type: "boolean";
|
|
35
|
-
} | {
|
|
36
|
-
value: string[];
|
|
37
|
-
type: "string[]";
|
|
38
|
-
} | {
|
|
39
|
-
type: "json";
|
|
40
|
-
value?: unknown;
|
|
41
|
-
};
|
|
42
|
-
type: "variable";
|
|
43
|
-
name: string;
|
|
44
|
-
id: string;
|
|
45
|
-
scopeInstanceId?: string | undefined;
|
|
46
|
-
} | {
|
|
47
|
-
type: "parameter";
|
|
48
|
-
name: string;
|
|
49
|
-
id: string;
|
|
50
|
-
scopeInstanceId?: string | undefined;
|
|
51
|
-
} | {
|
|
52
|
-
type: "resource";
|
|
53
|
-
name: string;
|
|
54
|
-
id: string;
|
|
55
|
-
resourceId: string;
|
|
56
|
-
scopeInstanceId?: string | undefined;
|
|
57
|
-
}>;
|
|
58
|
-
usedDataSources: Map<string, {
|
|
59
|
-
value: {
|
|
60
|
-
value: number;
|
|
61
|
-
type: "number";
|
|
62
|
-
} | {
|
|
63
|
-
value: string;
|
|
64
|
-
type: "string";
|
|
65
|
-
} | {
|
|
66
|
-
value: boolean;
|
|
67
|
-
type: "boolean";
|
|
68
|
-
} | {
|
|
69
|
-
value: string[];
|
|
70
|
-
type: "string[]";
|
|
71
|
-
} | {
|
|
72
|
-
type: "json";
|
|
73
|
-
value?: unknown;
|
|
74
|
-
};
|
|
75
|
-
type: "variable";
|
|
76
|
-
name: string;
|
|
77
|
-
id: string;
|
|
78
|
-
scopeInstanceId?: string | undefined;
|
|
79
|
-
} | {
|
|
80
|
-
type: "parameter";
|
|
81
|
-
name: string;
|
|
82
|
-
id: string;
|
|
83
|
-
scopeInstanceId?: string | undefined;
|
|
84
|
-
} | {
|
|
85
|
-
type: "resource";
|
|
86
|
-
name: string;
|
|
87
|
-
id: string;
|
|
88
|
-
resourceId: string;
|
|
89
|
-
scopeInstanceId?: string | undefined;
|
|
90
|
-
}>;
|
|
91
|
-
scope: Scope;
|
|
92
|
-
}) => string;
|
|
93
|
-
export declare const executeExpression: (expression: undefined | string) => any;
|
|
94
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/types/generator.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { type Asset, type DataSources, type Page, type Scope } from "@webstudio-is/sdk";
|
|
2
|
-
export type PageMeta = {
|
|
3
|
-
title: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
excludePageFromSearch?: boolean;
|
|
6
|
-
language?: string;
|
|
7
|
-
socialImageAssetId?: Asset["id"];
|
|
8
|
-
socialImageUrl?: string;
|
|
9
|
-
status?: number;
|
|
10
|
-
redirect?: string;
|
|
11
|
-
custom: Array<{
|
|
12
|
-
property: string;
|
|
13
|
-
content: string;
|
|
14
|
-
}>;
|
|
15
|
-
};
|
|
16
|
-
export declare const generatePageMeta: ({ globalScope, page, dataSources, }: {
|
|
17
|
-
globalScope: Scope;
|
|
18
|
-
page: Page;
|
|
19
|
-
dataSources: Map<string, {
|
|
20
|
-
value: {
|
|
21
|
-
value: number;
|
|
22
|
-
type: "number";
|
|
23
|
-
} | {
|
|
24
|
-
value: string;
|
|
25
|
-
type: "string";
|
|
26
|
-
} | {
|
|
27
|
-
value: boolean;
|
|
28
|
-
type: "boolean";
|
|
29
|
-
} | {
|
|
30
|
-
value: string[];
|
|
31
|
-
type: "string[]";
|
|
32
|
-
} | {
|
|
33
|
-
type: "json";
|
|
34
|
-
value?: unknown;
|
|
35
|
-
};
|
|
36
|
-
type: "variable";
|
|
37
|
-
name: string;
|
|
38
|
-
id: string;
|
|
39
|
-
scopeInstanceId?: string | undefined;
|
|
40
|
-
} | {
|
|
41
|
-
type: "parameter";
|
|
42
|
-
name: string;
|
|
43
|
-
id: string;
|
|
44
|
-
scopeInstanceId?: string | undefined;
|
|
45
|
-
} | {
|
|
46
|
-
type: "resource";
|
|
47
|
-
name: string;
|
|
48
|
-
id: string;
|
|
49
|
-
resourceId: string;
|
|
50
|
-
scopeInstanceId?: string | undefined;
|
|
51
|
-
}>;
|
|
52
|
-
}) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { DataSources, Page, Resources, Scope } from "@webstudio-is/sdk";
|
|
2
|
-
export declare const generateResourcesLoader: ({ scope, page, dataSources, resources, }: {
|
|
3
|
-
scope: Scope;
|
|
4
|
-
page: Page;
|
|
5
|
-
dataSources: Map<string, {
|
|
6
|
-
value: {
|
|
7
|
-
value: number;
|
|
8
|
-
type: "number";
|
|
9
|
-
} | {
|
|
10
|
-
value: string;
|
|
11
|
-
type: "string";
|
|
12
|
-
} | {
|
|
13
|
-
value: boolean;
|
|
14
|
-
type: "boolean";
|
|
15
|
-
} | {
|
|
16
|
-
value: string[];
|
|
17
|
-
type: "string[]";
|
|
18
|
-
} | {
|
|
19
|
-
type: "json";
|
|
20
|
-
value?: unknown;
|
|
21
|
-
};
|
|
22
|
-
type: "variable";
|
|
23
|
-
name: string;
|
|
24
|
-
id: string;
|
|
25
|
-
scopeInstanceId?: string | undefined;
|
|
26
|
-
} | {
|
|
27
|
-
type: "parameter";
|
|
28
|
-
name: string;
|
|
29
|
-
id: string;
|
|
30
|
-
scopeInstanceId?: string | undefined;
|
|
31
|
-
} | {
|
|
32
|
-
type: "resource";
|
|
33
|
-
name: string;
|
|
34
|
-
id: string;
|
|
35
|
-
resourceId: string;
|
|
36
|
-
scopeInstanceId?: string | undefined;
|
|
37
|
-
}>;
|
|
38
|
-
resources: Map<string, {
|
|
39
|
-
name: string;
|
|
40
|
-
id: string;
|
|
41
|
-
method: "get" | "post" | "put" | "delete";
|
|
42
|
-
url: string;
|
|
43
|
-
headers: {
|
|
44
|
-
value: string;
|
|
45
|
-
name: string;
|
|
46
|
-
}[];
|
|
47
|
-
body?: string | undefined;
|
|
48
|
-
}>;
|
|
49
|
-
}) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|