@webstudio-is/react-sdk 0.0.0-c1d6247 → 0.0.0-ca00e2a

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.
@@ -9,4 +9,3 @@ export { PageSettingsCanonicalLink } from "./page-settings-canonical-link";
9
9
  * To render XML, we wrap it with an <svg> tag and add a suffix to avoid React's default behavior on these elements.
10
10
  */
11
11
  export declare const xmlNodeTagSuffix = "-ws-xml-node-fb77f896-8e96-40b9-b8f8-90a4e70d724a";
12
- export declare const getIndexWithinAncestorFromComponentProps: (props: Record<string, unknown>) => string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/react-sdk",
3
- "version": "0.0.0-c1d6247",
3
+ "version": "0.0.0-ca00e2a",
4
4
  "description": "Webstudio JavaScript / TypeScript API",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -11,10 +11,10 @@
11
11
  "react": "18.3.0-canary-14898b6a9-20240318",
12
12
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
13
13
  "strip-indent": "^4.0.0",
14
- "type-fest": "^4.32.0",
15
- "vitest": "^3.0.2",
16
- "zod": "^3.22.4",
17
- "@webstudio-is/template": "0.0.0-c1d6247",
14
+ "type-fest": "^4.37.0",
15
+ "vitest": "^3.1.2",
16
+ "zod": "^3.24.2",
17
+ "@webstudio-is/template": "0.0.0-ca00e2a",
18
18
  "@webstudio-is/tsconfig": "1.0.7"
19
19
  },
