@webstudio-is/react-sdk 0.191.4 → 0.191.5

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.
@@ -0,0 +1,8 @@
1
+ import { componentAttribute, idAttribute, selectorIdAttribute } from "../props";
2
+ export type AnyComponent = React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & WebstudioComponentSystemProps & React.RefAttributes<HTMLElement>>;
3
+ export type Components = Map<string, AnyComponent>;
4
+ export type WebstudioComponentSystemProps = {
5
+ [componentAttribute]: string;
6
+ [idAttribute]: string;
7
+ [selectorIdAttribute]: string;
8
+ };
@@ -0,0 +1,37 @@
1
+ import type { ImageLoader } from "@webstudio-is/image";
2
+ export type Params = {
3
+ /**
4
+ * When rendering a published version, there is no renderer defined.
5
+ * - canvas is the builder canvas in dev mode
6
+ * - preview is the preview mode in builder
7
+ */
8
+ renderer?: "canvas" | "preview";
9
+ /**
10
+ * Base url ir base path for images with ending slash.
11
+ * Used for configuring image with different sizes.
12
+ * Concatinated with "name?width=&quality=&format=".
13
+ *
14
+ * For example
15
+ * /asset/image/ used by default in builder
16
+ * https://image-transform.wstd.io/cdn-cgi/image/
17
+ * https://webstudio.is/cdn-cgi/image/
18
+ */
19
+ imageBaseUrl: string;
20
+ /**
21
+ * Base url or base path for any asset with ending slash.
22
+ * Used to load assets like fonts or images in styles
23
+ * Concatinated with "name".
24
+ *
25
+ * For example
26
+ * /s/uploads/
27
+ * /asset/file/
28
+ * https://assets-dev.webstudio.is/
29
+ * https://assets.webstudio.is/
30
+ */
31
+ assetBaseUrl: string;
32
+ };
33
+ export declare const ReactSdkContext: import("react").Context<Params & {
34
+ imageLoader: ImageLoader;
35
+ resources: Record<string, any>;
36
+ }>;
37
+ export declare const useResource: (name: string) => any;