@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.
- package/lib/index.js +1735 -0
- package/lib/runtime.js +61 -0
- package/lib/types/component-generator.d.ts +37 -0
- package/lib/types/component-generator.test.d.ts +1 -0
- package/lib/types/components/component-meta.d.ts +3798 -0
- package/lib/types/components/components-utils.d.ts +8 -0
- package/lib/types/context.d.ts +37 -0
- package/lib/types/core-components.d.ts +748 -0
- package/lib/types/css/css.d.ts +21 -0
- package/lib/types/css/css.test.d.ts +1 -0
- package/lib/types/css/global-rules.d.ts +6 -0
- package/lib/types/css/index.d.ts +2 -0
- package/lib/types/embed-template.d.ts +2589 -0
- package/lib/types/embed-template.test.d.ts +1 -0
- package/lib/types/hook.d.ts +34 -0
- package/lib/types/hook.test.d.ts +1 -0
- package/lib/types/index.d.ts +12 -0
- package/lib/types/instance-utils.d.ts +4 -0
- package/lib/types/instance-utils.test.d.ts +1 -0
- package/lib/types/prop-meta.d.ts +434 -0
- package/lib/types/props.d.ts +104 -0
- package/lib/types/props.test.d.ts +1 -0
- package/lib/types/remix.d.ts +20 -0
- package/lib/types/remix.test.d.ts +1 -0
- package/lib/types/runtime.d.ts +4 -0
- package/lib/types/variable-state.d.ts +2 -0
- package/package.json +6 -6
|
@@ -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;
|