@webstudio-is/react-sdk 0.143.1 → 0.144.1-710b1d2.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 CHANGED
@@ -233,11 +233,15 @@ var createImageValueTransformer = (assets, { assetBaseUrl }) => (styleValue) =>
233
233
  };
234
234
  }
235
235
  };
236
- var generateCss = (data, { assetBaseUrl, atomic = false }) => {
237
- const assets = new Map(data.assets.map((asset) => [asset.id, asset]));
238
- const breakpoints = new Map(data.breakpoints);
239
- const styles = new Map(data.styles);
240
- const styleSourceSelections = new Map(data.styleSourceSelections);
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 data.componentMetas) {
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,
@@ -1,14 +1,12 @@
1
1
  import { type TransformValue } from "@webstudio-is/css-engine";
2
- import type { Asset, Breakpoint, Instance, StyleDecl, StyleDeclKey, StyleSourceSelection } from "@webstudio-is/sdk";
2
+ import type { Assets, Breakpoints, StyleSourceSelections, Styles } from "@webstudio-is/sdk";
3
3
  import type { WsComponentMeta } from "../components/component-meta";
4
- type Data = {
5
- assets: Asset[];
6
- breakpoints: [Breakpoint["id"], Breakpoint][];
7
- styles: [StyleDeclKey, StyleDecl][];
8
- styleSourceSelections: [Instance["id"], StyleSourceSelection][];
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: (data: Data, { assetBaseUrl, atomic }: CssOptions) => {
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 {};
@@ -1,7 +1,6 @@
1
1
  export * from "./remix";
2
2
  export * from "./css/index";
3
3
  export * from "./tree/index";
4
- export * from "./app/index";
5
4
  export * from "./core-components";
6
5
  export * from "./components/components-utils";
7
6
  export { PropMeta } from "./prop-meta";
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@webstudio-is/react-sdk",
3
- "version": "0.143.1",
3
+ "version": "0.144.1-710b1d2.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",
@@ -16,11 +15,10 @@
16
15
  "type-fest": "^4.3.1",
17
16
  "typescript": "5.2.2",
18
17
  "zod": "^3.22.4",
19
- "@webstudio-is/jest-config": "1.0.7",
20
- "@webstudio-is/tsconfig": "1.0.7"
18
+ "@webstudio-is/jest-config": "1.0.8-710b1d2.0",
19
+ "@webstudio-is/tsconfig": "1.0.8-710b1d2.0"
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/css-engine": "0.143.1",
34
- "@webstudio-is/fonts": "0.143.1",
35
- "@webstudio-is/icons": "^0.143.1",
36
- "@webstudio-is/image": "0.143.1",
37
- "@webstudio-is/sdk": "0.143.1"
31
+ "@webstudio-is/css-engine": "0.144.1-710b1d2.0",
32
+ "@webstudio-is/icons": "^0.144.1-710b1d2.0",
33
+ "@webstudio-is/fonts": "0.144.1-710b1d2.0",
34
+ "@webstudio-is/image": "0.144.1-710b1d2.0",
35
+ "@webstudio-is/sdk": "0.144.1-710b1d2.0"
38
36
  },
39
37
  "exports": {
40
38
  ".": {
@@ -1 +0,0 @@
1
- export * from "./root";
@@ -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;