@webstudio-is/react-sdk 0.143.0 → 0.144.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 +10 -24
- package/lib/types/css/css.d.ts +7 -10
- package/lib/types/css/css.test.d.ts +1 -0
- package/lib/types/index.d.ts +0 -1
- package/package.json +6 -8
- package/lib/types/app/index.d.ts +0 -1
- package/lib/types/app/root.d.ts +0 -7
package/lib/index.js
CHANGED
|
@@ -233,11 +233,15 @@ var createImageValueTransformer = (assets, { assetBaseUrl }) => (styleValue) =>
|
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
|
-
var generateCss = (
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
236
|
+
var generateCss = ({
|
|
237
|
+
assets,
|
|
238
|
+
breakpoints,
|
|
239
|
+
styles,
|
|
240
|
+
styleSourceSelections,
|
|
241
|
+
componentMetas,
|
|
242
|
+
assetBaseUrl,
|
|
243
|
+
atomic
|
|
244
|
+
}) => {
|
|
241
245
|
const classesMap = /* @__PURE__ */ new Map();
|
|
242
246
|
const regularSheet = createRegularStyleSheet({ name: "ssr-regular" });
|
|
243
247
|
const atomicSheet = atomic ? createAtomicStyleSheet({ name: "ssr-atomic" }) : void 0;
|
|
@@ -245,7 +249,7 @@ var generateCss = (data, { assetBaseUrl, atomic = false }) => {
|
|
|
245
249
|
for (const breakpoint of breakpoints.values()) {
|
|
246
250
|
(atomicSheet ?? regularSheet).addMediaRule(breakpoint.id, breakpoint);
|
|
247
251
|
}
|
|
248
|
-
for (const [component, meta] of
|
|
252
|
+
for (const [component, meta] of componentMetas) {
|
|
249
253
|
const presetStyle = meta.presetStyle;
|
|
250
254
|
if (presetStyle === void 0) {
|
|
251
255
|
continue;
|
|
@@ -401,23 +405,6 @@ var createInstanceElement = ({
|
|
|
401
405
|
);
|
|
402
406
|
};
|
|
403
407
|
|
|
404
|
-
// src/app/root.tsx
|
|
405
|
-
import { Links, Meta, Outlet as DefaultOutlet } from "@remix-run/react";
|
|
406
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
407
|
-
var Root = ({
|
|
408
|
-
Outlet = DefaultOutlet
|
|
409
|
-
}) => {
|
|
410
|
-
return /* @__PURE__ */ jsxs2("html", { lang: "en", children: [
|
|
411
|
-
/* @__PURE__ */ jsxs2("head", { children: [
|
|
412
|
-
/* @__PURE__ */ jsx2("meta", { charSet: "utf-8" }),
|
|
413
|
-
/* @__PURE__ */ jsx2("meta", { name: "viewport", content: "width=device-width,initial-scale=1" }),
|
|
414
|
-
/* @__PURE__ */ jsx2(Meta, {}),
|
|
415
|
-
/* @__PURE__ */ jsx2(Links, {})
|
|
416
|
-
] }),
|
|
417
|
-
/* @__PURE__ */ jsx2(Outlet, {})
|
|
418
|
-
] });
|
|
419
|
-
};
|
|
420
|
-
|
|
421
408
|
// src/core-components.ts
|
|
422
409
|
import { ListViewIcon } from "@webstudio-is/icons/svg";
|
|
423
410
|
var portalComponent = "Slot";
|
|
@@ -1483,7 +1470,6 @@ export {
|
|
|
1483
1470
|
EmbedTemplateStyleDecl,
|
|
1484
1471
|
PropMeta,
|
|
1485
1472
|
ReactSdkContext,
|
|
1486
|
-
Root,
|
|
1487
1473
|
WsComponentMeta,
|
|
1488
1474
|
WsEmbedTemplate,
|
|
1489
1475
|
addGlobalRules,
|
package/lib/types/css/css.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { type TransformValue } from "@webstudio-is/css-engine";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Assets, Breakpoints, StyleSourceSelections, Styles } from "@webstudio-is/sdk";
|
|
3
3
|
import type { WsComponentMeta } from "../components/component-meta";
|
|
4
|
-
type
|
|
5
|
-
assets:
|
|
6
|
-
breakpoints:
|
|
7
|
-
styles:
|
|
8
|
-
styleSourceSelections:
|
|
4
|
+
export type CssConfig = {
|
|
5
|
+
assets: Assets;
|
|
6
|
+
breakpoints: Breakpoints;
|
|
7
|
+
styles: Styles;
|
|
8
|
+
styleSourceSelections: StyleSourceSelections;
|
|
9
9
|
componentMetas: Map<string, WsComponentMeta>;
|
|
10
|
-
};
|
|
11
|
-
type CssOptions = {
|
|
12
10
|
assetBaseUrl: string;
|
|
13
11
|
atomic: boolean;
|
|
14
12
|
};
|
|
@@ -62,8 +60,7 @@ export declare const createImageValueTransformer: (assets: Map<string, {
|
|
|
62
60
|
}>, { assetBaseUrl }: {
|
|
63
61
|
assetBaseUrl: string;
|
|
64
62
|
}) => TransformValue;
|
|
65
|
-
export declare const generateCss: (
|
|
63
|
+
export declare const generateCss: ({ assets, breakpoints, styles, styleSourceSelections, componentMetas, assetBaseUrl, atomic, }: CssConfig) => {
|
|
66
64
|
cssText: string;
|
|
67
65
|
classesMap: Map<string, string[]>;
|
|
68
66
|
};
|
|
69
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.144.0",
|
|
4
4
|
"description": "Webstudio JavaScript / TypeScript API",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@jest/globals": "^29.7.0",
|
|
10
|
-
"@remix-run/react": "^1.19.2",
|
|
11
10
|
"@types/react": "^18.2.21",
|
|
12
11
|
"@types/react-dom": "^18.2.7",
|
|
13
12
|
"react": "^18.2.0",
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
"@webstudio-is/tsconfig": "1.0.7"
|
|
21
20
|
},
|
|
22
21
|
"peerDependencies": {
|
|
23
|
-
"@remix-run/react": "^1.19.1",
|
|
24
22
|
"react": "^18.2.0",
|
|
25
23
|
"react-dom": "^18.2.0",
|
|
26
24
|
"zod": "^3.19.1"
|
|
@@ -30,11 +28,11 @@
|
|
|
30
28
|
"html-tags": "^3.3.1",
|
|
31
29
|
"nanoid": "^5.0.1",
|
|
32
30
|
"title-case": "^4.1.0",
|
|
33
|
-
"@webstudio-is/
|
|
34
|
-
"@webstudio-is/
|
|
35
|
-
"@webstudio-is/
|
|
36
|
-
"@webstudio-is/
|
|
37
|
-
"@webstudio-is/
|
|
31
|
+
"@webstudio-is/css-engine": "0.144.0",
|
|
32
|
+
"@webstudio-is/fonts": "0.144.0",
|
|
33
|
+
"@webstudio-is/sdk": "0.144.0",
|
|
34
|
+
"@webstudio-is/icons": "^0.144.0",
|
|
35
|
+
"@webstudio-is/image": "0.144.0"
|
|
38
36
|
},
|
|
39
37
|
"exports": {
|
|
40
38
|
".": {
|
package/lib/types/app/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./root";
|
package/lib/types/app/root.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Outlet as DefaultOutlet } from "@remix-run/react";
|
|
2
|
-
/**
|
|
3
|
-
* We are using Outlet prop from index layout when user renders project from a subdomain.
|
|
4
|
-
*/
|
|
5
|
-
export declare const Root: ({ Outlet, }: {
|
|
6
|
-
Outlet: typeof DefaultOutlet;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element;
|