20
20
  "peerDependencies": {
@@ -25,12 +25,12 @@
25
25
  "dependencies": {
26
26
  "change-case": "^5.4.4",
27
27
  "html-tags": "^4.0.0",
28
- "nanoid": "^5.0.9",
29
- "@webstudio-is/css-engine": "0.0.0-c1d6247",
30
- "@webstudio-is/fonts": "0.0.0-c1d6247",
31
- "@webstudio-is/image": "0.0.0-c1d6247",
32
- "@webstudio-is/icons": "^0.0.0-c1d6247",
33
- "@webstudio-is/sdk": "0.0.0-c1d6247"
28
+ "nanoid": "^5.1.5",
29
+ "@webstudio-is/css-engine": "0.0.0-ca00e2a",
30
+ "@webstudio-is/fonts": "0.0.0-ca00e2a",
31
+ "@webstudio-is/image": "0.0.0-ca00e2a",
32
+ "@webstudio-is/icons": "^0.0.0-ca00e2a",
33
+ "@webstudio-is/sdk": "0.0.0-ca00e2a"
34
34
  },
35
35
  "exports": {
36
36
  ".": {
package/placeholder.d.ts CHANGED
@@ -5,21 +5,26 @@ declare module "__CONSTANTS__" {
5
5
  }
6
6
 
7
7
  declare module "__CLIENT__" {
8
- import type {
9
- FontAsset,
10
- ImageAsset,
11
- ResourceRequest,
12
- System,
13
- } from "@webstudio-is/sdk";
8
+ import type { ResourceRequest, System } from "@webstudio-is/sdk";
9
+
10
+ export const projectId: string;
11
+
12
+ export const lastPublished: string;
14
13
 
15
14
  export const siteName: string;
16
15
 
17
- export const favIconAsset: ImageAsset | undefined;
16
+ export const favIconAsset: string | undefined;
17
+
18
+ export const breakpoints: {
19
+ id: string;
20
+ minWidth?: number;
21
+ maxWidth?: number;
22
+ }[];
18
23
 
19
24
  // Font assets on current page (can be preloaded)
20
- export const pageFontAssets: FontAsset[];
25
+ export const pageFontAssets: string[];
21
26
 
22
- export const pageBackgroundImageAssets: ImageAsset[];
27
+ export const pageBackgroundImageAssets: string[];
23
28
 
24
29
  export const CustomCode: () => ReactNode;
25
30
 
@@ -42,8 +47,6 @@ declare module "__SERVER__" {
42
47
  type Params = Record<string, string | undefined>;
43
48
  export const getRemixParams: ({ ...params }: Params) => Params;
44
49
 
45
- export const projectId: string;
46
-
47
50
  export const contactEmail: undefined | string;
48
51
  }
49
52
 
@@ -1,20 +0,0 @@
1
- import { type TransformValue } from "@webstudio-is/css-engine";
2
- import { type Assets, type Breakpoints, type Instances, type Props, type StyleSourceSelections, type Styles, type WsComponentMeta } from "@webstudio-is/sdk";
3
- export type CssConfig = {
4
- assets: Assets;
5
- instances: Instances;
6
- props: Props;
7
- breakpoints: Breakpoints;
8
- styles: Styles;
9
- styleSourceSelections: StyleSourceSelections;
10
- componentMetas: Map<string, WsComponentMeta>;
11
- assetBaseUrl: string;
12
- atomic: boolean;
13
- };
14
- export declare const createImageValueTransformer: (assets: Assets, { assetBaseUrl }: {
15
- assetBaseUrl: string;
16
- }) => TransformValue;
17
- export declare const generateCss: ({ assets, instances, props, breakpoints, styles, styleSourceSelections, componentMetas, assetBaseUrl, atomic, }: CssConfig) => {
18
- cssText: string;
19
- classes: Map<string, string[]>;
20
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import type { StyleSheetRegular } from "@webstudio-is/css-engine";
2
- import type { Assets } from "@webstudio-is/sdk";
3
- export declare const addGlobalRules: (sheet: StyleSheetRegular, { assets, assetBaseUrl }: {
4
- assets: Assets;
5
- assetBaseUrl: string;
6
- }) => void;
@@ -1,2 +0,0 @@
1
- export * from "./global-rules";
2
- export * from "./css";
@@ -1,54 +0,0 @@
1
- import type { Instance, WebstudioFragment, WsEmbedTemplate, EmbedTemplateInstance, WsComponentMeta } from "@webstudio-is/sdk";
2
- export declare const generateDataFromEmbedTemplate: (treeTemplate: WsEmbedTemplate, metas: Map<Instance["component"], WsComponentMeta>, generateId?: () => string) => WebstudioFragment;
3
- export declare const namespaceMeta: (meta: WsComponentMeta, namespace: string, components: Set<EmbedTemplateInstance["component"]>) => {
4
- type: "control" | "embed" | "container" | "rich-text-child";
5
- description?: string | undefined;
6
- category?: "data" | "xml" | "hidden" | "media" | "general" | "typography" | "forms" | "localization" | "radix" | "internal" | undefined;
7
- label?: string | undefined;
8
- order?: number | undefined;
9
- template?: ({
10
- value: string;
11
- type: "text";
12
- placeholder?: boolean | undefined;
13
- } | {
14
- value: string;
15
- type: "expression";
16
- } | EmbedTemplateInstance)[] | undefined;
17
- states?: {
18
- label: string;
19
- selector: string;
20
- category?: "states" | "component-states" | undefined;
21
- }[] | undefined;
22
- constraints?: {
23
- relation: "ancestor" | "parent" | "self" | "child" | "descendant";
24
- component?: {
25
- $eq?: string | undefined;
26
- $neq?: string | undefined;
27
- $in?: string[] | undefined;
28
- $nin?: string[] | undefined;
29
- } | undefined;
30
- tag?: {
31
- $eq?: string | undefined;
32
- $neq?: string | undefined;
33
- $in?: string[] | undefined;
34
- $nin?: string[] | undefined;
35
- } | undefined;
36
- } | {
37
- relation: "ancestor" | "parent" | "self" | "child" | "descendant";
38
- component?: {
39
- $eq?: string | undefined;
40
- $neq?: string | undefined;
41
- $in?: string[] | undefined;
42
- $nin?: string[] | undefined;
43
- } | undefined;
44
- tag?: {
45
- $eq?: string | undefined;
46
- $neq?: string | undefined;
47
- $in?: string[] | undefined;
48
- $nin?: string[] | undefined;
49
- } | undefined;
50
- }[] | undefined;
51
- indexWithinAncestor?: string | undefined;
52
- icon: string;
53
- presetStyle?: import("@webstudio-is/sdk").PresetStyle;
54
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- import type { Instance, Instances, WsComponentMeta } from "@webstudio-is/sdk";
2
- export type IndexesWithinAncestors = Map<Instance["id"], number>;
3
- export declare const getIndexesWithinAncestors: (metas: Map<Instance["component"], WsComponentMeta>, instances: Instances, rootIds: Instance["id"][]) => IndexesWithinAncestors;
@@ -1 +0,0 @@
1
- export {};