@uniformdev/canvas-next-rsc-client 19.207.1-alpha.20 → 19.208.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/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +15 -5
- package/dist/index.js +15 -5
- package/dist/index.mjs +15 -5
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -54,8 +54,10 @@ declare const DefaultUniformClientContext: ClientContextComponent;
|
|
|
54
54
|
|
|
55
55
|
type PersonalizeClientProps = PersonalizeProps & {
|
|
56
56
|
indexes: number[];
|
|
57
|
+
slots: ComponentProps['slots'];
|
|
58
|
+
component: ComponentProps['component'];
|
|
57
59
|
};
|
|
58
|
-
declare const PersonalizeClient: (props:
|
|
60
|
+
declare const PersonalizeClient: (props: PersonalizeClientProps) => react.FunctionComponentElement<{
|
|
59
61
|
children?: react.ReactNode | undefined;
|
|
60
62
|
}>;
|
|
61
63
|
|
package/dist/index.d.ts
CHANGED
|
@@ -54,8 +54,10 @@ declare const DefaultUniformClientContext: ClientContextComponent;
|
|
|
54
54
|
|
|
55
55
|
type PersonalizeClientProps = PersonalizeProps & {
|
|
56
56
|
indexes: number[];
|
|
57
|
+
slots: ComponentProps['slots'];
|
|
58
|
+
component: ComponentProps['component'];
|
|
57
59
|
};
|
|
58
|
-
declare const PersonalizeClient: (props:
|
|
60
|
+
declare const PersonalizeClient: (props: PersonalizeClientProps) => react.FunctionComponentElement<{
|
|
59
61
|
children?: react.ReactNode | undefined;
|
|
60
62
|
}>;
|
|
61
63
|
|
package/dist/index.esm.js
CHANGED
|
@@ -947,11 +947,21 @@ var PersonalizeClient = (props) => {
|
|
|
947
947
|
const { context } = useUniformContext();
|
|
948
948
|
const [indexesToShow, setIndexesToShow] = useState6(props.indexes);
|
|
949
949
|
useEffect7(() => {
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
950
|
+
if (!context) {
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
953
|
+
const handleRunPersonalization = () => {
|
|
954
|
+
const result = runPersonalization({
|
|
955
|
+
...props,
|
|
956
|
+
contextInstance: context
|
|
957
|
+
});
|
|
958
|
+
setIndexesToShow(result.indexes);
|
|
959
|
+
};
|
|
960
|
+
context.events.on("scoresUpdated", handleRunPersonalization);
|
|
961
|
+
handleRunPersonalization();
|
|
962
|
+
return () => {
|
|
963
|
+
context.events.off("scoresUpdated", handleRunPersonalization);
|
|
964
|
+
};
|
|
955
965
|
}, [props, context]);
|
|
956
966
|
const slotsToShow = indexesToShow.map((key) => {
|
|
957
967
|
var _a;
|
package/dist/index.js
CHANGED
|
@@ -973,11 +973,21 @@ var PersonalizeClient = (props) => {
|
|
|
973
973
|
const { context } = useUniformContext();
|
|
974
974
|
const [indexesToShow, setIndexesToShow] = (0, import_react8.useState)(props.indexes);
|
|
975
975
|
(0, import_react8.useEffect)(() => {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
976
|
+
if (!context) {
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
const handleRunPersonalization = () => {
|
|
980
|
+
const result = (0, import_canvas_next_rsc_shared2.runPersonalization)({
|
|
981
|
+
...props,
|
|
982
|
+
contextInstance: context
|
|
983
|
+
});
|
|
984
|
+
setIndexesToShow(result.indexes);
|
|
985
|
+
};
|
|
986
|
+
context.events.on("scoresUpdated", handleRunPersonalization);
|
|
987
|
+
handleRunPersonalization();
|
|
988
|
+
return () => {
|
|
989
|
+
context.events.off("scoresUpdated", handleRunPersonalization);
|
|
990
|
+
};
|
|
981
991
|
}, [props, context]);
|
|
982
992
|
const slotsToShow = indexesToShow.map((key) => {
|
|
983
993
|
var _a;
|
package/dist/index.mjs
CHANGED
|
@@ -947,11 +947,21 @@ var PersonalizeClient = (props) => {
|
|
|
947
947
|
const { context } = useUniformContext();
|
|
948
948
|
const [indexesToShow, setIndexesToShow] = useState6(props.indexes);
|
|
949
949
|
useEffect7(() => {
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
950
|
+
if (!context) {
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
953
|
+
const handleRunPersonalization = () => {
|
|
954
|
+
const result = runPersonalization({
|
|
955
|
+
...props,
|
|
956
|
+
contextInstance: context
|
|
957
|
+
});
|
|
958
|
+
setIndexesToShow(result.indexes);
|
|
959
|
+
};
|
|
960
|
+
context.events.on("scoresUpdated", handleRunPersonalization);
|
|
961
|
+
handleRunPersonalization();
|
|
962
|
+
return () => {
|
|
963
|
+
context.events.off("scoresUpdated", handleRunPersonalization);
|
|
964
|
+
};
|
|
955
965
|
}, [props, context]);
|
|
956
966
|
const slotsToShow = indexesToShow.map((key) => {
|
|
957
967
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc-client",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.208.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"react-dom": "18.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@uniformdev/canvas": "19.
|
|
36
|
-
"@uniformdev/canvas-next-rsc-shared": "^19.
|
|
37
|
-
"@uniformdev/canvas-react": "^19.
|
|
35
|
+
"@uniformdev/canvas": "19.208.0",
|
|
36
|
+
"@uniformdev/canvas-next-rsc-shared": "^19.208.0",
|
|
37
|
+
"@uniformdev/canvas-react": "^19.208.0"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": ">=16.14.0"
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "9b96344a84cc37c1c54f9164b89ca7697611a2c0"
|
|
51
51
|
}
|