@webstudio-is/react-sdk 0.0.1-c87cdba.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/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@webstudio-is/react-sdk",
3
+ "version": "0.0.1-c87cdba.0",
4
+ "description": "Webstudio JavaScript / TypeScript API",
5
+ "author": "Webstudio <github@webstudio.is>",
6
+ "homepage": "https://webstudio.is",
7
+ "type": "module",
8
+ "devDependencies": {
9
+ "@types/react": "^18.2.70",
10
+ "@types/react-dom": "^18.2.25",
11
+ "react": "18.3.0-canary-14898b6a9-20240318",
12
+ "react-dom": "18.3.0-canary-14898b6a9-20240318",
13
+ "strip-indent": "^4.0.0",
14
+ "type-fest": "^4.31.0",
15
+ "vitest": "^2.1.8",
16
+ "zod": "^3.22.4",
17
+ "@webstudio-is/template": "0.0.1-c87cdba.0",
18
+ "@webstudio-is/tsconfig": "1.0.8-c87cdba.0"
19
+ },
20
+ "peerDependencies": {
21
+ "react": "18.3.0-canary-14898b6a9-20240318",
22
+ "react-dom": "18.3.0-canary-14898b6a9-20240318",
23
+ "zod": "^3.19.1"
24
+ },
25
+ "dependencies": {
26
+ "change-case": "^5.4.4",
27
+ "html-tags": "^4.0.0",
28
+ "nanoid": "^5.0.8",
29
+ "@webstudio-is/css-engine": "0.0.1-c87cdba.0",
30
+ "@webstudio-is/sdk": "0.0.1-c87cdba.0",
31
+ "@webstudio-is/fonts": "0.0.1-c87cdba.0",
32
+ "@webstudio-is/image": "0.0.1-c87cdba.0",
33
+ "@webstudio-is/icons": "^0.0.1-c87cdba.0"
34
+ },
35
+ "exports": {
36
+ ".": {
37
+ "webstudio": "./src/index.ts",
38
+ "types": "./lib/types/index.d.ts",
39
+ "import": "./lib/index.js"
40
+ },
41
+ "./runtime": {
42
+ "webstudio": "./src/runtime.ts",
43
+ "types": "./lib/types/runtime.d.ts",
44
+ "import": "./lib/runtime.js"
45
+ },
46
+ "./placeholder": {
47
+ "types": "./placeholder.d.ts"
48
+ }
49
+ },
50
+ "files": [
51
+ "lib/*",
52
+ "./placeholder.d.ts",
53
+ "!*.{test,stories}.*"
54
+ ],
55
+ "license": "AGPL-3.0-or-later",
56
+ "private": false,
57
+ "sideEffects": false,
58
+ "scripts": {
59
+ "build": "rm -rf lib && esbuild src/index.ts src/runtime.ts --outdir=lib --bundle --format=esm --packages=external",
60
+ "dts": "tsc --project tsconfig.dts.json",
61
+ "typecheck": "tsc",
62
+ "test": "vitest run"
63
+ }
64
+ }
@@ -0,0 +1,61 @@
1
+ declare module "__CONSTANTS__" {
2
+ import type { ImageLoader } from "@webstudio-is/image";
3
+ export const assetBaseUrl: string;
4
+ export const imageBaseUrl: string;
5
+ export const imageLoader: ImageLoader;
6
+ }
7
+
8
+ declare module "__CLIENT__" {
9
+ import type {
10
+ FontAsset,
11
+ ImageAsset,
12
+ ResourceRequest,
13
+ System,
14
+ } from "@webstudio-is/sdk";
15
+
16
+ export const siteName: string;
17
+
18
+ export const favIconAsset: ImageAsset | undefined;
19
+
20
+ // Font assets on current page (can be preloaded)
21
+ export const pageFontAssets: FontAsset[];
22
+
23
+ export const pageBackgroundImageAssets: ImageAsset[];
24
+
25
+ export const CustomCode: () => ReactNode;
26
+
27
+ export const Page: (props: { system: System }) => ReactNode;
28
+ }
29
+
30
+ declare module "__SERVER__" {
31
+ import type { PageMeta, System, ResourceRequest } from "@webstudio-is/sdk";
32
+
33
+ export const getResources: (props: { system: System }) => {
34
+ data: Map<string, ResourceRequest>;
35
+ action: Map<string, ResourceRequest>;
36
+ };
37
+
38
+ export const getPageMeta: (props: {
39
+ system: System;
40
+ resources: Record<string, any>;
41
+ }) => PageMeta;
42
+
43
+ type Params = Record<string, string | undefined>;
44
+ export const getRemixParams: ({ ...params }: Params) => Params;
45
+
46
+ export const projectId: string;
47
+
48
+ export const contactEmail: undefined | string;
49
+ }
50
+
51
+ declare module "__SITEMAP__" {
52
+ export const sitemap: Array<{
53
+ path: string;
54
+ lastModified: string;
55
+ }>;
56
+ }
57
+
58
+ declare module "__REDIRECT__" {
59
+ export const url: string;
60
+ export const status: number;
61
+ }