@webstudio-is/react-sdk 0.119.0 → 0.120.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 +0 -13
- package/lib/types/props.d.ts +1 -83
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -76,18 +76,6 @@ var normalizeProps = ({
|
|
|
76
76
|
}
|
|
77
77
|
return newProps;
|
|
78
78
|
};
|
|
79
|
-
var getPropsByInstanceId = (props) => {
|
|
80
|
-
const propsByInstanceId = /* @__PURE__ */ new Map();
|
|
81
|
-
for (const prop of props.values()) {
|
|
82
|
-
let instanceProps = propsByInstanceId.get(prop.instanceId);
|
|
83
|
-
if (instanceProps === void 0) {
|
|
84
|
-
instanceProps = [];
|
|
85
|
-
propsByInstanceId.set(prop.instanceId, instanceProps);
|
|
86
|
-
}
|
|
87
|
-
instanceProps.push(prop);
|
|
88
|
-
}
|
|
89
|
-
return propsByInstanceId;
|
|
90
|
-
};
|
|
91
79
|
var idAttribute = "data-ws-id";
|
|
92
80
|
var selectorIdAttribute = "data-ws-selector";
|
|
93
81
|
var componentAttribute = "data-ws-component";
|
|
@@ -1464,7 +1452,6 @@ export {
|
|
|
1464
1452
|
getIndexesWithinAncestors,
|
|
1465
1453
|
getInstanceIdFromComponentProps,
|
|
1466
1454
|
getPresetStyleRules,
|
|
1467
|
-
getPropsByInstanceId,
|
|
1468
1455
|
getStyleRules,
|
|
1469
1456
|
idAttribute,
|
|
1470
1457
|
indexAttribute,
|
package/lib/types/props.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type PropsByInstanceId = Map<Instance["id"], Prop[]>;
|
|
1
|
+
import type { Page, Prop, Assets } from "@webstudio-is/sdk";
|
|
3
2
|
export type Pages = Map<Page["id"], Page>;
|
|
4
3
|
export declare const normalizeProps: ({ props, assetBaseUrl, assets, pages, }: {
|
|
5
4
|
props: Prop[];
|
|
@@ -134,87 +133,6 @@ export declare const normalizeProps: ({ props, assetBaseUrl, assets, pages, }: {
|
|
|
134
133
|
instanceId: string;
|
|
135
134
|
required?: boolean | undefined;
|
|
136
135
|
})[];
|
|
137
|
-
export declare const getPropsByInstanceId: (props: Map<string, {
|
|
138
|
-
value: number;
|
|
139
|
-
type: "number";
|
|
140
|
-
name: string;
|
|
141
|
-
id: string;
|
|
142
|
-
instanceId: string;
|
|
143
|
-
required?: boolean | undefined;
|
|
144
|
-
} | {
|
|
145
|
-
value: string;
|
|
146
|
-
type: "string";
|
|
147
|
-
name: string;
|
|
148
|
-
id: string;
|
|
149
|
-
instanceId: string;
|
|
150
|
-
required?: boolean | undefined;
|
|
151
|
-
} | {
|
|
152
|
-
value: boolean;
|
|
153
|
-
type: "boolean";
|
|
154
|
-
name: string;
|
|
155
|
-
id: string;
|
|
156
|
-
instanceId: string;
|
|
157
|
-
required?: boolean | undefined;
|
|
158
|
-
} | {
|
|
159
|
-
type: "json";
|
|
160
|
-
name: string;
|
|
161
|
-
id: string;
|
|
162
|
-
instanceId: string;
|
|
163
|
-
value?: unknown;
|
|
164
|
-
required?: boolean | undefined;
|
|
165
|
-
} | {
|
|
166
|
-
value: string;
|
|
167
|
-
type: "asset";
|
|
168
|
-
name: string;
|
|
169
|
-
id: string;
|
|
170
|
-
instanceId: string;
|
|
171
|
-
required?: boolean | undefined;
|
|
172
|
-
} | {
|
|
173
|
-
value: (string | {
|
|
174
|
-
instanceId: string;
|
|
175
|
-
pageId: string;
|
|
176
|
-
}) & (string | {
|
|
177
|
-
instanceId: string;
|
|
178
|
-
pageId: string;
|
|
179
|
-
} | undefined);
|
|
180
|
-
type: "page";
|
|
181
|
-
name: string;
|
|
182
|
-
id: string;
|
|
183
|
-
instanceId: string;
|
|
184
|
-
required?: boolean | undefined;
|
|
185
|
-
} | {
|
|
186
|
-
value: string[];
|
|
187
|
-
type: "string[]";
|
|
188
|
-
name: string;
|
|
189
|
-
id: string;
|
|
190
|
-
instanceId: string;
|
|
191
|
-
required?: boolean | undefined;
|
|
192
|
-
} | {
|
|
193
|
-
value: string;
|
|
194
|
-
type: "parameter";
|
|
195
|
-
name: string;
|
|
196
|
-
id: string;
|
|
197
|
-
instanceId: string;
|
|
198
|
-
required?: boolean | undefined;
|
|
199
|
-
} | {
|
|
200
|
-
value: string;
|
|
201
|
-
type: "expression";
|
|
202
|
-
name: string;
|
|
203
|
-
id: string;
|
|
204
|
-
instanceId: string;
|
|
205
|
-
required?: boolean | undefined;
|
|
206
|
-
} | {
|
|
207
|
-
value: {
|
|
208
|
-
code: string;
|
|
209
|
-
type: "execute";
|
|
210
|
-
args: string[];
|
|
211
|
-
}[];
|
|
212
|
-
type: "action";
|
|
213
|
-
name: string;
|
|
214
|
-
id: string;
|
|
215
|
-
instanceId: string;
|
|
216
|
-
required?: boolean | undefined;
|
|
217
|
-
}>) => PropsByInstanceId;
|
|
218
136
|
export declare const idAttribute: "data-ws-id";
|
|
219
137
|
export declare const selectorIdAttribute: "data-ws-selector";
|
|
220
138
|
export declare const componentAttribute: "data-ws-component";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.120.0",
|
|
4
4
|
"description": "Webstudio JavaScript / TypeScript API",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"jsep": "^1.3.8",
|
|
34
34
|
"nanoid": "^5.0.1",
|
|
35
35
|
"title-case": "^4.1.0",
|
|
36
|
-
"@webstudio-is/css-engine": "0.
|
|
37
|
-
"@webstudio-is/
|
|
38
|
-
"@webstudio-is/
|
|
39
|
-
"@webstudio-is/sdk": "0.
|
|
36
|
+
"@webstudio-is/css-engine": "0.120.0",
|
|
37
|
+
"@webstudio-is/fonts": "0.120.0",
|
|
38
|
+
"@webstudio-is/image": "0.120.0",
|
|
39
|
+
"@webstudio-is/sdk": "0.120.0"
|
|
40
40
|
},
|
|
41
41
|
"exports": {
|
|
42
42
|
".": {
|