@uniformdev/canvas-react 17.6.1-alpha.60 → 17.7.1-alpha.140
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/dist/index.d.ts +10 -10
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -6,22 +6,22 @@ import React$1, { Key, ReactNode } from 'react';
|
|
|
6
6
|
* TProps is the Canvas component's parameters object after
|
|
7
7
|
* all enhancers have been applied.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
type ComponentProps<TProps = unknown> = TProps & {
|
|
10
10
|
component: ComponentInstance;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Function that maps a Canvas component instance to its React component to render it.
|
|
14
14
|
* The resolver would commonly inspect the `type` and possibly `variant` of the component to decide.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
type RenderComponentResolver = (component: ComponentInstance) => React.ComponentType<ComponentProps<any>> | null;
|
|
17
17
|
/** Function that renders Canvas system internals */
|
|
18
|
-
|
|
18
|
+
type SystemRenderFunction = (component: ComponentInstance, key: Key, renderChild: (component: ComponentInstance, key: Key) => JSX.Element | null) => JSX.Element | null;
|
|
19
19
|
/** Configures rendering of system components (tests, pz) */
|
|
20
|
-
|
|
20
|
+
type SystemRenderConfig = {
|
|
21
21
|
test: SystemRenderFunction;
|
|
22
22
|
personalization: SystemRenderFunction;
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
type ComponentStore = {
|
|
25
25
|
register: (options: {
|
|
26
26
|
type: string;
|
|
27
27
|
component: React.ComponentType<ComponentProps<any>>;
|
|
@@ -29,7 +29,7 @@ declare type ComponentStore = {
|
|
|
29
29
|
get: (name: string) => React.ComponentType<ComponentProps<any>> | undefined;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
type CompositionProps<TRenderProps = unknown> = {
|
|
33
33
|
/** The root component in the composition */
|
|
34
34
|
data: ComponentInstance;
|
|
35
35
|
/** Resolves a React component to render a Canvas component, generally by inspecting type/variant */
|
|
@@ -48,7 +48,7 @@ declare type CompositionProps<TRenderProps = unknown> = {
|
|
|
48
48
|
*/
|
|
49
49
|
behaviorTracking?: 'onLoad' | 'onView';
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
type CompositionContext = {
|
|
52
52
|
/** The parent composition */
|
|
53
53
|
composition: ComponentInstance;
|
|
54
54
|
/** The current function to translate component data into React components */
|
|
@@ -71,12 +71,12 @@ declare function Composition<TRenderProps = unknown>({ data, resolveRenderer, ch
|
|
|
71
71
|
**/
|
|
72
72
|
declare function DefaultNotImplementedComponent(props: ComponentProps): JSX.Element | null;
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
type CustomSlotChildRenderFunc = (options: {
|
|
75
75
|
child: ReactNode;
|
|
76
76
|
component: ComponentInstance;
|
|
77
77
|
key: Key;
|
|
78
78
|
}) => JSX.Element;
|
|
79
|
-
|
|
79
|
+
type SlotProps<TSlotNames extends string> = {
|
|
80
80
|
/** Name of the slot to render */
|
|
81
81
|
name: TSlotNames;
|
|
82
82
|
/**
|
|
@@ -96,7 +96,7 @@ declare type SlotProps<TSlotNames extends string> = {
|
|
|
96
96
|
/** Renders a named Slot within a Composition. */
|
|
97
97
|
declare function Slot<TSlotNames extends string = string>({ name, resolveRenderer, children, emptyPlaceholder, }: SlotProps<TSlotNames>): JSX.Element | null;
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
type UseCompositionEventEffectOptions = Omit<Partial<SubscribeToCompositionOptions>, 'callback'> & {
|
|
100
100
|
enabled: boolean;
|
|
101
101
|
effect: () => void;
|
|
102
102
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-react",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.7.1-alpha.140+80ab6baf9",
|
|
4
4
|
"description": "React SDK for Uniform Canvas",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"format": "prettier --write \"src/**/*.{js,ts,tsx}\""
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@uniformdev/canvas": "^17.
|
|
27
|
-
"@uniformdev/context": "^17.
|
|
28
|
-
"@uniformdev/context-react": "^17.
|
|
26
|
+
"@uniformdev/canvas": "^17.7.1-alpha.140+80ab6baf9",
|
|
27
|
+
"@uniformdev/context": "^17.7.1-alpha.140+80ab6baf9",
|
|
28
|
+
"@uniformdev/context-react": "^17.7.1-alpha.140+80ab6baf9"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": ">= 16",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "80ab6baf9edea6b520738bd3dff5c6afc882bf77"
|
|
46
46
|
}
|